![]() |
Tesseract 0.28.4
|
A general resource loaders using environment variable. More...
#include <resource_locator.h>

Public Types | |
| using | Ptr = std::shared_ptr<GeneralResourceLocator> |
| using | ConstPtr = std::shared_ptr<const GeneralResourceLocator> |
| Public Types inherited from tesseract::common::ResourceLocator | |
| using | Ptr = std::shared_ptr<ResourceLocator> |
| using | ConstPtr = std::shared_ptr<const ResourceLocator> |
Public Member Functions | |
| GeneralResourceLocator (const std::vector< std::string > &environment_variables={ "TESSERACT_RESOURCE_PATH", "ROS_PACKAGE_PATH", "AMENT_PREFIX_PATH" }) | |
| Construct a new General Resource Locator object using the TESSERACT_RESOURCE_PATH environment variable. | |
| GeneralResourceLocator (const std::vector< std::filesystem::path > &paths, const std::vector< std::string > &environment_variables={ "TESSERACT_RESOURCE_PATH", "ROS_PACKAGE_PATH", "AMENT_PREFIX_PATH" }) | |
| Construct a new General Resource Locator object using the provided paths and/or the TESSERACT_RESOURCE_PATH environment variable. | |
| GeneralResourceLocator (const GeneralResourceLocator &)=default | |
| GeneralResourceLocator & | operator= (const GeneralResourceLocator &)=default |
| GeneralResourceLocator (GeneralResourceLocator &&)=default | |
| GeneralResourceLocator & | operator= (GeneralResourceLocator &&)=default |
| std::shared_ptr< Resource > | locateResource (const std::string &url) const override |
| Locate a resource based on a URL. | |
| bool | operator== (const GeneralResourceLocator &rhs) const |
| bool | operator!= (const GeneralResourceLocator &rhs) const |
| bool | addPath (const std::filesystem::path &path) |
| Add path to the resource locator. | |
| bool | loadEnvironmentVariable (const std::string &environment_variable) |
| Load paths from an environment variable. | |
| Public Member Functions inherited from tesseract::common::ResourceLocator | |
| bool | operator== (const ResourceLocator &rhs) const |
| bool | operator!= (const ResourceLocator &rhs) const |
Friends | |
| template<class Archive> | |
| friend | void::tesseract::common::serialize (Archive &ar, GeneralResourceLocator &obj) |
A general resource loaders using environment variable.
Also can set this environment variable TESSERACT_RESOURCE_PATH with ':' separated directories and then use the directires as package names
| tesseract::common::GeneralResourceLocator::GeneralResourceLocator | ( | const std::vector< std::string > & | environment_variables = { "TESSERACT_RESOURCE_PATH", "ROS_PACKAGE_PATH", "AMENT_PREFIX_PATH" } | ) |
Construct a new General Resource Locator object using the TESSERACT_RESOURCE_PATH environment variable.
| environment_variables | A vector of environment variables to search for paths |
| tesseract::common::GeneralResourceLocator::GeneralResourceLocator | ( | const std::vector< std::filesystem::path > & | paths, |
| const std::vector< std::string > & | environment_variables = { "TESSERACT_RESOURCE_PATH", "ROS_PACKAGE_PATH", "AMENT_PREFIX_PATH" } ) |
Construct a new General Resource Locator object using the provided paths and/or the TESSERACT_RESOURCE_PATH environment variable.
| paths | A vector of paths to search for resources |
| environment_variables | A vector of environment variables to search for paths |
|
overridevirtual |
Locate a resource based on a URL.
| url | The URL of the resource |
Implements tesseract::common::ResourceLocator.
| bool tesseract::common::GeneralResourceLocator::addPath | ( | const std::filesystem::path & | path | ) |
Add path to the resource locator.
| path | The path to add. Must be a directory |
| bool tesseract::common::GeneralResourceLocator::loadEnvironmentVariable | ( | const std::string & | environment_variable | ) |
Load paths from an environment variable.
| environment_variable | The environment variable to load paths from |