Class for handling named resources. More...
#include <resource_manager.h>
Public Member Functions | |
Non Real-Time Safe Functions | |
virtual | ~ResourceManager () |
std::vector< std::string > | getNames () const |
void | registerHandle (const ResourceHandle &handle) |
Register a new resource. If the resource name already exists, the previously stored resource value will be replaced with val. | |
ResourceHandle | getHandle (const std::string &name) |
Get a resource handle by name. | |
Protected Types | |
typedef std::map< std::string, ResourceHandle > | ResourceMap |
Protected Attributes | |
ResourceMap | resource_map_ |
Class for handling named resources.
Resources are encapsulated inside handle instances, and this class allows to register and get them by name.
ResourceHandle | Resource handle type. Must implement the following method: std::string getName() const; |
Definition at line 58 of file resource_manager.h.
typedef std::map<std::string, ResourceHandle> hardware_interface::ResourceManager< ResourceHandle >::ResourceMap [protected] |
Definition at line 119 of file resource_manager.h.
virtual hardware_interface::ResourceManager< ResourceHandle >::~ResourceManager | ( | ) | [inline, virtual] |
Definition at line 64 of file resource_manager.h.
ResourceHandle hardware_interface::ResourceManager< ResourceHandle >::getHandle | ( | const std::string & | name | ) | [inline] |
Get a resource handle by name.
name | Resource name. |
Reimplemented in hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy >, hardware_interface::HardwareResourceManager< ImuSensorHandle >, hardware_interface::HardwareResourceManager< JointStateHandle >, hardware_interface::HardwareResourceManager< ActuatorHandle >, hardware_interface::HardwareResourceManager< JointHandle, ClaimResources >, hardware_interface::HardwareResourceManager< ForceTorqueSensorHandle >, and hardware_interface::HardwareResourceManager< ActuatorStateHandle >.
Definition at line 103 of file resource_manager.h.
std::vector<std::string> hardware_interface::ResourceManager< ResourceHandle >::getNames | ( | ) | const [inline] |
Definition at line 67 of file resource_manager.h.
void hardware_interface::ResourceManager< ResourceHandle >::registerHandle | ( | const ResourceHandle & | handle | ) | [inline] |
Register a new resource. If the resource name already exists, the previously stored resource value will be replaced with val.
handle | Resource value. Its type should implement a std::string getName() method. |
Definition at line 83 of file resource_manager.h.
ResourceMap hardware_interface::ResourceManager< ResourceHandle >::resource_map_ [protected] |
Definition at line 120 of file resource_manager.h.