|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_PORTREADERBUFFER_INL_H
11 #define YARP_OS_PORTREADERBUFFER_INL_H
19 default_value(nullptr),
37 if (reader !=
nullptr) {
42 if (default_value !=
nullptr) {
44 default_value =
nullptr;
53 autoDiscard = !strict;
83 if (last !=
nullptr) {
96 if (last ==
nullptr) {
97 if (default_value ==
nullptr) {
98 default_value =
new T;
100 last = default_value;
106 template <
typename T>
112 template <
typename T>
118 template <
typename T>
125 template <
typename T>
128 if (reader !=
nullptr) {
136 template <
typename T>
139 if (reader !=
nullptr) {
146 template <
typename T>
152 template <
typename T>
158 template <
typename T>
164 template <
typename T>
170 template <
typename T>
176 template <
typename T>
182 template <
typename T>
188 template <
typename T>
194 template <
typename T>
200 template <
typename T>
206 template <
typename T>
213 #endif // YARP_OS_PORTREADERBUFFER_INL_H
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()
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.
void setCreator(PortReaderBufferBaseCreator *creator)
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.
void setStrict(bool strict=true) override
Call this to strictly keep all messages, or allow old ones to be quietly dropped.
RandScalar * implementation(void *t)
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.