YARP  2.3.70.1
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:

Public Member Functions

virtual bool expectBlock (const char *data, size_t len) YARP_OVERRIDE
 Read a block of data from the network connection. More...
 
virtual ConstString expectText (int terminatingChar='\n') YARP_OVERRIDE
 Read some text from the network connection. More...
 
virtual int expectInt () YARP_OVERRIDE
 Read an integer from the network connection. More...
 
virtual bool pushInt (int x) YARP_OVERRIDE
 Store an integer to return on the next call to expectInt() More...
 
virtual double expectDouble () YARP_OVERRIDE
 Read a floating point number from the network connection. More...
 
virtual bool isTextMode () YARP_OVERRIDE
 Check if the connection is text mode. More...
 
virtual bool convertTextMode () YARP_OVERRIDE
 Reads in a standard description in text mode, and converts it to a standard description in binary. More...
 
virtual size_t getSize () YARP_OVERRIDE
 Checks how much data is available. More...
 
virtual ConnectionWritergetWriter () YARP_OVERRIDE
 Gets a way to reply to the message, if possible. More...
 
virtual Bytes readEnvelope () YARP_OVERRIDE
 Read a message envelope, if available. More...
 
virtual PortablegetReference () YARP_OVERRIDE
 Get a direct pointer to the object being sent, if possible. More...
 
virtual Contact getRemoteContact () YARP_OVERRIDE
 Gets information about who is supplying the data being read, if that information is available. More...
 
virtual Contact getLocalContact () YARP_OVERRIDE
 Gets information about who is receiving the data, if that information is available. More...
 
virtual bool isValid () YARP_OVERRIDE
 
virtual bool isActive () YARP_OVERRIDE
 
virtual bool isError () YARP_OVERRIDE
 
virtual void requestDrop () YARP_OVERRIDE
 Tag the connection to be dropped after the current message. More...
 
virtual SearchablegetConnectionModifiers () YARP_OVERRIDE
 Access modifiers associated with the connection, if any. More...
 
- Public Member Functions inherited from yarp::os::ConnectionReader
virtual ~ConnectionReader ()
 Destructor. More...
 
virtual YARP_INT64 expectInt64 ()=0
 Read a 64 bit integer from the network connection. More...
 
virtual bool isBareMode ()=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)
 

Detailed Description

Dummy ConnectionReader that has no data.

Definition at line 25 of file NullConnectionReader.h.

Member Function Documentation

◆ convertTextMode()

bool yarp::os::NullConnectionReader::convertTextMode ( )
virtual

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 34 of file NullConnectionReader.cpp.

◆ expectBlock()

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

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 10 of file NullConnectionReader.cpp.

◆ expectDouble()

double yarp::os::NullConnectionReader::expectDouble ( )
virtual

Read a floating point number from the network connection.

Returns
the floating point number read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 26 of file NullConnectionReader.cpp.

◆ expectInt()

int yarp::os::NullConnectionReader::expectInt ( )
virtual

Read an integer from the network connection.

Returns
the integer read from the connection

Implements yarp::os::ConnectionReader.

Definition at line 18 of file NullConnectionReader.cpp.

◆ expectText()

yarp::os::ConstString yarp::os::NullConnectionReader::expectText ( int  terminatingChar = '\n')
virtual

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 14 of file NullConnectionReader.cpp.

◆ getConnectionModifiers()

yarp::os::Searchable & yarp::os::NullConnectionReader::getConnectionModifiers ( )
virtual

Access modifiers associated with the connection, if any.

Returns
connection configuration object

Implements yarp::os::ConnectionReader.

Definition at line 77 of file NullConnectionReader.cpp.

◆ getLocalContact()

yarp::os::Contact yarp::os::NullConnectionReader::getLocalContact ( )
virtual

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 58 of file NullConnectionReader.cpp.

◆ getReference()

yarp::os::Portable * yarp::os::NullConnectionReader::getReference ( )
virtual

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 YARP_NULLPTR.

Returns
The message object, or YARP_NULLPTR if not available

Implements yarp::os::ConnectionReader.

Definition at line 50 of file NullConnectionReader.cpp.

◆ getRemoteContact()

yarp::os::Contact yarp::os::NullConnectionReader::getRemoteContact ( )
virtual

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 54 of file NullConnectionReader.cpp.

◆ getSize()

size_t yarp::os::NullConnectionReader::getSize ( )
virtual

Checks how much data is available.

Returns
the number of bytes left on the connection.

Implements yarp::os::ConnectionReader.

Definition at line 38 of file NullConnectionReader.cpp.

◆ getWriter()

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

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

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

Implements yarp::os::ConnectionReader.

Definition at line 42 of file NullConnectionReader.cpp.

◆ isActive()

bool yarp::os::NullConnectionReader::isActive ( )
virtual
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 66 of file NullConnectionReader.cpp.

◆ isError()

bool yarp::os::NullConnectionReader::isError ( )
virtual
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 70 of file NullConnectionReader.cpp.

◆ isTextMode()

bool yarp::os::NullConnectionReader::isTextMode ( )
virtual

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 30 of file NullConnectionReader.cpp.

◆ isValid()

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

Implements yarp::os::ConnectionReader.

Definition at line 62 of file NullConnectionReader.cpp.

◆ pushInt()

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

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 22 of file NullConnectionReader.cpp.

◆ readEnvelope()

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

Read a message envelope, if available.

Reimplemented from yarp::os::ConnectionReader.

Definition at line 46 of file NullConnectionReader.cpp.

◆ requestDrop()

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

Tag the connection to be dropped after the current message.

Implements yarp::os::ConnectionReader.

Definition at line 74 of file NullConnectionReader.cpp.

Member Data Documentation

◆ blank

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

Definition at line 27 of file NullConnectionReader.h.


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