A container for a device driver. More...
#include <yarp/dev/PolyDriver.h>
Classes | |
class | Private |
Public Member Functions | |
PolyDriver () | |
Constructor. More... | |
PolyDriver (const std::string &txt) | |
Construct and configure a device by its common name. More... | |
PolyDriver (yarp::os::Searchable &config) | |
Create and configure a device, by name. More... | |
virtual | ~PolyDriver () |
Destructor. More... | |
PolyDriver (const PolyDriver &alt)=delete | |
const PolyDriver & | operator= (const PolyDriver &alt)=delete |
bool | open (const std::string &txt) |
Construct and configure a device by its common name. More... | |
bool | open (yarp::os::Searchable &config) override |
Create and configure a device, by name. More... | |
bool | link (PolyDriver &alt) |
Make this device be a link to an existing one. More... | |
DeviceDriver * | take () |
Gets the device this object manages. More... | |
bool | give (DeviceDriver *dd, bool own) |
Take on management of a device. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
bool | isValid () const |
Check if device is valid. More... | |
yarp::os::Bottle | getOptions () |
After a call to PolyDriver::open, you can get a list of all the options checked by the device. More... | |
std::string | getComment (const char *option) |
After a call to PolyDriver::open, you can check if the device has documentation on a given option. More... | |
yarp::os::Value | getDefaultValue (const char *option) |
After a call to PolyDriver::open, you can check if a given option has a particular default value. More... | |
yarp::os::Value | getValue (const char *option) |
After a call to PolyDriver::open, you can check what value was found for a particular option, if any. More... | |
DeviceDriver * | getImplementation () override |
Some drivers are bureaucrats, pointing at others. More... | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
Public Member Functions inherited from yarp::os::IConfig | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
A container for a device driver.
Definition at line 25 of file PolyDriver.h.
PolyDriver::PolyDriver | ( | ) |
Constructor.
Definition at line 111 of file PolyDriver.cpp.
PolyDriver::PolyDriver | ( | const std::string & | txt | ) |
Construct and configure a device by its common name.
txt | common name of the device |
Definition at line 118 of file PolyDriver.cpp.
PolyDriver::PolyDriver | ( | yarp::os::Searchable & | config | ) |
Create and configure a device, by name.
The config object should have a property called "device" that is set to the common name of the device. All other properties are passed on the the device's DeviceDriver::open method.
config | configuration options for the device |
Definition at line 126 of file PolyDriver.cpp.
|
virtual |
Destructor.
Definition at line 134 of file PolyDriver.cpp.
|
delete |
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 176 of file PolyDriver.cpp.
std::string PolyDriver::getComment | ( | const char * | option | ) |
After a call to PolyDriver::open, you can check if the device has documentation on a given option.
option | the name of the option to check |
Definition at line 231 of file PolyDriver.cpp.
Value PolyDriver::getDefaultValue | ( | const char * | option | ) |
After a call to PolyDriver::open, you can check if a given option has a particular default value.
option | the name of the option to check |
Definition at line 239 of file PolyDriver.cpp.
|
overridevirtual |
Some drivers are bureaucrats, pointing at others.
Such drivers override this method.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 367 of file PolyDriver.cpp.
Bottle PolyDriver::getOptions | ( | ) |
After a call to PolyDriver::open, you can get a list of all the options checked by the device.
Definition at line 223 of file PolyDriver.cpp.
Value PolyDriver::getValue | ( | const char * | option | ) |
After a call to PolyDriver::open, you can check what value was found for a particular option, if any.
option | the name of the option to check |
Definition at line 247 of file PolyDriver.cpp.
bool PolyDriver::give | ( | DeviceDriver * | dd, |
bool | own | ||
) |
Take on management of a device.
The PolyDriver may be responsible for destroying it.
dd | the device to manage. |
own | true if PolyDriver should destroy device when done. |
Definition at line 351 of file PolyDriver.cpp.
bool PolyDriver::isValid | ( | ) | const |
Check if device is valid.
Definition at line 199 of file PolyDriver.cpp.
bool PolyDriver::link | ( | PolyDriver & | alt | ) |
Make this device be a link to an existing one.
The device will be reference counted, and destroyed when the last relevant call to close() is made.
alt | the device to link to |
Definition at line 204 of file PolyDriver.cpp.
bool PolyDriver::open | ( | const std::string & | txt | ) |
Construct and configure a device by its common name.
txt | common name of the device |
Definition at line 143 of file PolyDriver.cpp.
|
inlineoverride |
Open the DeviceDriver.
config | is a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Definition at line 58 of file DeviceDriver.h.
|
overridevirtual |
Create and configure a device, by name.
The config object should have a property called "device" that is set to the common name of the device. All other properties are passed on the the device's DeviceDriver::open method.
config | configuration options for the device |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 151 of file PolyDriver.cpp.
|
delete |
DeviceDriver * PolyDriver::take | ( | ) |
Gets the device this object manages.
The user is then responsible for managing it.
Definition at line 343 of file PolyDriver.cpp.