Public Types
hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy > Class Template Reference

Base class for handling hardware resources. More...

#include <hardware_resource_manager.h>

Inheritance diagram for hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy >:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

template<class ResourceHandle, class ClaimPolicy = DontClaimResources>
class hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy >

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
 }
Template Parameters:
ResourceHandleResource handle type. The only requisite on the type is that it implements a std::string getName() method.
ClaimPolicySpecifies the resource claiming policy for resource handling

Definition at line 79 of file hardware_resource_manager.h.


Member Typedef Documentation

template<class ResourceHandle, class ClaimPolicy = DontClaimResources>
typedef ResourceHandle hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy >::ResourceHandleType

Definition at line 82 of file hardware_resource_manager.h.


Member Function Documentation

template<class ResourceHandle, class ClaimPolicy = DontClaimResources>
ResourceHandle hardware_interface::HardwareResourceManager< ResourceHandle, ClaimPolicy >::getHandle ( const std::string &  name) [inline]

Get a resource handle by name.

Note:
If the ClaimPolicy template parameter is set to ClaimResources, calling this method will internally claim the resource. If set to DontClaimResources, calling this method will not claim the resource.
Parameters:
nameResource name.
Returns:
Resource associated to name. If the resource name is not found, an exception is thrown.

Reimplemented from hardware_interface::ResourceManager< ResourceHandle >.

Definition at line 96 of file hardware_resource_manager.h.


The documentation for this class was generated from the following file:


hardware_interface
Author(s): Wim Meeussen, Adolfo Rodriguez Tsouroukdissian
autogenerated on Thu Dec 1 2016 03:45:48