YARP
Yet Another Robot Platform
yarp::os::PortablePair< HEAD, BODY > Class Template Reference

Group a pair of objects to be sent and received together. More...

#include <yarp/os/PortablePair.h>

+ Inheritance diagram for yarp::os::PortablePair< HEAD, BODY >:

Detailed Description

template<class HEAD, class BODY>
class yarp::os::PortablePair< HEAD, BODY >

Group a pair of objects to be sent and received together.

Handy for adding general-purpose headers, for example.

Examples:
os/portable_pair.cpp.

Definition at line 50 of file PortablePair.h.

Public Member Functions

bool read (ConnectionReader &connection) override
 Reads this object pair from a network connection. More...
 
bool write (ConnectionWriter &connection) const override
 Writes this object pair to a network connection. More...
 
void onCompletion () const override
 This is called when the port has finished all writing operations. More...
 
- 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 onCommencement () const
 This is called when the port is about to begin writing operations. More...
 
virtual yarp::os::Type getWriteType () const
 

Public Attributes

HEAD head
 An object of the first type (HEAD). More...
 
BODY body
 An object of the second type (BODY). More...
 

Additional Inherited Members

- Static Public Member Functions inherited from yarp::os::PortablePairBase
static bool readPair (ConnectionReader &connection, Portable &head, Portable &body)
 Reads an object pair from a network connection. More...
 
static bool writePair (ConnectionWriter &connection, const Portable &head, const Portable &body)
 Writes an object pair to a network connection. More...
 
- Static Public Member Functions inherited from yarp::os::Portable
static bool copyPortable (PortWriter &writer, PortReader &reader)
 Copy one portable to another, via writing and reading. More...
 

Member Function Documentation

◆ onCompletion()

template<class HEAD, class BODY>
void yarp::os::PortablePair< HEAD, BODY >::onCompletion ( ) const
inlineoverridevirtual

This is called when the port has finished all writing operations.

Passes call on to head and body.

Reimplemented from yarp::os::PortWriter.

Definition at line 87 of file PortablePair.h.

◆ read()

template<class HEAD, class BODY>
bool yarp::os::PortablePair< HEAD, BODY >::read ( ConnectionReader connection)
inlineoverridevirtual

Reads this object pair from a network connection.

Parameters
connectionan interface to the network connection for reading
Returns
true iff the object pair was successfully read

Implements yarp::os::Portable.

Definition at line 68 of file PortablePair.h.

◆ write()

template<class HEAD, class BODY>
bool yarp::os::PortablePair< HEAD, BODY >::write ( ConnectionWriter connection) const
inlineoverridevirtual

Writes this object pair to a network connection.

Parameters
connectionan interface to the network connection for writing
Returns
true iff the object pair was successfully written

Implements yarp::os::Portable.

Definition at line 78 of file PortablePair.h.

Member Data Documentation

◆ body

template<class HEAD, class BODY>
BODY yarp::os::PortablePair< HEAD, BODY >::body

An object of the second type (BODY).

Definition at line 61 of file PortablePair.h.

◆ head

template<class HEAD, class BODY>
HEAD yarp::os::PortablePair< HEAD, BODY >::head

An object of the first type (HEAD).

Definition at line 56 of file PortablePair.h.


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