YARP
Yet Another Robot Platform

Information about a connection between two ports. More...

#include <yarp/os/Route.h>

Public Member Functions

 Route ()
 Default constructor. More...
 
 Route (const std::string &fromName, const std::string &toName, const std::string &carrierName)
 Create a route. More...
 
 Route (const Route &rhs)
 Copy constructor. More...
 
 Route (Route &&rhs) noexcept
 Move constructor. More...
 
virtual ~Route ()
 Destructor. More...
 
Routeoperator= (const Route &rhs)
 Copy assignment operator. More...
 
Routeoperator= (Route &&rhs) noexcept
 Move assignment operator. More...
 
const std::string & getFromName () const
 Get the source of the route. More...
 
void setFromName (const std::string &fromName)
 Set the source of the route. More...
 
const std::string & getToName () const
 Get the destination of the route. More...
 
void setToName (const std::string &toName)
 Set the destination of the route. More...
 
const ContactgetToContact () const
 Get the destination contact of the route, if available. More...
 
void setToContact (const Contact &toContact)
 Set the destination contact of the route. More...
 
const std::string & getCarrierName () const
 Get the carrier type of the route. More...
 
void setCarrierName (const std::string &carrierName)
 Set the carrier type of the route. More...
 
void swapNames ()
 Swap from and to names. More...
 
std::string toString () const
 Render a text form of the route, "source->carrier->dest". More...
 

Detailed Description

Information about a connection between two ports.

Contains the names of the endpoints, and the name of the carrier in use between them.

Definition at line 28 of file Route.h.

Constructor & Destructor Documentation

◆ Route() [1/4]

Route::Route ( )

Default constructor.

Definition at line 43 of file Route.cpp.

◆ Route() [2/4]

Route::Route ( const std::string &  fromName,
const std::string &  toName,
const std::string &  carrierName 
)

Create a route.

Parameters
fromNameSource of route.
toNameDestination of route.
carrierType of carrier.

Definition at line 51 of file Route.cpp.

◆ Route() [3/4]

Route::Route ( const Route rhs)

Copy constructor.

Parameters
rhsRoute to copy.

Definition at line 61 of file Route.cpp.

◆ Route() [4/4]

Route::Route ( Route &&  rhs)
noexcept

Move constructor.

Parameters
rhsthe Route to be moved

Definition at line 66 of file Route.cpp.

◆ ~Route()

Route::~Route ( )
virtual

Destructor.

Definition at line 72 of file Route.cpp.

Member Function Documentation

◆ getCarrierName()

const std::string & Route::getCarrierName ( ) const

Get the carrier type of the route.

Returns
the carrier type of the route.

Definition at line 123 of file Route.cpp.

◆ getFromName()

const std::string & Route::getFromName ( ) const

Get the source of the route.

Returns
the source of the route (a port name)

Definition at line 93 of file Route.cpp.

◆ getToContact()

const Contact & Route::getToContact ( ) const

Get the destination contact of the route, if available.

Returns
the destination of the route as a contact

Definition at line 113 of file Route.cpp.

◆ getToName()

const std::string & Route::getToName ( ) const

Get the destination of the route.

Returns
the destination of the route (a port name)

Definition at line 103 of file Route.cpp.

◆ operator=() [1/2]

Route & Route::operator= ( const Route rhs)

Copy assignment operator.

Parameters
rhsthe Route to copy
Returns
this object

Definition at line 77 of file Route.cpp.

◆ operator=() [2/2]

Route & Route::operator= ( Route &&  rhs)
noexcept

Move assignment operator.

Parameters
rhsthe Route to be moved
Returns
this object

Definition at line 85 of file Route.cpp.

◆ setCarrierName()

void Route::setCarrierName ( const std::string &  carrierName)

Set the carrier type of the route.

Parameters
carrierNamethe carrier type of the route.

Definition at line 128 of file Route.cpp.

◆ setFromName()

void Route::setFromName ( const std::string &  fromName)

Set the source of the route.

Parameters
fromNamethe source of the route (a port name)

Definition at line 98 of file Route.cpp.

◆ setToContact()

void Route::setToContact ( const Contact toContact)

Set the destination contact of the route.

Parameters
toContactthe destination of the route as a contact

Definition at line 118 of file Route.cpp.

◆ setToName()

void Route::setToName ( const std::string &  toName)

Set the destination of the route.

Parameters
toNamethe destination of the route (a port name)

Definition at line 108 of file Route.cpp.

◆ swapNames()

void Route::swapNames ( )

Swap from and to names.

Definition at line 133 of file Route.cpp.

◆ toString()

std::string Route::toString ( ) const

Render a text form of the route, "source->carrier->dest".

Returns
the route in text form.

Definition at line 138 of file Route.cpp.


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