7#ifndef YARP_OS_PORTREADERBUFFER_INL_H
8#define YARP_OS_PORTREADERBUFFER_INL_H
16 default_value(nullptr),
34 if (reader !=
nullptr) {
39 if (default_value !=
nullptr) {
41 default_value =
nullptr;
80 if (last !=
nullptr) {
93 if (last ==
nullptr) {
94 if (default_value ==
nullptr) {
95 default_value =
new T;
125 if (reader !=
nullptr) {
136 if (reader !=
nullptr) {
RandScalar * implementation(void *t)
A mini-server for performing network communication in the background.
void * acquire() override
Take control of the last object read.
std::string getName() const override
Get name of port.
bool getEnvelope(PortReader &envelope) override
Get the envelope information (e.g., a timestamp) from the last message received on the port.
void release(void *handle) override
Return control to YARP of an object previously taken control of with the acquire() method.
void interrupt() override
Interrupt any current reads or writes attached to the port.
bool isClosed() override
Returns whether the port associated with this reader has been closed.
T * read(bool shouldWait=true) override
Read an available object from the port.
void setTargetPeriod(double period) override
Try to provide data periodically.
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.
void setCreator(PortReaderBufferBaseCreator *creator)
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.
PortReaderBuffer(unsigned int maxBuffer=0)
Constructor.
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.