Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
plugin_loader.h
Go to the documentation of this file.
1
26#ifndef TESSERACT_COMMON_PLUGIN_LOADER_H
27#define TESSERACT_COMMON_PLUGIN_LOADER_H
28
31#include <set>
32#include <unordered_map>
33#include <string>
34#include <memory>
35#include <vector>
37
38namespace tesseract_common
39{
57{
58public:
61
63 std::set<std::string> search_paths;
64
66 std::set<std::string> search_libraries;
67
69 std::string search_paths_env;
70
78
84 template <class PluginBase>
85 std::shared_ptr<PluginBase> instantiate(const std::string& plugin_name) const;
86
92 inline bool isPluginAvailable(const std::string& plugin_name) const;
93
100 template <class PluginBase>
101 std::vector<std::string> getAvailablePlugins() const;
102
108 inline std::vector<std::string> getAvailablePlugins(const std::string& section) const;
109
114 inline std::vector<std::string> getAvailableSections(bool include_hidden = false) const;
115
120 inline int count() const;
121
133 static inline void addSymbolLibraryToSearchLibrariesEnv(const void* symbol_ptr,
134 const std::string& search_libraries_env);
135};
136
137} // namespace tesseract_common
138
140
141#endif // TESSERACT_COMMON_PLUGIN_LOADER_H
This is a utility class for loading plugins within Tesseract.
Definition: plugin_loader.h:57
static void addSymbolLibraryToSearchLibrariesEnv(const void *symbol_ptr, const std::string &search_libraries_env)
Utility function to add library containing symbol to the search env variable.
Definition: plugin_loader.hpp:287
std::set< std::string > search_paths
A list of paths to search for plugins.
Definition: plugin_loader.h:63
std::string search_paths_env
The environment variable containing plugin search paths.
Definition: plugin_loader.h:69
std::shared_ptr< PluginBase > instantiate(const std::string &plugin_name) const
Instantiate a plugin with the provided name.
Definition: plugin_loader.hpp:110
std::vector< std::string > getAvailableSections(bool include_hidden=false) const
Get the available sections within the provided search libraries.
Definition: plugin_loader.hpp:248
int count() const
The number of plugins stored. The size of plugins variable.
Definition: plugin_loader.hpp:282
std::set< std::string > search_libraries
A list of library names without the prefix or suffix that contain plugins.
Definition: plugin_loader.h:66
bool isPluginAvailable(const std::string &plugin_name) const
Check if plugin is available.
Definition: plugin_loader.hpp:166
std::vector< std::string > getAvailablePlugins() const
Get the available plugins for the provided PluginBase type.
Definition: plugin_loader.hpp:209
std::string search_libraries_env
The environment variable containing plugins.
Definition: plugin_loader.h:77
bool search_system_folders
Indicate is system folders may be search if plugin is not found in any of the paths.
Definition: plugin_loader.h:60
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: allowed_collision_matrix.h:16
Plugin Loader to be used throughout Tesseract for loading plugins.