7#ifndef YARP_OS_CONNECTIONREADER_H
8#define YARP_OS_CONNECTIONREADER_H
19class ConnectionWriter;
65 std::int32_t len = expectInt32();
67 ret.resize(
static_cast<size_t>(len));
68 expectBlock(
const_cast<char*
>(
ret.data()), len);
153 virtual Bytes readEnvelope();
239 virtual void setParentConnectionReader(
ConnectionReader* parentConnectionReader);
A mini-server for performing network communication in the background.
A simple abstraction for a block of bytes.
An interface for reading from a network connection.
virtual std::string expectString()
Read a string from the network connection.
virtual bool isTextMode() const =0
Check if the connection is text mode.
virtual size_t getSize() const =0
Checks how much data is available.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
virtual void flushWriter()=0
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual bool pushInt(int x)=0
Store an integer to return on the next call to expectInt()
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual void requestDrop()=0
Tag the connection to be dropped after the current message.
virtual ConnectionWriter * getWriter()=0
Gets a way to reply to the message, if possible.
virtual std::string expectText(const char terminatingChar='\n')=0
Read some text from the network connection.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual Portable * getReference() const =0
Get a direct pointer to the object being sent, if possible.
virtual yarp::conf::float32_t expectFloat32()=0
Read a 32-bit floating point number 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 bool setSize(size_t len)=0
virtual std::int64_t expectInt64()=0
Read a 64-bit integer from the network connection.
virtual Contact getLocalContact() const =0
Gets information about who is receiving the data, if that information is available.
virtual bool isActive() const =0
virtual ~ConnectionReader()
Destructor.
virtual bool isValid() const =0
virtual bool isError() const =0
virtual std::int16_t expectInt16()=0
Read a 16-bit integer from the network connection.
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 const Searchable & getConnectionModifiers() const =0
Access modifiers associated with the connection, if any.
An interface for writing to a network connection.
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
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.
An interface to the operating system, including Port based communication.