YARP  2.3.68+225-20170329.5+gitb0d3289
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 >:

Public Member Functions

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

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, Portable &head, 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...
 

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 16 of file PortablePair.h.

Member Function Documentation

◆ onCompletion()

template<class HEAD, class BODY>
virtual void yarp::os::PortablePair< HEAD, BODY >::onCompletion ( )
inlinevirtual

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 84 of file PortablePair.h.

◆ read()

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

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 67 of file PortablePair.h.

◆ write()

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

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 76 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 60 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 55 of file PortablePair.h.


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