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

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

#include <yarp/os/DummyConnector.h>

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
DummyConnector()
Default constructor.

Definition at line 34 of file 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...
 

Constructor & Destructor Documentation

◆ DummyConnector()

DummyConnector::DummyConnector ( )

Default constructor.

TextMode set to false.

Definition at line 86 of file DummyConnector.cpp.

◆ ~DummyConnector()

DummyConnector::~DummyConnector ( )
virtual

Destructor.

Definition at line 91 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 101 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
Warning
Calling this method twice will reset the reader

Definition at line 111 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 106 of file DummyConnector.cpp.

◆ reset()

void DummyConnector::reset ( )

Reset and clear the current ConnectionWriter.

Definition at line 116 of file DummyConnector.cpp.

◆ setTextMode()

void DummyConnector::setTextMode ( bool  textmode)

Set the textMode of the dummy connection.

Parameters
textmodenew textmode value

Definition at line 96 of file DummyConnector.cpp.


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