|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_DEV_DEVICEDRIVER_H
11 #define YARP_DEV_DEVICEDRIVER_H
27 class DeprecatedDeviceDriver;
28 class DeviceResponder;
64 bool close()
override {
return true; }
153 void addUsage(
const char *txt,
const char *explain =
nullptr);
209 #endif // YARP_DEV_DEVICEDRIVER_H
A simple collection of objects that can be described and transmitted in a portable way.
virtual void setReplier(PortReader &reader)=0
If a message is received that requires a reply, use this handler.
A base class for nested structures that can be searched.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
Interface implemented by all device drivers.
A callback for typed data from a port.
virtual bool respond(const yarp::os::Bottle &command, yarp::os::Bottle &reply)
Respond to a message.
bool view(T *&x)
Get an interface to the device driver.
virtual DeviceDriver * getImplementation()
Some drivers are bureaucrats, pointing at others.
void addUsage(const char *txt, const char *explain=nullptr)
Add information about a message that the respond() method understands.
void attach(yarp::os::TypedReader< yarp::os::Bottle > &source)
Attach this object to a source of messages.
void makeUsage()
Regenerate usage information.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
An object that can be configured.
void onRead(yarp::os::Bottle &v) override
Alternative handler for reading messages from the network, and passing them on to the respond() metho...
bool read(yarp::os::ConnectionReader &connection) override
Handler for reading messages from the network, and passing them on to the respond() method.
An interface for reading from a network connection.
bool close() override
Close the DeviceDriver.
A cheap and cheerful framework for human readable/writable forms of messages to devices.
Interface implemented by deprecated device drivers.
The main, catch-all namespace for YARP.
DeviceResponder()
Constructor.
virtual void useCallback(TypedReaderCallback< T > &callback)=0
Set an object whose onRead method will be called when data is available.
~DeviceDriver() override=default
Destructor.