YARP  2.3.70.2
Yet Another Robot Platform
yarp::os::DummyConnector Class Reference

A dummy connection to test yarp::os::Portable implementations. More...

#include <yarp/os/DummyConnector.h>

Public Member Functions

 DummyConnector ()
 Default constructor. More...
 
virtual ~DummyConnector ()
 Destructor. More...
 
void setTextMode (bool textmode)
 Set the textMode of the dummy connection. More...
 
ConnectionWritergetCleanWriter ()
 Get a clean/empty dummy ConnectionWriter. More...
 
ConnectionWritergetWriter ()
 Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was last reset. More...
 
ConnectionReadergetReader ()
 Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was last reset. More...
 
void reset ()
 Reset and clear the current ConnectionWriter. More...
 

Private Attributes

void * implementation
 

Detailed Description

A dummy connection to test yarp::os::Portable implementations.

This class provides simple means to test read and write methods of the Portable interface.

Pseudocode for a test should look something like this:

DummyConnector dummy; // create new connection with textmode=false
PortableObject object;
... // set object values
object.write(dummy.getWriter()); // reset the connection and then write to it
PortableObject newObject;
newObject.read(dummy.getReader()); // write from the connection to the new object
... // assert newObject values
Author
Freyr Magnusson

Definition at line 37 of file DummyConnector.h.

Constructor & Destructor Documentation

◆ DummyConnector()

DummyConnector::DummyConnector ( )

Default constructor.

TextMode set to false.

Definition at line 81 of file DummyConnector.cpp.

◆ ~DummyConnector()

DummyConnector::~DummyConnector ( )
virtual

Destructor.

Definition at line 86 of file DummyConnector.cpp.

Member Function Documentation

◆ getCleanWriter()

ConnectionWriter & DummyConnector::getCleanWriter ( )

Get a clean/empty dummy ConnectionWriter.

This will reset the connection each time.

Returns
a empty dummy ConnectionWriter
See also
ConnectionWriter Portable

Definition at line 98 of file DummyConnector.cpp.

◆ getReader()

ConnectionReader & DummyConnector::getReader ( )

Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was last reset.

Returns
a loaded ConnectionReader if it was previously written to
See also
ConnectionReader Portable

Definition at line 106 of file DummyConnector.cpp.

◆ getWriter()

ConnectionWriter & DummyConnector::getWriter ( )

Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was last reset.

Returns
the current ConnectionWriter
See also
ConnectionWriter Portable

Definition at line 102 of file DummyConnector.cpp.

◆ reset()

void DummyConnector::reset ( )

Reset and clear the current ConnectionWriter.

Definition at line 110 of file DummyConnector.cpp.

◆ setTextMode()

void DummyConnector::setTextMode ( bool  textmode)

Set the textMode of the dummy connection.

Parameters
textmodenew textmode value

Definition at line 93 of file DummyConnector.cpp.

Member Data Documentation

◆ implementation

void* yarp::os::DummyConnector::implementation
private

Definition at line 85 of file DummyConnector.h.


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