|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_PORTREADERBUFFER_H
11 #define YARP_OS_PORTREADERBUFFER_H
60 void setStrict(
bool strict =
true)
override;
74 T*
read(
bool shouldWait =
true)
override;
125 std::string
getName()
const override;
137 void release(
void* handle)
override;
155 #endif // YARP_OS_PORTREADERBUFFER_H
A base class for sources of typed data.
void * acquire() override
Take control of the last object read.
bool check()
Check if data is available.
bool acceptObject(T *obj, PortWriter *wrapper) override
Send object obj; expect callback to wrapper when obj is no longer in use.
void disableCallback() override
Remove a callback set up with useCallback()
Buffer incoming data to a port.
A callback for typed data from a port.
void attach(Port &port)
Attach this buffer to a particular port.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
void interrupt() override
Abort any read operation currently in progress.
A mini-server for network communication.
virtual ~PortReaderBuffer()
Destructor.
PortReader * create() const override
Factory method.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
std::string getName() const override
Get name of port being read from.
T * lastRead() override
Get the last data returned by read()
int getPendingReads() override
Check how many messages are waiting to be read.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
virtual bool getEnvelope(PortReader &envelope)
bool isClosed() override
Returns whether the port associated with this reader has been closed.
void setTargetPeriod(double period) override
Try to provide data periodically.
PortReaderBuffer(unsigned int maxBuffer=0)
Constructor.
T * read(bool shouldWait=true) override
Read an available object from the port.
void setReplier(PortReader &reader) override
If a message is received that requires a reply, use this handler.
An interface for reading from a network connection.
The main, catch-all namespace for YARP.
void setStrict(bool strict=true) override
Call this to strictly keep all messages, or allow old ones to be quietly dropped.
bool forgetObject(T *obj, yarp::os::PortWriter *wrapper) override
Sender is no longer interested in getting callbacks.
void release(void *handle) override
Return control to YARP of an object previously taken control of with the acquire() method.