A dummy ConnectionWriter that consumes data without effect. More...
#include <yarp/os/NullConnectionWriter.h>
Public Member Functions | |
void | appendBlock (const char *data, size_t len) override |
Send a block of data to the network connection. More... | |
void | appendInt8 (std::int8_t data) override |
Send a representation of a 8-bit integer to the network connection. More... | |
void | appendInt16 (std::int16_t data) override |
Send a representation of a 16-bit integer to the network connection. More... | |
void | appendInt32 (std::int32_t data) override |
Send a representation of a 32-bit integer to the network connection. More... | |
void | appendInt64 (std::int64_t data) override |
Send a representation of a 64-bit integer to the network connection. More... | |
void | appendFloat32 (yarp::conf::float32_t data) override |
Send a representation of a 32-bit floating point number to the network connection. More... | |
void | appendFloat64 (yarp::conf::float64_t data) override |
Send a representation of a 64-bit floating point number to the network connection. More... | |
void | appendText (const std::string &str, const char terminate='\n') override |
Send a terminated string to the network connection. More... | |
void | appendExternalBlock (const char *data, size_t len) override |
Send a block of data to the network connection, without making a copy. 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... | |
void | declareSizes (int argc, int *argv) override |
If you can easily determine how many blocks there are in a message, call this first, before anything else. More... | |
void | setReplyHandler (PortReader &reader) override |
This sets a handler to deal with replies to the message. More... | |
void | setReference (Portable *obj) override |
Stores a direct pointer to the object being sent. More... | |
bool | convertTextMode () override |
Converts a standard description in binary into a textual description, if the connection is in text-mode. More... | |
bool | isValid () const override |
bool | isActive () const override |
bool | isError () const override |
void | requestDrop () override |
Tag the connection to be dropped after the current message. More... | |
bool | isNull () const override |
SizedWriter * | getBuffer () const override |
Public Member Functions inherited from yarp::os::ConnectionWriter | |
virtual | ~ConnectionWriter () |
Destructor. More... | |
virtual void | appendInt (int data) final |
Send a representation of an integer to the network connection. More... | |
virtual void | appendDouble (double data) |
Send a representation of a floating point number to the network connection. More... | |
virtual void | appendString (const char *str, const char terminate='\n') final |
Send a character sequence to the network connection. More... | |
virtual void | appendRawString (const std::string &str) final |
void | appendString (const std::string &str) |
Send a string to the network connection. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from yarp::os::ConnectionWriter | |
static ConnectionWriter * | createBufferedConnectionWriter () |
Create a connection writer implementation that stores to a buffer which can be read later using getBuffer() More... | |
static bool | writeToStream (PortWriter &portable, OutputStream &os) |
A dummy ConnectionWriter that consumes data without effect.
Definition at line 24 of file NullConnectionWriter.h.
|
overridevirtual |
Send a block of data to the network connection.
Since communication may not happen immediately, or may happen multiple times, a copy of this data is made. If you know the block of data will remain valid, and it is a large block of data, please call ConnectionWriter::appendExternalBlock instead.
data | the start of the data block |
len | the length of the data block |
Implements yarp::os::ConnectionWriter.
Definition at line 12 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a block of data to the network connection, without making a copy.
If you are not confident that the block of data will remain valid throughout transmission, call ConnectionWriter::appendBlock instead.
data | the start of the data block |
len | the length of the data block |
Implements yarp::os::ConnectionWriter.
Definition at line 54 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a representation of a 32-bit floating point number to the network connection.
data | the floating point number to send |
Implements yarp::os::ConnectionWriter.
Definition at line 38 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a representation of a 64-bit floating point number to the network connection.
data | the floating point number to send |
Implements yarp::os::ConnectionWriter.
Definition at line 43 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a representation of a 16-bit integer to the network connection.
data | the integer to send |
Implements yarp::os::ConnectionWriter.
Definition at line 23 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a representation of a 32-bit integer to the network connection.
data | the integer to send |
Implements yarp::os::ConnectionWriter.
Definition at line 28 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a representation of a 64-bit integer to the network connection.
data | the integer to send |
Implements yarp::os::ConnectionWriter.
Definition at line 33 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a representation of a 8-bit integer to the network connection.
data | the integer to send |
Implements yarp::os::ConnectionWriter.
Definition at line 18 of file NullConnectionWriter.cpp.
|
overridevirtual |
Send a terminated string to the network connection.
The lenght of string is not specified in advance, therefore the reader should read until the terminating character is found.
str | the string to send |
terminate | the terminating character to use |
Implements yarp::os::ConnectionWriter.
Definition at line 48 of file NullConnectionWriter.cpp.
|
overridevirtual |
Converts a standard description in binary into a textual description, if the connection is in text-mode.
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::ConnectionWriter.
Definition at line 86 of file NullConnectionWriter.cpp.
|
overridevirtual |
If you can easily determine how many blocks there are in a message, call this first, before anything else.
This may improve efficiency in some situations.
argc | Number of blocks |
argv | An array of integers, giving the length of each block |
Implements yarp::os::ConnectionWriter.
Definition at line 70 of file NullConnectionWriter.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionWriter.
Definition at line 115 of file NullConnectionWriter.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionWriter.
Definition at line 96 of file NullConnectionWriter.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::ConnectionWriter.
Definition at line 65 of file NullConnectionWriter.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionWriter.
Definition at line 101 of file NullConnectionWriter.cpp.
|
overridevirtual |
Reimplemented from yarp::os::ConnectionWriter.
Definition at line 110 of file NullConnectionWriter.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::ConnectionWriter.
Definition at line 60 of file NullConnectionWriter.cpp.
|
overridevirtual |
Implements yarp::os::ConnectionWriter.
Definition at line 91 of file NullConnectionWriter.cpp.
|
overridevirtual |
Tag the connection to be dropped after the current message.
Implements yarp::os::ConnectionWriter.
Definition at line 106 of file NullConnectionWriter.cpp.
|
overridevirtual |
Stores a direct pointer to the object being sent.
This is useful for local communication, to bypass serialization.
Implements yarp::os::ConnectionWriter.
Definition at line 81 of file NullConnectionWriter.cpp.
|
overridevirtual |
This sets a handler to deal with replies to the message.
The handler will be called once per connection. There will be problems for connections using carriers that don't support replies.
reader | the object that handles replies. |
Implements yarp::os::ConnectionWriter.
Definition at line 76 of file NullConnectionWriter.cpp.