Lets Readable objects read from the underlying InputStream associated with the connection between two ports. More...
#include <yarp/os/impl/StreamConnectionReader.h>
Public Member Functions | |
StreamConnectionReader () | |
virtual | ~StreamConnectionReader () |
void | reset (yarp::os::InputStream &in, TwoWayStream *str, const Route &route, size_t len, bool textMode, bool bareMode=false) |
void | setProtocol (Protocol *protocol) |
void | suppressReply () |
bool | dropRequested () |
virtual bool | expectBlock (yarp::os::Bytes &b) |
virtual std::string | expectString (int len) |
virtual std::string | expectLine () |
virtual void | setReference (yarp::os::Portable *obj) |
bool | setSize (size_t len) override |
size_t | getSize () const override |
Checks how much data is available. More... | |
bool | pushInt (int x) override |
Store an integer to return on the next call to expectInt() More... | |
std::int8_t | expectInt8 () override |
Read a 8-bit integer from the network connection. More... | |
std::int16_t | expectInt16 () override |
Read a 16-bit integer from the network connection. More... | |
std::int32_t | expectInt32 () override |
Read a 32-bit integer from the network connection. More... | |
std::int64_t | expectInt64 () override |
Read a 64-bit integer from the network connection. More... | |
yarp::conf::float32_t | expectFloat32 () override |
Read a 32-bit floating point number from the network connection. More... | |
yarp::conf::float64_t | expectFloat64 () override |
Read a 64-bit floating point number from the network connection. More... | |
bool | expectBlock (char *data, size_t len) override |
Read a block of data from the network connection. More... | |
std::string | expectText (const char terminatingChar) override |
Read some text from the network connection. More... | |
bool | isTextMode () const override |
Check if the connection is text mode. More... | |
bool | isBareMode () const override |
Check if the connection is bare mode. More... | |
bool | convertTextMode () override |
Reads in a standard description in text mode, and converts it to a standard description in binary. More... | |
yarp::os::ConnectionWriter * | getWriter () override |
Gets a way to reply to the message, if possible. More... | |
yarp::os::Contact | getRemoteContact () const override |
Gets information about who is supplying the data being read, if that information is available. More... | |
yarp::os::Contact | getLocalContact () const override |
Gets information about who is receiving the data, if that information is available. More... | |
bool | isValid () const override |
bool | isError () const override |
bool | isActive () const override |
yarp::os::Portable * | getReference () const override |
Get a direct pointer to the object being sent, if possible. More... | |
yarp::os::Bytes | readEnvelope () override |
Read a message envelope, if available. More... | |
void | requestDrop () override |
Tag the connection to be dropped after the current message. More... | |
const yarp::os::Searchable & | getConnectionModifiers () const override |
Access modifiers associated with the connection, if any. More... | |
void | setParentConnectionReader (ConnectionReader *parentConnectionReader) override |
Set ConnectionReader to be used for reading the envelope. More... | |
void | flushWriter () override |
virtual std::string | expectString () |
Read a string from the network connection. More... | |
![]() | |
virtual | ~ConnectionReader () |
Destructor. More... | |
virtual bool | expectBlock (char *data, size_t len)=0 |
Read a block of data from the network connection. More... | |
virtual std::string | expectText (const char terminatingChar='\n')=0 |
Read some text from the network connection. More... | |
virtual std::string | expectString () |
Read a string from the network connection. More... | |
virtual std::int8_t | expectInt8 ()=0 |
Read a 8-bit integer from the network connection. More... | |
virtual std::int16_t | expectInt16 ()=0 |
Read a 16-bit integer from the network connection. More... | |
virtual std::int32_t | expectInt32 ()=0 |
Read a 32-bit integer from the network connection. More... | |
virtual std::int64_t | expectInt64 ()=0 |
Read a 64-bit integer from the network connection. More... | |
virtual yarp::conf::float32_t | expectFloat32 ()=0 |
Read a 32-bit floating point number from the network connection. More... | |
virtual yarp::conf::float64_t | expectFloat64 ()=0 |
Read a 64-bit floating point number from the network connection. More... | |
virtual bool | isTextMode () const =0 |
Check if the connection is text mode. More... | |
virtual bool | isBareMode () const =0 |
Check if the connection is bare mode. More... | |
virtual bool | convertTextMode ()=0 |
Reads in a standard description in text mode, and converts it to a standard description in binary. More... | |
virtual size_t | getSize () const =0 |
Checks how much data is available. More... | |
virtual ConnectionWriter * | getWriter ()=0 |
Gets a way to reply to the message, if possible. More... | |
virtual Bytes | readEnvelope () |
Read a message envelope, if available. More... | |
virtual Portable * | getReference () const =0 |
Get a direct pointer to the object being sent, if possible. More... | |
virtual Contact | getRemoteContact () const =0 |
Gets information about who is supplying the data being read, if that information is available. More... | |
virtual Contact | getLocalContact () const =0 |
Gets information about who is receiving the data, if that information is available. More... | |
virtual bool | isValid () const =0 |
virtual bool | isActive () const =0 |
virtual bool | isError () const =0 |
virtual void | requestDrop ()=0 |
Tag the connection to be dropped after the current message. More... | |
virtual const Searchable & | getConnectionModifiers () const =0 |
Access modifiers associated with the connection, if any. More... | |
virtual bool | pushInt (int x)=0 |
Store an integer to return on the next call to expectInt() More... | |
virtual bool | setSize (size_t len)=0 |
virtual void | setParentConnectionReader (ConnectionReader *parentConnectionReader) |
Set ConnectionReader to be used for reading the envelope. More... | |
virtual void | flushWriter ()=0 |
Additional Inherited Members | |
![]() | |
static ConnectionReader * | createConnectionReader (InputStream &is) |
Create an instance of YARP's standard connection reader implementation. More... | |
static bool | readFromStream (PortReader &portable, InputStream &is) |
Lets Readable objects read from the underlying InputStream associated with the connection between two ports.
Definition at line 35 of file StreamConnectionReader.h.
StreamConnectionReader::StreamConnectionReader | ( | ) |
Definition at line 17 of file StreamConnectionReader.cpp.
|
virtual |
Definition at line 38 of file StreamConnectionReader.cpp.
|
overridevirtual |
Reads in a standard description in text mode, and converts it to a standard description in binary.
Useful if you only operate on the binary description usually, and just want to permit text mode for command-line interaction. If isTextMode would return false, no conversion is done.
Implements yarp::os::ConnectionReader.
Definition at line 283 of file StreamConnectionReader.cpp.
bool StreamConnectionReader::dropRequested | ( | ) |
Definition at line 76 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a block of data from the network connection.
data | Start of the block of data |
len | Length of the block of data |
Implements yarp::os::ConnectionReader.
Definition at line 253 of file StreamConnectionReader.cpp.
|
virtual |
Definition at line 81 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a 32-bit floating point number from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 237 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a 64-bit floating point number from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 245 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a 16-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 209 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a 32-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 217 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a 64-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 229 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a 8-bit integer from the network connection.
Implements yarp::os::ConnectionReader.
Definition at line 201 of file StreamConnectionReader.cpp.
|
virtual |
Definition at line 125 of file StreamConnectionReader.cpp.
|
inlinevirtual |
Read a string from the network connection.
The string should be serialized as "length" + "block".
Reimplemented from yarp::os::ConnectionReader.
Definition at line 62 of file ConnectionReader.h.
|
virtual |
Definition at line 104 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read some text from the network connection.
terminatingChar | The marker for the end of the text |
Implements yarp::os::ConnectionReader.
Definition at line 259 of file StreamConnectionReader.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 141 of file StreamConnectionReader.cpp.
|
overridevirtual |
Access modifiers associated with the connection, if any.
Implements yarp::os::ConnectionReader.
Definition at line 390 of file StreamConnectionReader.cpp.
|
overridevirtual |
Gets information about who is receiving the data, if that information is available.
Implements yarp::os::ConnectionReader.
Definition at line 329 of file StreamConnectionReader.cpp.
|
overridevirtual |
Get a direct pointer to the object being sent, if possible.
This only makes sense in local operation, when sender and receiver are in the same process; in all other situations this returns nullptr.
Implements yarp::os::ConnectionReader.
Definition at line 368 of file StreamConnectionReader.cpp.
|
overridevirtual |
Gets information about who is supplying the data being read, if that information is available.
Implements yarp::os::ConnectionReader.
Definition at line 318 of file StreamConnectionReader.cpp.
|
overridevirtual |
Checks how much data is available.
Implements yarp::os::ConnectionReader.
Definition at line 169 of file StreamConnectionReader.cpp.
|
overridevirtual |
Gets a way to reply to the message, if possible.
Implements yarp::os::ConnectionReader.
Definition at line 301 of file StreamConnectionReader.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 352 of file StreamConnectionReader.cpp.
|
overridevirtual |
Check if the connection is bare mode.
If it is, you are encouraged to omit type information from your serialization.
Implements yarp::os::ConnectionReader.
Definition at line 278 of file StreamConnectionReader.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 344 of file StreamConnectionReader.cpp.
|
overridevirtual |
Check if the connection is text mode.
If it is, you are encouraged (but by no means required) to use a human-readable representation of your data structure.
Implements yarp::os::ConnectionReader.
Definition at line 273 of file StreamConnectionReader.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 339 of file StreamConnectionReader.cpp.
|
overridevirtual |
Store an integer to return on the next call to expectInt()
x | the integer to store |
Implements yarp::os::ConnectionReader.
Definition at line 174 of file StreamConnectionReader.cpp.
|
overridevirtual |
Read a message envelope, if available.
Reimplemented from yarp::os::ConnectionReader.
Definition at line 373 of file StreamConnectionReader.cpp.
|
overridevirtual |
Tag the connection to be dropped after the current message.
Implements yarp::os::ConnectionReader.
Definition at line 385 of file StreamConnectionReader.cpp.
void StreamConnectionReader::reset | ( | yarp::os::InputStream & | in, |
TwoWayStream * | str, | ||
const Route & | route, | ||
size_t | len, | ||
bool | textMode, | ||
bool | bareMode = false |
||
) |
Definition at line 46 of file StreamConnectionReader.cpp.
|
overridevirtual |
Set ConnectionReader to be used for reading the envelope.
Used by PortCoreInputUnit
Reimplemented from yarp::os::ConnectionReader.
Definition at line 400 of file StreamConnectionReader.cpp.
void StreamConnectionReader::setProtocol | ( | Protocol * | protocol | ) |
Definition at line 66 of file StreamConnectionReader.cpp.
|
virtual |
Definition at line 158 of file StreamConnectionReader.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionReader.
Definition at line 163 of file StreamConnectionReader.cpp.
void StreamConnectionReader::suppressReply | ( | ) |
Definition at line 71 of file StreamConnectionReader.cpp.