|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_CONNECTIONREADER_H
11 #define YARP_OS_CONNECTIONREADER_H
23 class ConnectionWriter;
61 virtual std::string
expectText(
const char terminatingChar =
'\n') = 0;
68 virtual std::string expectString()
71 std::int32_t len = expectInt32();
73 ret.resize(
static_cast<size_t>(len));
74 expectBlock(
const_cast<char*
>(
ret.data()), len);
85 virtual
int expectInt() final
87 return static_cast<int>(expectInt32());
120 virtual
double expectDouble()
122 return static_cast<double>(expectFloat64());
181 virtual Bytes readEnvelope();
267 virtual void setParentConnectionReader(
ConnectionReader* parentConnectionReader);
273 #endif // YARP_OS_CONNECTIONREADER_H
This is a base class for objects that can be both read from and be written to the YARP network.
A base class for nested structures that can be searched.
virtual const Searchable & getConnectionModifiers() const =0
Access modifiers associated with the connection, if any.
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual size_t getSize() const =0
Checks how much data is available.
virtual bool isValid() const =0
virtual std::int8_t expectInt8()=0
Read a 8-bit integer from the network connection.
virtual yarp::conf::float64_t expectFloat64()=0
Read a 64-bit floating point number from the network connection.
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual std::int64_t expectInt64()=0
Read a 64-bit integer from the network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual ConnectionWriter * getWriter()=0
Gets a way to reply to the message, if possible.
A simple abstraction for a block of bytes.
virtual ~ConnectionReader()
Destructor.
virtual bool isActive() const =0
#define YARP_DEPRECATED_INTERNAL_MSG(X)
An interface for reading from a network connection.
virtual bool setSize(size_t len)=0
virtual Contact getLocalContact() const =0
Gets information about who is receiving the data, if that information is available.
virtual Portable * getReference() const =0
Get a direct pointer to the object being sent, if possible.
virtual std::int16_t expectInt16()=0
Read a 16-bit integer from the network connection.
virtual bool pushInt(int x)=0
Store an integer to return on the next call to expectInt()
virtual std::string expectText(const char terminatingChar='\n')=0
Read some text from the network connection.
The main, catch-all namespace for YARP.
virtual bool isTextMode() const =0
Check if the connection is text mode.
virtual yarp::conf::float32_t expectFloat32()=0
Read a 32-bit floating point number from the network connection.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
virtual Contact getRemoteContact() const =0
Gets information about who is supplying the data being read, if that information is available.
virtual void requestDrop()=0
Tag the connection to be dropped after the current message.