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 31 of file Route.h.

Constructor & Destructor Documentation

◆ Route() [1/4]

Route::Route ( )

Default constructor.

Definition at line 46 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 54 of file Route.cpp.

◆ Route() [3/4]

Route::Route ( const Route rhs)

Copy constructor.

Parameters
rhsRoute to copy.

Definition at line 64 of file Route.cpp.

◆ Route() [4/4]

Route::Route ( Route &&  rhs)
noexcept

Move constructor.

Parameters
rhsthe Route to be moved

Definition at line 69 of file Route.cpp.

◆ ~Route()

Route::~Route ( )
virtual

Destructor.

Definition at line 75 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 126 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 96 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 116 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 106 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 80 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 88 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 131 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 101 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 121 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 111 of file Route.cpp.

◆ swapNames()

void Route::swapNames ( )

Swap from and to names.

Definition at line 136 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 141 of file Route.cpp.


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