YARP
Yet Another Robot Platform
yarp::os::NullConnectionReader Class Reference

Dummy ConnectionReader that has no data. More...

#include <yarp/os/NullConnectionReader.h>

+ Inheritance diagram for yarp::os::NullConnectionReader:

Detailed Description

Dummy ConnectionReader that has no data.

Definition at line 27 of file NullConnectionReader.h.

Public Member Functions

virtual bool expectBlock (char *data, size_t len) override
 Read a block of data from the network connection. More...
 
virtual std::string expectText (int terminatingChar='\n') override
 Read some text from the network connection. More...
 
virtual std::int8_t expectInt8 () override
 Read a 8-bit integer from the network connection. More...
 
virtual std::int16_t expectInt16 () override
 Read a 16-bit integer from the network connection. More...
 
virtual std::int32_t expectInt32 () override
 Read a 32-bit integer from the network connection. More...
 
virtual std::int64_t expectInt64 () override
 Read a 64-bit integer from the network connection. More...
 
virtual yarp::conf::float32_t expectFloat32 () override
 Read a 32-bit floating point number from the network connection. More...
 
virtual yarp::conf::float64_t expectFloat64 () override
 Read a 64-bit floating point number from the network connection. More...
 
virtual bool pushInt (int x) override
 Store an integer to return on the next call to expectInt() More...
 
virtual bool isTextMode () const override
 Check if the connection is text mode. More...
 
virtual bool convertTextMode () override
 Reads in a standard description in text mode, and converts it to a standard description in binary. More...
 
virtual size_t getSize () const override
 Checks how much data is available. More...
 
virtual ConnectionWritergetWriter () override
 Gets a way to reply to the message, if possible. More...
 
virtual Bytes readEnvelope () override
 Read a message envelope, if available. More...
 
virtual PortablegetReference () const override
 Get a direct pointer to the object being sent, if possible. More...
 
virtual Contact getRemoteContact () const override
 Gets information about who is supplying the data being read, if that information is available. More...
 
virtual Contact getLocalContact () const override
 Gets information about who is receiving the data, if that information is available. More...
 
virtual bool isValid () const override
 
virtual bool isActive () const override
 
virtual bool isError () const override
 
virtual void requestDrop () override
 Tag the connection to be dropped after the current message. More...
 
virtual const SearchablegetConnectionModifiers () const override
 Access modifiers associated with the connection, if any. More...
 
- Public Member Functions inherited from yarp::os::ConnectionReader
virtual ~ConnectionReader ()
 Destructor. More...
 
virtual int expectInt () final
 Read an integer from the network connection. More...
 
virtual double expectDouble ()
 Read a floating point number from the network connection. More...
 
virtual bool isBareMode () const =0
 Check if the connection is bare mode. More...
 
virtual bool setSize (size_t len)=0
 
virtual void setParentConnectionReader (ConnectionReader *parentConnectionReader)
 Set ConnectionReader to be used for reading the envelope. More...
 

Private Attributes

Value blank
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::ConnectionReader
static ConnectionReadercreateConnectionReader (InputStream &is)
 Create an instance of YARP's standard connection reader implementation. More...
 
static bool readFromStream (PortReader &portable, InputStream &is)
 

Member Function Documentation

◆ convertTextMode()

bool yarp::os::NullConnectionReader::convertTextMode ( )
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.

Returns
true if the conversion was possible

Implements yarp::os::ConnectionReader.

Definition at line 65 of file NullConnectionReader.cpp.

◆ expectBlock()

bool yarp::os::NullConnectionReader::expectBlock ( char *  data,
size_t  len 
)
overridevirtual

Read a block of data from the network connection.

Parameters
dataStart of the block of data
lenLength of the block of data
Returns
true on success

Implements yarp::os::ConnectionReader.

Definition at line 12 of file NullConnectionReader.cpp.

◆ expectFloat32()

yarp::conf::float32_t yarp::os::NullConnectionReader::expectFloat32 ( )
overridevirtual

Read a 32-bit floating point number from the network connection.

Returns
the floating point number read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 45 of file NullConnectionReader.cpp.

◆ expectFloat64()

yarp::conf::float64_t yarp::os::NullConnectionReader::expectFloat64 ( )
overridevirtual

Read a 64-bit floating point number from the network connection.

Returns
the floating point number read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 50 of file NullConnectionReader.cpp.

◆ expectInt16()

std::int16_t yarp::os::NullConnectionReader::expectInt16 ( )
overridevirtual

Read a 16-bit integer from the network connection.

Returns
the integer read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 30 of file NullConnectionReader.cpp.

◆ expectInt32()

std::int32_t yarp::os::NullConnectionReader::expectInt32 ( )
overridevirtual

Read a 32-bit integer from the network connection.

Returns
the integer read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 35 of file NullConnectionReader.cpp.

◆ expectInt64()

std::int64_t yarp::os::NullConnectionReader::expectInt64 ( )
overridevirtual

Read a 64-bit integer from the network connection.

Returns
the integer read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 40 of file NullConnectionReader.cpp.

◆ expectInt8()

std::int8_t yarp::os::NullConnectionReader::expectInt8 ( )
overridevirtual

Read a 8-bit integer from the network connection.

Returns
the integer read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 25 of file NullConnectionReader.cpp.

◆ expectText()

std::string yarp::os::NullConnectionReader::expectText ( int  terminatingChar = '\n')
overridevirtual

Read some text from the network connection.

Parameters
terminatingCharThe marker for the end of the text
Returns
the text read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 19 of file NullConnectionReader.cpp.

◆ getConnectionModifiers()

const yarp::os::Searchable & yarp::os::NullConnectionReader::getConnectionModifiers ( ) const
overridevirtual

Access modifiers associated with the connection, if any.

Returns
connection configuration object

Implements yarp::os::ConnectionReader.

Definition at line 119 of file NullConnectionReader.cpp.

◆ getLocalContact()

yarp::os::Contact yarp::os::NullConnectionReader::getLocalContact ( ) const
overridevirtual

Gets information about who is receiving the data, if that information is available.

Returns
contact information about sender (Contact::invalid if not available)

Implements yarp::os::ConnectionReader.

Definition at line 95 of file NullConnectionReader.cpp.

◆ getReference()

yarp::os::Portable * yarp::os::NullConnectionReader::getReference ( ) const
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.

Returns
The message object, or nullptr if not available

Implements yarp::os::ConnectionReader.

Definition at line 85 of file NullConnectionReader.cpp.

◆ getRemoteContact()

yarp::os::Contact yarp::os::NullConnectionReader::getRemoteContact ( ) const
overridevirtual

Gets information about who is supplying the data being read, if that information is available.

Returns
contact information about sender (Contact::invalid if not available)

Implements yarp::os::ConnectionReader.

Definition at line 90 of file NullConnectionReader.cpp.

◆ getSize()

size_t yarp::os::NullConnectionReader::getSize ( ) const
overridevirtual

Checks how much data is available.

Returns
the number of bytes left on the connection.

Implements yarp::os::ConnectionReader.

Definition at line 70 of file NullConnectionReader.cpp.

◆ getWriter()

yarp::os::ConnectionWriter * yarp::os::NullConnectionReader::getWriter ( )
overridevirtual

Gets a way to reply to the message, if possible.

Returns
An object that permits replies, or nullptr if this cannot be done.

Implements yarp::os::ConnectionReader.

Definition at line 75 of file NullConnectionReader.cpp.

◆ isActive()

bool yarp::os::NullConnectionReader::isActive ( ) const
overridevirtual
Returns
true if the reader is active. Readers become inactive if the connection they are associated with breaks.

Implements yarp::os::ConnectionReader.

Definition at line 105 of file NullConnectionReader.cpp.

◆ isError()

bool yarp::os::NullConnectionReader::isError ( ) const
overridevirtual
Returns
true if the reader encountered an error. Readers can encounter an error if there is some data loss. For unreliable protocols like UDP/Multicast, where losses are not unexpected, this error flag will be reset for the next incoming message.

Implements yarp::os::ConnectionReader.

Definition at line 110 of file NullConnectionReader.cpp.

◆ isTextMode()

bool yarp::os::NullConnectionReader::isTextMode ( ) const
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.

Returns
true if the connection is text mode (as opposed to binary)

Implements yarp::os::ConnectionReader.

Definition at line 60 of file NullConnectionReader.cpp.

◆ isValid()

bool yarp::os::NullConnectionReader::isValid ( ) const
overridevirtual
Returns
true if the reader is valid. Invalid readers may signal a shutdown.

Implements yarp::os::ConnectionReader.

Definition at line 100 of file NullConnectionReader.cpp.

◆ pushInt()

bool yarp::os::NullConnectionReader::pushInt ( int  x)
overridevirtual

Store an integer to return on the next call to expectInt()

Parameters
xthe integer to store
Returns
true on success

Implements yarp::os::ConnectionReader.

Definition at line 55 of file NullConnectionReader.cpp.

◆ readEnvelope()

yarp::os::Bytes yarp::os::NullConnectionReader::readEnvelope ( )
overridevirtual

Read a message envelope, if available.

Reimplemented from yarp::os::ConnectionReader.

Definition at line 80 of file NullConnectionReader.cpp.

◆ requestDrop()

void yarp::os::NullConnectionReader::requestDrop ( )
overridevirtual

Tag the connection to be dropped after the current message.

Implements yarp::os::ConnectionReader.

Definition at line 115 of file NullConnectionReader.cpp.

Member Data Documentation

◆ blank

Value yarp::os::NullConnectionReader::blank
private

Definition at line 29 of file NullConnectionReader.h.


The documentation for this class was generated from the following files: