Immutable container for YARP raw interface handles.
More...
#include <RawDevice.hpp>
|
| RawDevice (yarp::dev::PolyDriver *driver) |
| Constructor, extracts all interface handles of the supplied driver.
|
|
| ~RawDevice () |
| Destructor.
|
|
template<typename T > |
T * | getHandle () const |
| Retrieve a handle to a raw interface implemented by the device. More...
|
|
std::string | getId () const |
| Retrieve the device id (can be an empty string if not set). More...
|
|
template<typename T > |
T * | castToType () const |
| Perform a dynamic cast on the given type. More...
|
|
bool | isValid () const |
| Whether this instance wraps a device with a supported interface. More...
|
|
template<> |
yarp::dev::IAmplifierControlRaw * | getHandle () const |
|
|
std::unique_ptr< Private > | priv |
|
yarp::dev::PolyDriver * | driver {nullptr} |
|
bool | valid {false} |
|
Performs all RTTI stuff on initial configuration to avoid abusing dynamic_cast on runtime.
◆ castToType()
template<typename T >
T* roboticslab::RawDevice::castToType |
( |
| ) |
const |
|
inline |
- Template Parameters
-
T | A type the original driver should be able to be cast to. |
◆ getHandle()
template<typename T >
T* roboticslab::RawDevice::getHandle |
( |
| ) |
const |
◆ getId()
std::string roboticslab::RawDevice::getId |
( |
| ) |
const |
|
inline |
- Returns
- A string containing the device id.
◆ isValid()
bool roboticslab::RawDevice::isValid |
( |
| ) |
const |
|
inline |
- Returns
- True if the device exists and has at least one supported interface.
The documentation for this class was generated from the following files:
- libraries/YarpDeviceMapperLib/RawDevice.hpp
- libraries/YarpDeviceMapperLib/RawDevice.cpp