SOFA API  1c8b807d
Open source framework for multi-physics simuation
sofa::core::PathResolver Class Reference

#include <PathResolver.h>

This class exposes an API to query a context to find Base* or a BaseData*. More...

Detailed Description

This class exposes an API to query a context to find Base* or a BaseData*.

Static Public Member Functions

static BaseFindBaseFromPath (const Base *base, const std::string &path)
 
static BaseFindBaseFromClassAndPath (const Base *base, const BaseClass *destType, const std::string &path)
 
static BaseDataFindBaseDataFromPath (Base *base, const std::string &path)
 
static BaseDataFindBaseDataFromPath (const BaseData *context, const std::string &path)
 
static bool PathHasValidSyntax (const std::string &path)
 
static bool FindDataLinkDest (Base *base, BaseData *&ptr, const std::string &path, const BaseLink *link)
 
static BaseFindLinkDestClass (Base *context, const BaseClass *destType, const std::string &path, const BaseLink *link)
 
template<class T >
static bool FindLinkDest (Base *base, T *&ptr, const std::string &path, const BaseLink *link)
 
static sofa::core::objectmodel::BaseFindLink (sofa::core::objectmodel::Base *base, const std::string &path)
 
template<class T >
static bool CheckPath (Base *base, T *&, const std::string &path, const BaseLink *link)
 
template<class T >
static bool CheckPath (Base *context, const std::string &path)
 
static bool CheckPath (sofa::core::objectmodel::Base *context, const std::string &path)
 Check that a given path is valid and that the pointed object exists regardless of its type. More...
 
static bool CheckPaths (Base *context, const BaseClass *linktype, const std::string &pathes)
 Check that a given set of path is valid and that the pointed object exists and is of the right type. More...
 
static bool CheckPath (sofa::core::objectmodel::Base *context, const BaseClass *classType, const std::string &path)
 Check that a given path is valid that the pointed object exists and is of the right type. More...
 

Function details

◆ CheckPath() [1/4]

template<class T >
static bool sofa::core::PathResolver::CheckPath ( Base base,
T *&  ,
const std::string &  path,
const BaseLink link 
)
inlinestatic

◆ CheckPath() [2/4]

template<class T >
static bool sofa::core::PathResolver::CheckPath ( Base context,
const std::string &  path 
)
inlinestatic

◆ CheckPath() [3/4]

bool sofa::core::PathResolver::CheckPath ( sofa::core::objectmodel::Base context,
const BaseClass classType,
const std::string &  path 
)
static

Check that a given path is valid that the pointed object exists and is of the right type.

◆ CheckPath() [4/4]

static bool sofa::core::PathResolver::CheckPath ( sofa::core::objectmodel::Base context,
const std::string &  path 
)
static

Check that a given path is valid and that the pointed object exists regardless of its type.

◆ CheckPaths()

bool sofa::core::PathResolver::CheckPaths ( Base context,
const BaseClass linktype,
const std::string &  pathes 
)
static

Check that a given set of path is valid and that the pointed object exists and is of the right type.

Check that a given list of path is valid, that the pointed object exists and is of the right type.

◆ FindBaseDataFromPath() [1/2]

BaseData * sofa::core::PathResolver::FindBaseDataFromPath ( Base base,
const std::string &  path 
)
static

◆ FindBaseDataFromPath() [2/2]

BaseData * sofa::core::PathResolver::FindBaseDataFromPath ( const BaseData context,
const std::string &  path 
)
static

◆ FindBaseFromClassAndPath()

Base * sofa::core::PathResolver::FindBaseFromClassAndPath ( const Base base,
const BaseClass destType,
const std::string &  path 
)
static

◆ FindBaseFromPath()

Base * sofa::core::PathResolver::FindBaseFromPath ( const Base base,
const std::string &  path 
)
static

◆ FindDataLinkDest()

bool sofa::core::PathResolver::FindDataLinkDest ( Base base,
BaseData *&  ptr,
const std::string &  path,
const BaseLink link 
)
static

ALL THE FOLLOWING IS DUPLICATING THE SOFA API..... The general idea is to move here all code related to path resolution so we can see if there is duplicated code

◆ FindLink()

static sofa::core::objectmodel::Base* sofa::core::PathResolver::FindLink ( sofa::core::objectmodel::Base base,
const std::string &  path 
)
static

◆ FindLinkDest()

template<class T >
static bool sofa::core::PathResolver::FindLinkDest ( Base base,
T *&  ptr,
const std::string &  path,
const BaseLink link 
)
inlinestatic

◆ FindLinkDestClass()

Base * sofa::core::PathResolver::FindLinkDestClass ( Base context,
const BaseClass destType,
const std::string &  path,
const BaseLink link 
)
static

◆ PathHasValidSyntax()

bool sofa::core::PathResolver::PathHasValidSyntax ( const std::string &  path)
static