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

Collection of carriers, a singleton. More...

#include <yarp/os/Carriers.h>

Public Member Functions

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

Static Public Member Functions

static CarrierchooseCarrier (const std::string &name)
 Select a carrier by name. More...
 
static CarriergetCarrierTemplate (const std::string &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 Bottle listCarriers ()
 

Detailed Description

Collection of carriers, a singleton.

This is the starting point for creating connections between ports.

Definition at line 29 of file Carriers.h.

Constructor & Destructor Documentation

◆ ~Carriers()

Carriers::~Carriers ( )
virtual

Destructor.

Definition at line 218 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 303 of file Carriers.cpp.

◆ chooseCarrier() [1/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 nullptr if not found.

Definition at line 244 of file Carriers.cpp.

◆ chooseCarrier() [2/2]

Carrier * Carriers::chooseCarrier ( const std::string &  name)
static

Select a carrier by name.

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

Definition at line 233 of file Carriers.cpp.

◆ clear()

void Carriers::clear ( )

Remove all carriers.

Definition at line 224 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 282 of file Carriers.cpp.

◆ getCarrierTemplate()

Carrier * Carriers::getCarrierTemplate ( const std::string &  name)
static

Get template for carrier.

Definition at line 238 of file Carriers.cpp.

◆ getInstance()

Carriers & Carriers::getInstance ( )
static

Definition at line 310 of file Carriers.cpp.

◆ listCarriers()

Bottle Carriers::listCarriers ( )
static

Definition at line 317 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 250 of file Carriers.cpp.


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