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