Base class for handling hardware resources. More...
#include <hardware_resource_manager.h>
Public Types | |
typedef ResourceHandle | ResourceHandleType |
Public Types inherited from hardware_interface::ResourceManager< ResourceHandle > | |
typedef ResourceManager< ResourceHandle > | resource_manager_type |
Public Member Functions | |
Non Real-Time Safe Functions | |
ResourceHandle | getHandle (const std::string &name) |
Get a resource handle by name. More... | |
Public Member Functions inherited from hardware_interface::HardwareInterface | |
virtual | ~HardwareInterface () |
virtual void | claim (std::string resource) |
Claim a resource by name. More... | |
void | clearClaims () |
Clear the resources this interface is claiming. More... | |
std::set< std::string > | getClaims () const |
Get the list of resources this interface is currently claiming. More... | |
Public Member Functions inherited from hardware_interface::ResourceManager< ResourceHandle > | |
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. More... | |
ResourceHandle | getHandle (const std::string &name) |
Get a resource handle by name. More... | |
Public Member Functions inherited from hardware_interface::ResourceManagerBase | |
virtual | ~ResourceManagerBase () |
Additional Inherited Members | |
Static Public Member Functions inherited from hardware_interface::ResourceManager< ResourceHandle > | |
static void | concatManagers (std::vector< resource_manager_type * > &managers, resource_manager_type *result) |
Combine a list of interfaces into one. More... | |
Protected Types inherited from hardware_interface::ResourceManager< ResourceHandle > | |
typedef std::map< std::string, ResourceHandle > | ResourceMap |
Protected Attributes inherited from hardware_interface::ResourceManager< ResourceHandle > | |
ResourceMap | resource_map_ |
Base class for handling hardware resources.
Hardware resources are encapsulated inside handle instances, and this class allows to register and get them by name. It is also possible to specify through the ClaimPolicy template parameter whether getting a handle claims the corresponding resource or not, like in the following example
ResourceHandle | Resource handle type. The only requisite on the type is that it implements a std::string getName() method. |
ClaimPolicy | Specifies the resource claiming policy for resource handling |
Definition at line 79 of file hardware_resource_manager.h.
typedef ResourceHandle hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy >::ResourceHandleType |
Definition at line 82 of file hardware_resource_manager.h.
|
inline |
Get a resource handle by name.
name | Resource name. |
Definition at line 96 of file hardware_resource_manager.h.