An interface for reading from a network connection. More...
#include <ConnectionReader.h>
Public Member Functions | |
| virtual | ~ConnectionReader () |
| Destructor. | |
| virtual bool | expectBlock (const char *data, int len)=0 |
| Read a block of data from the network connection. | |
| virtual ConstString | expectText (int terminatingChar= '\n')=0 |
| Read some text from the network connection. | |
| virtual int | expectInt ()=0 |
| Read an integer from the network connection. | |
| virtual double | expectDouble ()=0 |
| Read a floating point number from the network connection. | |
| virtual bool | isTextMode ()=0 |
| Check if the connection is text mode. | |
| virtual bool | convertTextMode ()=0 |
| Reads in a standard description in text mode, and converts it to a standard description in binary. | |
| virtual int | getSize ()=0 |
| Checks how much data is available. | |
| virtual ConnectionWriter * | getWriter ()=0 |
| Gets a way to reply to the message, if possible. | |
| virtual Bytes | readEnvelope () |
| Read a message envelope, if available. | |
| virtual Portable * | getReference ()=0 |
| Get a direct pointer to the object being sent, if possible. | |
| virtual Contact | getRemoteContact ()=0 |
| Gets information about who is supplying the data being read, if that information is available. | |
| virtual Contact | getLocalContact ()=0 |
| Gets information about who is receiving the data, if that information is available. | |
| virtual bool | isValid ()=0 |
| virtual bool | isActive ()=0 |
| virtual bool | isError ()=0 |
An interface for reading from a network connection.
port_power/ex0300_port_callback.cpp, port_power/ex0402_port_callback_reply.cpp, port_power/ex0403_bufferedport_callback_reply.cpp, port_power/TargetVer2.h, and port_power/TargetVer3.h.
Definition at line 34 of file libYARP_OS/include/yarp/os/ConnectionReader.h.
| virtual yarp::os::ConnectionReader::~ConnectionReader | ( | ) | [inline, virtual] |
Destructor.
Definition at line 40 of file libYARP_OS/include/yarp/os/ConnectionReader.h.
| virtual bool yarp::os::ConnectionReader::expectBlock | ( | const char * | data, | |
| int | len | |||
| ) | [pure virtual] |
Read a block of data from the network connection.
| data | Start of the block of data | |
| len | Length of the block of data |
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::expectBlock(), and yarp::os::BinPortable< T >::read().
| virtual ConstString yarp::os::ConnectionReader::expectText | ( | int | terminatingChar = '\n' |
) | [pure virtual] |
Read some text from the network connection.
| terminatingChar | The marker for the end of the text |
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::expectText().
| virtual int yarp::os::ConnectionReader::expectInt | ( | ) | [pure virtual] |
Read an integer from the network connection.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::expectInt(), and yarp::os::PortablePair< HEAD, BODY >::readPair().
| virtual double yarp::os::ConnectionReader::expectDouble | ( | ) | [pure virtual] |
Read a floating point number from the network connection.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::expectDouble().
| virtual bool yarp::os::ConnectionReader::isTextMode | ( | ) | [pure 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.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::init().
| virtual bool yarp::os::ConnectionReader::convertTextMode | ( | ) | [pure 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.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::init(), yarp::os::BinPortable< T >::read(), and yarp::os::PortablePair< HEAD, BODY >::readPair().
| virtual int yarp::os::ConnectionReader::getSize | ( | ) | [pure virtual] |
Checks how much data is available.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::getSize().
| virtual ConnectionWriter* yarp::os::ConnectionReader::getWriter | ( | ) | [pure virtual] |
Gets a way to reply to the message, if possible.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::name::NameServerConnectionHandler::apply(), yarp::os::impl::ConnectionRecorder::getWriter(), and RosSlave::read().
| virtual Bytes yarp::os::ConnectionReader::readEnvelope | ( | ) | [inline, virtual] |
Read a message envelope, if available.
Reimplemented in yarp::os::impl::StreamConnectionReader.
Definition at line 107 of file libYARP_OS/include/yarp/os/ConnectionReader.h.
| virtual Portable* yarp::os::ConnectionReader::getReference | ( | ) | [pure 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 NULL
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::getReference().
| virtual Contact yarp::os::ConnectionReader::getRemoteContact | ( | ) | [pure virtual] |
Gets information about who is supplying the data being read, if that information is available.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::name::NameServerConnectionHandler::apply(), and yarp::os::impl::ConnectionRecorder::getRemoteContact().
| virtual Contact yarp::os::ConnectionReader::getLocalContact | ( | ) | [pure virtual] |
Gets information about who is receiving the data, if that information is available.
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::getLocalContact().
| virtual bool yarp::os::ConnectionReader::isValid | ( | ) | [pure virtual] |
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::isValid().
| virtual bool yarp::os::ConnectionReader::isActive | ( | ) | [pure virtual] |
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::isActive().
| virtual bool yarp::os::ConnectionReader::isError | ( | ) | [pure virtual] |
Implemented in yarp::os::impl::StreamConnectionReader.
Referenced by yarp::os::impl::ConnectionRecorder::isError().
1.7.1