AudioManager  7.5.11
Native Application Runtime Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
am::CAmRouter Class Reference

Implements an autorouting algorithm for connecting sinks and sources via different audio domains. More...

#include <CAmRouter.h>

Public Member Functions

 CAmRouter (IAmDatabaseHandler *iDatabaseHandler, CAmControlSender *iSender)
 
 ~CAmRouter ()
 
am_Error_e getRoute (const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector< am_Route_s > &returnList)
 Finds all possible paths between given source and sink. More...
 
am_Error_e getRoute (const bool onlyfree, const am_Source_s &aSource, const am_Sink_s &aSink, std::vector< am_Route_s > &listRoutes)
 
am_Error_e getAllPaths (CAmRoutingNode &aSource, CAmRoutingNode &aSink, std::vector< am_Route_s > &resultPath, std::vector< std::vector< CAmRoutingNode * >> &resultNodesPath, const bool includeCycles=false)
 
void getShortestPath (const CAmRoutingNode &source, const CAmRoutingNode &destination, std::vector< CAmRoutingNode * > &resultPath)
 
void getShortestPath (CAmRoutingNode &aSource, CAmRoutingNode &aSink, am_Route_s &resultPath, std::vector< CAmRoutingNode * > &resultNodesPath)
 
CAmRoutingNodesinkNodeWithID (const am_sinkID_t sinkID)
 Returns a sink node with given sinkID. More...
 
CAmRoutingNodesinkNodeWithID (const am_sinkID_t sinkID, const am_domainID_t domainID)
 
CAmRoutingNodesourceNodeWithID (const am_sourceID_t sourceID)
 Returns a source node with given sourceID. More...
 
CAmRoutingNodesourceNodeWithID (const am_sourceID_t sourceID, const am_domainID_t domainID)
 
CAmRoutingNodeconverterNodeWithSinkID (const am_sinkID_t sinkID, const am_domainID_t domainID)
 Returns a converter node for given sinkID. More...
 
CAmRoutingNodegatewayNodeWithSinkID (const am_sinkID_t sinkID)
 Returns a gateway node for given sinkID. More...
 
void load (const bool onlyFree)
 
void clear ()
 

Static Public Member Functions

static bool getAllowedFormatsFromConvMatrix (const std::vector< bool > &convertionMatrix, const std::vector< am_CustomConnectionFormat_t > &listSourceFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkFormats, std::vector< am_CustomConnectionFormat_t > &sourceFormats, std::vector< am_CustomConnectionFormat_t > &sinkFormats)
 
static void listPossibleConnectionFormats (std::vector< am_CustomConnectionFormat_t > &inListSourceFormats, std::vector< am_CustomConnectionFormat_t > &inListSinkFormats, std::vector< am_CustomConnectionFormat_t > &outListFormats)
 
static bool getRestrictedOutputFormats (const std::vector< bool > &convertionMatrix, const std::vector< am_CustomConnectionFormat_t > &listSourceFormats, const std::vector< am_CustomConnectionFormat_t > &listSinkFormats, const am_CustomConnectionFormat_t connectionFormat, std::vector< am_CustomConnectionFormat_t > &listFormats)
 
static void getSourceSinkPossibleConnectionFormats (std::vector< CAmRoutingNode * >::iterator iteratorSource, std::vector< CAmRoutingNode * >::iterator iteratorSink, std::vector< am_CustomConnectionFormat_t > &outConnectionFormats)
 
static bool shouldGoInDomain (const std::vector< am_domainID_t > &visitedDomains, const am_domainID_t nodeDomainID)
 

Detailed Description

Implements an autorouting algorithm for connecting sinks and sources via different audio domains.

Definition at line 152 of file CAmRouter.h.

Constructor & Destructor Documentation

am::CAmRouter::CAmRouter ( IAmDatabaseHandler iDatabaseHandler,
CAmControlSender iSender 
)

Definition at line 56 of file CAmRouter.cpp.

am::CAmRouter::~CAmRouter ( )

Definition at line 70 of file CAmRouter.cpp.

Member Function Documentation

void am::CAmRouter::clear ( )

Definition at line 191 of file CAmRouter.cpp.

CAmRoutingNode * am::CAmRouter::converterNodeWithSinkID ( const am_sinkID_t  sinkID,
const am_domainID_t  domainID 
)

Returns a converter node for given sinkID.

Parameters
sinkIDsink id.
domainIDdomain id.
Returns
pointer to node or NULL.

Definition at line 248 of file CAmRouter.cpp.

CAmRoutingNode * am::CAmRouter::gatewayNodeWithSinkID ( const am_sinkID_t  sinkID)

Returns a gateway node for given sinkID.

Parameters
sinkIDsink id.
Returns
pointer to node or NULL.

Definition at line 260 of file CAmRouter.cpp.

bool am::CAmRouter::getAllowedFormatsFromConvMatrix ( const std::vector< bool > &  convertionMatrix,
const std::vector< am_CustomConnectionFormat_t > &  listSourceFormats,
const std::vector< am_CustomConnectionFormat_t > &  listSinkFormats,
std::vector< am_CustomConnectionFormat_t > &  sourceFormats,
std::vector< am_CustomConnectionFormat_t > &  sinkFormats 
)
static

Definition at line 796 of file CAmRouter.cpp.

am_Error_e am::CAmRouter::getAllPaths ( CAmRoutingNode aSource,
CAmRoutingNode aSink,
std::vector< am_Route_s > &  resultPath,
std::vector< std::vector< CAmRoutingNode * >> &  resultNodesPath,
const bool  includeCycles = false 
)

Definition at line 627 of file CAmRouter.cpp.

bool am::CAmRouter::getRestrictedOutputFormats ( const std::vector< bool > &  convertionMatrix,
const std::vector< am_CustomConnectionFormat_t > &  listSourceFormats,
const std::vector< am_CustomConnectionFormat_t > &  listSinkFormats,
const am_CustomConnectionFormat_t  connectionFormat,
std::vector< am_CustomConnectionFormat_t > &  listFormats 
)
static

Definition at line 837 of file CAmRouter.cpp.

am_Error_e am::CAmRouter::getRoute ( const bool  onlyfree,
const am_sourceID_t  sourceID,
const am_sinkID_t  sinkID,
std::vector< am_Route_s > &  returnList 
)

Finds all possible paths between given source and sink.

returns the best route between a source and a sink

Parameters
onlyfreeonly disconnected elements should be included or not.
sourceIDstarting point.
sinkIDending point.
returnListlist with all possible paths
Returns
E_OK on success(0 or more paths) or E_NOT_POSSIBLE on failure.
Parameters
onlyfreeif true only free gateways are used
sourceID
sinkID
returnListthis list contains a set of routes
Returns
E_OK in case of success

Definition at line 82 of file CAmRouter.cpp.

am_Error_e am::CAmRouter::getRoute ( const bool  onlyfree,
const am_Source_s aSource,
const am_Sink_s aSink,
std::vector< am_Route_s > &  listRoutes 
)

Definition at line 98 of file CAmRouter.cpp.

void am::CAmRouter::getShortestPath ( const CAmRoutingNode source,
const CAmRoutingNode destination,
std::vector< CAmRoutingNode * > &  resultPath 
)
void am::CAmRouter::getShortestPath ( CAmRoutingNode aSource,
CAmRoutingNode aSink,
am_Route_s resultPath,
std::vector< CAmRoutingNode * > &  resultNodesPath 
)
void am::CAmRouter::getSourceSinkPossibleConnectionFormats ( std::vector< CAmRoutingNode * >::iterator  iteratorSource,
std::vector< CAmRoutingNode * >::iterator  iteratorSink,
std::vector< am_CustomConnectionFormat_t > &  outConnectionFormats 
)
static

Definition at line 868 of file CAmRouter.cpp.

void am::CAmRouter::listPossibleConnectionFormats ( std::vector< am_CustomConnectionFormat_t > &  inListSourceFormats,
std::vector< am_CustomConnectionFormat_t > &  inListSinkFormats,
std::vector< am_CustomConnectionFormat_t > &  outListFormats 
)
static

Definition at line 826 of file CAmRouter.cpp.

void am::CAmRouter::load ( const bool  onlyFree)

Definition at line 128 of file CAmRouter.cpp.

bool am::CAmRouter::shouldGoInDomain ( const std::vector< am_domainID_t > &  visitedDomains,
const am_domainID_t  nodeDomainID 
)
static

Definition at line 708 of file CAmRouter.cpp.

CAmRoutingNode * am::CAmRouter::sinkNodeWithID ( const am_sinkID_t  sinkID)

Returns a sink node with given sinkID.

Parameters
sinkIDsink id.
Returns
pointer to node or NULL.

Definition at line 200 of file CAmRouter.cpp.

CAmRoutingNode * am::CAmRouter::sinkNodeWithID ( const am_sinkID_t  sinkID,
const am_domainID_t  domainID 
)

Definition at line 212 of file CAmRouter.cpp.

CAmRoutingNode * am::CAmRouter::sourceNodeWithID ( const am_sourceID_t  sourceID)

Returns a source node with given sourceID.

Parameters
sourceIDsource id.
Returns
pointer to node or NULL.

Definition at line 224 of file CAmRouter.cpp.

CAmRoutingNode * am::CAmRouter::sourceNodeWithID ( const am_sourceID_t  sourceID,
const am_domainID_t  domainID 
)

Definition at line 236 of file CAmRouter.cpp.


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