AudioManager  7.6.6
Native Application Runtime Environment
am::CAmRouter Class Reference

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

#include <CAmRouter.h>

Inheritance diagram for am::CAmRouter:
am::CAmDatabaseHandlerMap::AmDatabaseObserverCallbacks

Public Member Functions

 CAmRouter (IAmDatabaseHandler *iDatabaseHandler, CAmControlSender *iSender)
 
 ~CAmRouter ()
 
unsigned getMaxAllowedCycles ()
 
void setMaxAllowedCycles (unsigned count)
 
unsigned getMaxPathCount ()
 
void setMaxPathCount (unsigned count)
 
bool getUpdateGraphNodesAction ()
 
am_Error_e getRoute (const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector< am_Route_s > &returnList)
 Find first mMaxPathCount paths between given source and sink. More...
 
am_Error_e getRoute (const bool onlyfree, const am_Source_s &source, const am_Sink_s &sink, std::vector< am_Route_s > &listRoutes)
 
am_Error_e getRouteFromLoadedNodes (const bool onlyfree, const am_sourceID_t sourceID, const am_sinkID_t sinkID, std::vector< am_Route_s > &returnList)
 Find first mMaxPathCount paths between given source and sink after the nodes have been loaded. More...
 
am_Error_e getRouteFromLoadedNodes (const bool onlyfree, const am_Source_s &aSource, const am_Sink_s &aSink, std::vector< am_Route_s > &listRoutes)
 
am_Error_e getFirstNShortestPaths (const bool onlyfree, const unsigned cycles, const unsigned maxPathCount, CAmRoutingNode &source, CAmRoutingNode &sink, std::vector< am_Route_s > &resultPath)
 Find first mMaxPathCount paths between given source and sink. More...
 
am_Error_e getShortestPath (CAmRoutingNode &source, CAmRoutingNode &sink, std::vector< am_Route_s > &resultPath)
 Find the shortest path between given source and sink. More...
 
bool shouldGoInDomain (const std::vector< am_domainID_t > &visitedDomains, const am_domainID_t nodeDomainID)
 
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 ()
 
void clear ()
 
am_Error_e getAllPaths (CAmRoutingNode &aSource, CAmRoutingNode &aSink, std::vector< am_Route_s > &resultPath, std::vector< std::vector< CAmRoutingNode * >> &resultNodesPath, const bool includeCycles=false, const bool onlyFree=false) __attribute__((deprecated("You should use am_Error_e getFirstNShortestPaths( const bool onlyFree
 DEPRECATED! More...
 
- Public Member Functions inherited from am::CAmDatabaseHandlerMap::AmDatabaseObserverCallbacks
 AmDatabaseObserverCallbacks ()
 
virtual ~AmDatabaseObserverCallbacks ()
 

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 am_Error_e 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, const unsigned maxCyclesNumber)
 

Public Attributes

am_Error_e CAmRoutingNode CAmRoutingNode std::vector< am_Route_s > & instead
 

Additional Inherited Members

- Protected Attributes inherited from am::CAmDatabaseHandlerMap::AmDatabaseObserverCallbacks
std::function< void()> dboNumberOfSinkClassesChanged
 
std::function< void()> dboNumberOfSourceClassesChanged
 
std::function< void(const am_Sink_s &)> dboNewSink
 
std::function< void(const am_Source_s &)> dboNewSource
 
std::function< void(const am_Domain_s &)> dboNewDomain
 
std::function< void(const am_Gateway_s &)> dboNewGateway
 
std::function< void(const am_Converter_s &)> dboNewConverter
 
std::function< void(const am_Crossfader_s &)> dboNewCrossfader
 
std::function< void(const am_MainConnectionType_s &)> dboNewMainConnection
 
std::function< void(const am_mainConnectionID_t)> dboRemovedMainConnection
 
std::function< void(const am_sinkID_t, const bool)> dboRemovedSink
 
std::function< void(const am_sourceID_t, const bool)> dboRemovedSource
 
std::function< void(const am_domainID_t)> dboRemoveDomain
 
std::function< void(const am_gatewayID_t)> dboRemoveGateway
 
std::function< void(const am_converterID_t)> dboRemoveConverter
 
std::function< void(const am_crossfaderID_t)> dboRemoveCrossfader
 
std::function< void(const am_mainConnectionID_t, const am_ConnectionState_e)> dboMainConnectionStateChanged
 
std::function< void(const am_sinkID_t, const am_MainSoundProperty_s &)> dboMainSinkSoundPropertyChanged
 
std::function< void(const am_sourceID_t, const am_MainSoundProperty_s &)> dboMainSourceSoundPropertyChanged
 
std::function< void(const am_sinkID_t, const am_Availability_s &)> dboSinkAvailabilityChanged
 
std::function< void(const am_sourceID_t, const am_Availability_s &)> dboSourceAvailabilityChanged
 
std::function< void(const am_sinkID_t, const am_mainVolume_t)> dboVolumeChanged
 
std::function< void(const am_sinkID_t, const am_MuteState_e)> dboSinkMuteStateChanged
 
std::function< void(const am_SystemProperty_s &)> dboSystemPropertyChanged
 
std::function< void(const am_mainConnectionID_t, const am_timeSync_t)> dboTimingInformationChanged
 
std::function< void(const am_sinkID_t, const am_sinkClass_t, const std::vector< am_MainSoundProperty_s > &, const bool)> dboSinkUpdated
 
std::function< void(const am_sourceID_t, const am_sourceClass_t, const std::vector< am_MainSoundProperty_s > &, const bool)> dboSourceUpdated
 
std::function< void(const am_sinkID_t, const am_NotificationConfiguration_s)> dboSinkMainNotificationConfigurationChanged
 
std::function< void(const am_sourceID_t, const am_NotificationConfiguration_s)> dboSourceMainNotificationConfigurationChanged
 
CAmDatabaseHandlerMapmpDatabaseHandler
 

Detailed Description

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

Definition at line 159 of file CAmRouter.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file CAmRouter.cpp.

am::CAmRouter::~CAmRouter ( )

Definition at line 99 of file CAmRouter.cpp.

Member Function Documentation

void am::CAmRouter::clear ( )

Definition at line 225 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 284 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 297 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 828 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,
const bool  onlyFree = false 
) const

DEPRECATED!

Definition at line 910 of file CAmRouter.cpp.

am_Error_e am::CAmRouter::getFirstNShortestPaths ( const bool  onlyfree,
const unsigned  cycles,
const unsigned  maxPathCount,
CAmRoutingNode source,
CAmRoutingNode sink,
std::vector< am_Route_s > &  resultPath 
)

Find first mMaxPathCount paths between given source and sink.

This method doesn't call load().

Parameters
onlyfreeonly disconnected elements should be included or not.
cyclesallowed domain cycles.
maxPathCountmax count of returned paths.
sourcestart point.
sinkend point.
returnListlist with all possible paths.
Returns
E_OK on success(1 or more paths), E_NOT_POSSIBLE if the CF couldn't be matached or E_UNKNOWN in any other error case.

Definition at line 715 of file CAmRouter.cpp.

unsigned am::CAmRouter::getMaxAllowedCycles ( )
inline

Definition at line 245 of file CAmRouter.h.

unsigned am::CAmRouter::getMaxPathCount ( )
inline

Definition at line 254 of file CAmRouter.h.

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 865 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 
)

Find first mMaxPathCount paths between given source and sink.

returns the best route between a source and a sink

This method will call the method load() if the parameter mUpdateGraphNodesAction is set which will rebuild the graph.

Parameters
onlyfreeonly disconnected elements should be included or not.
sourceIDstart point.
sinkIDend point.
returnListlist with all possible paths
Returns
E_OK on success(1 or more paths), E_NOT_POSSIBLE if the CF couldn't be matached or E_UNKNOWN in any other error case.
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 111 of file CAmRouter.cpp.

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

Definition at line 121 of file CAmRouter.cpp.

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

Find first mMaxPathCount paths between given source and sink after the nodes have been loaded.

This method doesn't call load().

Parameters
onlyfreeonly disconnected elements should be included or not.
sourceIDstart point.
sinkIDend point.
returnListlist with all possible paths
Returns
E_OK on success(1 or more paths), E_NOT_POSSIBLE if the CF couldn't be matached or E_UNKNOWN in any other error case.

Definition at line 126 of file CAmRouter.cpp.

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

Definition at line 153 of file CAmRouter.cpp.

am_Error_e am::CAmRouter::getShortestPath ( CAmRoutingNode source,
CAmRoutingNode sink,
std::vector< am_Route_s > &  resultPath 
)

Find the shortest path between given source and sink.

This method doesn't call load(). It goes through all possible paths and returns the shortest of them.

Parameters
sourcestart point.
sinkend point.
returnListlist with the connection format permutations of the shortest path.
Returns
E_OK on success(1 or more paths), E_NOT_POSSIBLE if the CF couldn't be matached or E_UNKNOWN in any other error case.

Definition at line 657 of file CAmRouter.cpp.

am_Error_e am::CAmRouter::getSourceSinkPossibleConnectionFormats ( std::vector< CAmRoutingNode * >::iterator  iteratorSource,
std::vector< CAmRoutingNode * >::iterator  iteratorSink,
std::vector< am_CustomConnectionFormat_t > &  outConnectionFormats 
)
static

Definition at line 893 of file CAmRouter.cpp.

bool am::CAmRouter::getUpdateGraphNodesAction ( )
inline

Definition at line 263 of file CAmRouter.h.

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 856 of file CAmRouter.cpp.

void am::CAmRouter::load ( )

Definition at line 159 of file CAmRouter.cpp.

void am::CAmRouter::setMaxAllowedCycles ( unsigned  count)
inline

Definition at line 249 of file CAmRouter.h.

void am::CAmRouter::setMaxPathCount ( unsigned  count)
inline

Definition at line 258 of file CAmRouter.h.

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

Definition at line 797 of file CAmRouter.cpp.

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

Definition at line 823 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 234 of file CAmRouter.cpp.

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

Definition at line 246 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 259 of file CAmRouter.cpp.

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

Definition at line 271 of file CAmRouter.cpp.

Member Data Documentation

am_Error_e CAmRoutingNode CAmRoutingNode std::vector<am_Route_s>& am::CAmRouter::instead

Definition at line 375 of file CAmRouter.h.


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