Base class for handling hardware resources. More...
#include <hardware_resource_manager.h>
Public Types | |
typedef ResourceHandle | ResourceHandleType |
Public Member Functions | |
Non Real-Time Safe Functions | |
ResourceHandle | getHandle (const std::string &name) |
Get a resource handle by name. |
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
// If unspecified, the resource manager will not claim resources { HardwareResourceManager<JointStateHandle> m; // Populate m m.getHandle("handle_name"); // DOES NOT claim the "handle_name" resource } // Explicitly set ClaimPolicy to DontClaimResources { HardwareResourceManager<JointStateHandle, DontClaimResources> m; // Populate m m.getHandle("handle_name"); // DOES NOT claim the "handle_name" resource } // Explicitly set ClaimPolicy to ClaimResources { HardwareResourceManager<JointHandle, ClaimResources> m; // Populate m m.getHandle("handle_name"); // DOES claim the "handle_name" resource }
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.
ResourceHandle hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy >::getHandle | ( | const std::string & | name | ) | [inline] |
Get a resource handle by name.
name | Resource name. |
Reimplemented from hardware_interface::ResourceManager< ResourceHandle >.
Definition at line 96 of file hardware_resource_manager.h.