YARP
Yet Another Robot Platform
yarp::os::impl::PortCommand Class Reference

Simple Readable and Writable object representing a command to a YARP port. More...

#include <yarp/os/impl/PortCommand.h>

+ Inheritance diagram for yarp::os::impl::PortCommand:

Public Member Functions

 PortCommand ()
 
 PortCommand (char ch, const std::string &str)
 
bool write (yarp::os::ConnectionWriter &writer) const override
 Write this object to a network connection. More...
 
bool read (yarp::os::ConnectionReader &reader) override
 Read this object from a network connection. More...
 
char getKey ()
 
std::string getText ()
 
- Public Member Functions inherited from yarp::os::Portable
virtual Type getType () const
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor. More...
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor. More...
 
virtual void onCompletion () const
 This is called when the port has finished all writing operations. More...
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations. More...
 
virtual yarp::os::Type getWriteType () const
 

Public Attributes

char ch
 
std::string str
 
yarp::os::ManagedBytes header
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::Portable
static bool copyPortable (const PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading. More...
 

Detailed Description

Simple Readable and Writable object representing a command to a YARP port.

Definition at line 27 of file PortCommand.h.

Constructor & Destructor Documentation

◆ PortCommand() [1/2]

yarp::os::impl::PortCommand::PortCommand ( )
inline

Definition at line 31 of file PortCommand.h.

◆ PortCommand() [2/2]

yarp::os::impl::PortCommand::PortCommand ( char  ch,
const std::string &  str 
)
inline

Definition at line 38 of file PortCommand.h.

Member Function Documentation

◆ getKey()

char yarp::os::impl::PortCommand::getKey ( )
inline

Definition at line 48 of file PortCommand.h.

◆ getText()

std::string yarp::os::impl::PortCommand::getText ( )
inline

Definition at line 53 of file PortCommand.h.

◆ read()

bool PortCommand::read ( yarp::os::ConnectionReader reader)
overridevirtual

Read this object from a network connection.

Override this for your particular class.

Parameters
readeran interface to the network connection for reading
Returns
true iff the object is successfully read

Implements yarp::os::Portable.

Definition at line 23 of file PortCommand.cpp.

◆ write()

bool PortCommand::write ( yarp::os::ConnectionWriter writer) const
overridevirtual

Write this object to a network connection.

Override this for your particular class. Be aware that depending on the nature of the connections a port has, and what protocol they use, and how efficient the YARP implementation is, this method may be called once, twice, or many times, as the result of a single call to Port::write

Parameters
writeran interface to the network connection for writing
Returns
true iff the object is successfully written

Implements yarp::os::Portable.

Definition at line 61 of file PortCommand.cpp.

Member Data Documentation

◆ ch

char yarp::os::impl::PortCommand::ch

Definition at line 59 of file PortCommand.h.

◆ header

yarp::os::ManagedBytes yarp::os::impl::PortCommand::header
mutable

Definition at line 61 of file PortCommand.h.

◆ str

std::string yarp::os::impl::PortCommand::str

Definition at line 60 of file PortCommand.h.


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