EMANE  1.2.1
EMANE::Application::TransportBuilder Class Reference

Provides methods for contructing transports and a manager to contain and control them as a a group. More...

#include <transportbuilder.h>

Public Member Functions

 TransportBuilder ()
 
 ~TransportBuilder ()
 
std::unique_ptr< TransportManagerbuildTransportManager (const uuid_t &uuid, TransportAdapters &adapters, const ConfigurationUpdateRequest &request) const
 
std::unique_ptr< TransportAdapterbuildTransportAdapter (std::unique_ptr< NEMLayer > &pTransport, const ConfigurationUpdateRequest &request) const
 
std::unique_ptr< NEMLayerbuildTransport (NEMId id, const std::string &sLibraryFile, const ConfigurationUpdateRequest &request, bool bSkipConfigure=false) const
 
template<typename T >
std::pair< T *, std::unique_ptr< TransportAdapter > > buildTransportWithAdapter (const NEMId id, const ConfigurationUpdateRequest &request, const std::string &sPlatformEndpoint, const std::string &sTransportEndpoint) const
 Build an instance of the transport named by the template parameter. T must be a subclass of EMANE::Transport and provide a constructor with signature: T(EMANE::NEMId id, EMANE::PlatformServiceProvider * p) T will be instantiated via this constructor. More...
 
template<typename T >
std::pair< T *, std::unique_ptr< EMANE::Application::TransportAdapter > > buildTransportWithAdapter (const NEMId id, const ConfigurationUpdateRequest &request, const std::string &sPlatformEndpoint, const std::string &sTransportEndpoint) const
 

Detailed Description

Provides methods for contructing transports and a manager to contain and control them as a a group.

Definition at line 61 of file transportbuilder.h.

Constructor & Destructor Documentation

◆ TransportBuilder()

EMANE::Application::TransportBuilder::TransportBuilder ( )

Creates a TransportBuilder instance

Definition at line 49 of file transportbuilder.cc.

◆ ~TransportBuilder()

EMANE::Application::TransportBuilder::~TransportBuilder ( )

Destorys an instance

Definition at line 51 of file transportbuilder.cc.

Member Function Documentation

◆ buildTransport()

std::unique_ptr< EMANE::NEMLayer > EMANE::Application::TransportBuilder::buildTransport ( NEMId  id,
const std::string &  sLibraryFile,
const ConfigurationUpdateRequest request,
bool  bSkipConfigure = false 
) const

Builds a Transport

Parameters
idNEMId of the NEM associated with this transport
sLibraryFileName of the dll containing the generator
requestconfiguration update
bSkipConfigureFlag indicating whether to skip calling Component::configure
Returns
Unique pointer to an initialized and configured Transport
Exceptions
Utils::FactoryExceptionwhen a DLL load error occurs.
InitializeExceptionwhen an error occurs during initialization.
ConfigureExceptionwhen an error occurs during configure.

Definition at line 112 of file transportbuilder.cc.

◆ buildTransportAdapter()

std::unique_ptr< EMANE::Application::TransportAdapter > EMANE::Application::TransportBuilder::buildTransportAdapter ( std::unique_ptr< NEMLayer > &  pTransport,
const ConfigurationUpdateRequest request 
) const

Builds a TransportAdapter

Parameters
pTransportthe transport connected to the adapter
requestconfiguration update
Returns
Unqiue pointer to an initialized and configured TransportAdapter
Exceptions
InitializeExceptionwhen an error occurs during initialization.
BuildExceptionwhen an error occurs building an NEM from the specified layers.
ConfigureExceptionwhen an error occurs during configure.

Definition at line 86 of file transportbuilder.cc.

◆ buildTransportManager()

std::unique_ptr< EMANE::Application::TransportManager > EMANE::Application::TransportBuilder::buildTransportManager ( const uuid_t &  uuid,
TransportAdapters adapters,
const ConfigurationUpdateRequest request 
) const

Builds a TransportManager

Parameters
uuidInstance uuid
adapterstransport pairs to manage
requestconfiguration update
Returns
Unique pointer to an initialized and configured TransportManager
Exceptions
InitializeExceptionwhen an error occurs during initialization.
BuildExceptionwhen an error occurs building an NEM from the specified layers.
ConfigureExceptionwhen an error occurs during configure.

Definition at line 54 of file transportbuilder.cc.

◆ buildTransportWithAdapter() [1/2]

template<typename T >
std::pair<T *,std::unique_ptr<EMANE::Application::TransportAdapter> > EMANE::Application::TransportBuilder::buildTransportWithAdapter ( const NEMId  id,
const ConfigurationUpdateRequest request,
const std::string &  sPlatformEndpoint,
const std::string &  sTransportEndpoint 
) const

Definition at line 36 of file transportbuilder.inl.

◆ buildTransportWithAdapter() [2/2]

template<typename T >
std::pair<T *,std::unique_ptr<TransportAdapter> > EMANE::Application::TransportBuilder::buildTransportWithAdapter ( const NEMId  id,
const ConfigurationUpdateRequest request,
const std::string &  sPlatformEndpoint,
const std::string &  sTransportEndpoint 
) const

Build an instance of the transport named by the template parameter. T must be a subclass of EMANE::Transport and provide a constructor with signature: T(EMANE::NEMId id, EMANE::PlatformServiceProvider * p) T will be instantiated via this constructor.

Builds a Transport and TransportAdapter

Template Parameters
TTransport derived implementation
Parameters
idNEMId of the NEM associated with this transport
requestconfiguration update
sPlatformEndpointPlatform endpoint
sTransportEndpointTransport endpoint
Returns
std::pair with first being a borrowed reference to the newly created transport and second being a unique_ptr<TransportAdapter> that should used (moved) when building a TransportManager.
Exceptions
InitializeExceptionwhen an error occurs during initialization.
ConfigureExceptionwhen an error occurs during configure.

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