YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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 >:

Public Member Functions

bool read (ConnectionReader &connection) override
 Reads this object pair from a network connection.
 
bool write (ConnectionWriter &connection) const override
 Writes this object pair to a network connection.
 
void onCompletion () const override
 This is called when the port has finished all writing operations.
 
- Public Member Functions inherited from yarp::os::Portable
virtual Type getType () const
 
- Public Member Functions inherited from yarp::os::PortReader
virtual ~PortReader ()
 Destructor.
 
virtual Type getReadType () const
 
- Public Member Functions inherited from yarp::os::PortWriter
virtual ~PortWriter ()
 Destructor.
 
virtual void onCommencement () const
 This is called when the port is about to begin writing operations.
 
virtual yarp::os::Type getWriteType () const
 

Public Attributes

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

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.
 
static bool writePair (ConnectionWriter &connection, const Portable &head, const Portable &body)
 Writes an object pair to a network connection.
 
- 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.
 

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/portable_pair.cpp.

Definition at line 46 of file PortablePair.h.

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 83 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 64 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 74 of file PortablePair.h.

Member Data Documentation

◆ body

An object of the second type (BODY).

Definition at line 57 of file PortablePair.h.

◆ head

An object of the first type (HEAD).

Definition at line 52 of file PortablePair.h.


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