|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
25 yCTrace(PORTCOMMAND,
"PortCommand::readBlock");
29 bool ok = reader.
expectBlock(header.get(), header.length());
33 char* base = header.get();
42 if (str.length() > 0) {
54 if (str.length() > 0) {
63 yCTrace(PORTCOMMAND,
"PortCommand::writeBlock");
64 yCDebug(PORTCOMMAND,
"Writing port command, text mode [%s]\n", writer.
isTextMode() ?
"true" :
"false");
68 len = (int)str.length() + 1;
70 yCAssert(PORTCOMMAND, header.length() == 8);
71 char* base = header.get();
78 writer.
appendBlock(header.bytes().get(), header.bytes().length());
virtual void appendBlock(const char *data, size_t len)=0
Send a block of data to the network connection.
bool write(yarp::os::ConnectionWriter &writer) const override
Write this object to a network connection.
virtual bool isError() const =0
An interface for writing to a network connection.
virtual bool isError() const =0
bool read(yarp::os::ConnectionReader &reader) override
Read this object from a network connection.
A simple abstraction for a block of bytes.
#define yCAssert(component, x)
An interface for reading from a network connection.
virtual bool isTextMode() const =0
Check if the connection is text mode.
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
virtual std::string expectText(const char terminatingChar='\n')=0
Read some text from the network connection.
virtual bool isTextMode() const =0
Check if the connection is text mode.
#define yCTrace(component,...)
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
#define YARP_OS_LOG_COMPONENT(name, name_string)
The components from which ports and connections are built.
static int netInt(const yarp::os::Bytes &code)
virtual void appendText(const std::string &str, const char terminate='\n')=0
Send a terminated string to the network connection.