#include <ComponentLoader.hpp>
Definition at line 60 of file ComponentLoader.hpp.
std::string ComponentLoader::getComponentPath |
( |
| ) |
const |
Returns the current Component path list. Defaults to the value of RTT_COMPONENT_PATH, when the RTT was started for the current process.
- Returns
- A colon separated list of paths or the empty string if not set.
Definition at line 714 of file ComponentLoader.cpp.
const FactoryMap & ComponentLoader::getFactories |
( |
| ) |
const |
bool ComponentLoader::import |
( |
std::string const & |
path_list | ) |
|
Imports any Component library found in each path in path_list in the current process.
- Parameters
-
path_list | A colon or semi-colon seperated list of paths to look for Components. May be the empty string. |
- Returns
- true if all paths were valid and contained components. If at least one path did not exist or did not contain any components or plugins, returns false.
Definition at line 317 of file ComponentLoader.cpp.
bool ComponentLoader::import |
( |
std::string const & |
name, |
|
|
std::string const & |
path_list |
|
) |
| |
Imports a package found in each path in path_list in the current process.
- Parameters
-
name | The name of the (package) directory to import |
path_list | A colon or semi-colon seperated list of paths to look for Components. May be the empty string. In that case, the default component search path is used. |
Definition at line 387 of file ComponentLoader.cpp.
bool ComponentLoader::importInstalledPackage |
( |
std::string const & |
package, |
|
|
std::string const & |
path_list |
|
) |
| |
|
private |
Returns true if package is a subdir of the RTT_COMPONENT_PATH
Definition at line 425 of file ComponentLoader.cpp.
bool ComponentLoader::isCompatibleComponent |
( |
std::string const & |
filepath | ) |
|
|
private |
Internal helper function that validate if a component is compatible with the current target. Currently, there's a validation only on the win32 platform to avoid mixing debug/release runtime libraries.
- Parameters
-
filepath | Full path of component to validate (with extension). |
- Returns
- true if the component is compatible
Definition at line 788 of file ComponentLoader.cpp.
bool ComponentLoader::isImported |
( |
std::string |
type_name | ) |
|
Checks if a given Component type, filename or package name has been imported. This function accepts full filenames ('libthe_Component.so.1.99.0'), short names ('the_Component'), the name provided by the Component Factory ('App::Component'), or a package name ('myrobot')
- Parameters
-
type_name | name of a file, package directory or the Component type. |
- Returns
- true if so.
Definition at line 561 of file ComponentLoader.cpp.
std::vector< std::string > ComponentLoader::listComponents |
( |
| ) |
const |
std::vector< std::string > ComponentLoader::listComponentTypes |
( |
| ) |
const |
RTT::TaskContext * ComponentLoader::loadComponent |
( |
std::string const & |
name, |
|
|
std::string const & |
type |
|
) |
| |
Creates a new component an earlier discovered component type.
- Parameters
-
name | The name of the to be created Component |
type | The type of component to be created. |
- Returns
- null on error or a new component.
Definition at line 727 of file ComponentLoader.cpp.
bool ComponentLoader::loadInProcess |
( |
std::string |
filename, |
|
|
std::string |
shortname, |
|
|
bool |
log_error |
|
) |
| |
|
private |
Internal function that does all library loading.
- Parameters
-
filename | The path+filename to open |
shortname | The short name of this file |
log_error | Log errors to users. Set to false in case you are poking files to see if they can be loaded. |
- Returns
- true if a new library was loaded or if this library was already loaded.
Definition at line 618 of file ComponentLoader.cpp.
bool ComponentLoader::loadLibrary |
( |
std::string const & |
path | ) |
|
Loads a library as component library.
- Parameters
-
path | an absolute or relative path to a library. Relative paths are interpreted with regard to the plugin path. |
Definition at line 511 of file ComponentLoader.cpp.
void ComponentLoader::Release |
( |
| ) |
|
|
static |
bool ComponentLoader::reloadInProcess |
( |
std::string |
filename, |
|
|
std::string |
shortname |
|
) |
| |
|
private |
Internal function that does try to reload a previously loaded library by first dl_close'ing the library.
- Parameters
-
filename | The path+filename to open |
shortname | The short name of this file |
- Returns
- true if this library was reloaded.
Definition at line 575 of file ComponentLoader.cpp.
bool ComponentLoader::reloadLibrary |
( |
std::string const & |
filepath | ) |
|
Reloads a component library.
- Parameters
-
filepath | an absolute path to a library. |
Definition at line 497 of file ComponentLoader.cpp.
void ComponentLoader::setComponentPath |
( |
std::string const & |
newpath | ) |
|
Sets the Component path list. This is typically done by RTT startup code with the contents of the RTT_COMPONENT_PATH variable.
- Parameters
-
newpath | The new paths to look for Components. |
Definition at line 722 of file ComponentLoader.cpp.
Destroys an earlier created component.
- Parameters
-
tc | The TaskContext to be destroyed. tc may no longer be used after this function returns true. |
- Returns
- false if tc was not loaded by this ComponentLoader.
Definition at line 763 of file ComponentLoader.cpp.
std::string RTT::ComponentLoader::component_path |
|
private |
std::vector< LoadedLib > RTT::ComponentLoader::loadedLibs |
|
private |
std::vector< std::string > RTT::ComponentLoader::loadedPackages |
|
private |
The documentation for this class was generated from the following files: