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

Collection of carriers, a singleton. More...

#include <yarp/os/Carriers.h>

Classes

class  Private
 

Public Member Functions

virtual ~Carriers ()
 Destructor. More...
 
void clear ()
 Remove all carriers. More...
 

Static Public Member Functions

static CarrierchooseCarrier (const ConstString &name)
 Select a carrier by name. More...
 
static CarriergetCarrierTemplate (const ConstString &name)
 Get template for carrier. More...
 
static CarrierchooseCarrier (const Bytes &bytes)
 Select a carrier by 8-byte header. More...
 
static Facelisten (const Contact &address)
 Create a "proto-carrier" interface object that waits for incoming connections prior to a carrier being selected via handshaking. More...
 
static OutputProtocolconnect (const Contact &address)
 Initiate a connection to an address. More...
 
static bool addCarrierPrototype (Carrier *carrier)
 Add a new connection type. More...
 
static CarriersgetInstance ()
 
static void removeInstance ()
 
static Bottle listCarriers ()
 

Private Member Functions

 Carriers ()
 

Private Attributes

Private *const mPriv
 

Detailed Description

Collection of carriers, a singleton.

This is the starting point for creating connections between ports.

Definition at line 31 of file Carriers.h.

Constructor & Destructor Documentation

◆ ~Carriers()

Carriers::~Carriers ( )
virtual

Destructor.

Definition at line 225 of file Carriers.cpp.

◆ Carriers()

Carriers::Carriers ( )
private

Definition at line 207 of file Carriers.cpp.

Member Function Documentation

◆ addCarrierPrototype()

bool Carriers::addCarrierPrototype ( Carrier carrier)
static

Add a new connection type.

Parameters
carriera prototype of the desired connection type. The YARP library will be responsible for destroying it on shutdown.
Returns
true on success.
Examples:
carrier/carrier_stub.cpp.

Definition at line 284 of file Carriers.cpp.

◆ chooseCarrier() [1/2]

Carrier * Carriers::chooseCarrier ( const ConstString name)
static

Select a carrier by name.

Parameters
namethe name of the desired carrier.
Returns
the desired carrier, or YARP_NULLPTR if not found.

Definition at line 240 of file Carriers.cpp.

◆ chooseCarrier() [2/2]

Carrier * Carriers::chooseCarrier ( const Bytes bytes)
static

Select a carrier by 8-byte header.

Parameters
bytesthe 8-byte header describing the desired carrier.
Returns
the desired carrier, or YARP_NULLPTR if not found.

Definition at line 251 of file Carriers.cpp.

◆ clear()

void Carriers::clear ( )

Remove all carriers.

Definition at line 231 of file Carriers.cpp.

◆ connect()

OutputProtocol * Carriers::connect ( const Contact address)
static

Initiate a connection to an address.

Parameters
addressthe address (including desired carrier type) to connect to.
Returns
the protocol object.

Definition at line 277 of file Carriers.cpp.

◆ getCarrierTemplate()

Carrier * Carriers::getCarrierTemplate ( const ConstString name)
static

Get template for carrier.

Definition at line 245 of file Carriers.cpp.

◆ getInstance()

Carriers & Carriers::getInstance ( )
static

Definition at line 297 of file Carriers.cpp.

◆ listCarriers()

Bottle Carriers::listCarriers ( )
static

Definition at line 318 of file Carriers.cpp.

◆ listen()

Face * Carriers::listen ( const Contact address)
static

Create a "proto-carrier" interface object that waits for incoming connections prior to a carrier being selected via handshaking.

Currently, this is always a tcp server socket. There is no reason why it couldn't be any kind of stream, and this would be the method to change if you want to do something imaginative here.

Parameters
addressthe address (including initial carrier type) to listen to.
Returns
the interface object.

Definition at line 257 of file Carriers.cpp.

◆ removeInstance()

void Carriers::removeInstance ( )
static

Definition at line 308 of file Carriers.cpp.

Member Data Documentation

◆ mPriv

Private* const yarp::os::Carriers::mPriv
private

Definition at line 111 of file Carriers.h.


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