41 const std::vector<am_CustomConnectionFormat_t> & listConnectionFormats,
42 std::vector<am_CustomConnectionFormat_t> & outListMergeConnectionFormats)
44 std::vector<am_CustomConnectionFormat_t> listRestrictedConnectionFormats;
46 element->listSourceFormats,
47 element->listSinkFormats,
49 listRestrictedConnectionFormats);
50 std::sort(listRestrictedConnectionFormats.begin(), listRestrictedConnectionFormats.end());
51 std::insert_iterator<std::vector<am_CustomConnectionFormat_t> > inserter(outListMergeConnectionFormats, outListMergeConnectionFormats.begin());
52 set_intersection(listConnectionFormats.begin(), listConnectionFormats.end(), listRestrictedConnectionFormats.begin(), listRestrictedConnectionFormats.end(), inserter);
57 mpDatabaseHandler(iDatabaseHandler),
58 mpControlSender(iSender),
59 mOnlyFreeConversionNodes(false),
66 assert(mpDatabaseHandler);
67 assert(mpControlSender);
93 error =
getRoute(onlyfree, source, sink, returnList);
111 std::cout <<
"Node " << node.
getIndex() <<
" :";
116 std::cout <<
"Node " << data->
getIndex() <<
" :";
119 std::cout << std::endl;
123 std::vector<std::vector<CAmRoutingNode*>> pathNodes;
124 error =
getAllPaths(*pRootSource, *pRootSink, listRoutes, pathNodes);
131 mOnlyFreeConversionNodes = onlyFree;
133 #if defined (WITH_DATABASE_STORAGE)
134 std::deque<am_Source_s> listSources;
135 std::deque<am_Sink_s> listSinks;
136 std::deque<am_Gateway_s> listGateways;
137 std::deque<am_Converter_s> listConverters;
140 nodeDataSrc.
type = CAmNodeDataType::SOURCE;
142 #if defined (WITH_DATABASE_STORAGE)
143 listSources.push_back(obj);
144 nodeDataSrc.
data.
source = &listSources.back();
151 nodeDataSink.
type = CAmNodeDataType::SINK;
153 #if defined (WITH_DATABASE_STORAGE)
154 listSinks.push_back(obj);
155 nodeDataSrc.
data.
sink = &listSinks.back();
162 nodeDataGateway.
type = CAmNodeDataType::GATEWAY;
164 #if defined (WITH_DATABASE_STORAGE)
165 listGateways.push_back(obj);
173 nodeDataConverter.
type = CAmNodeDataType::CONVERTER;
175 #if defined (WITH_DATABASE_STORAGE)
176 listConverters.push_back(obj);
184 #ifdef ROUTING_BUILD_CONNECTIONS
185 constructConverterConnections();
186 constructGatewayConnections();
187 constructSourceSinkConnections();
193 mRoutingGraph.
clear();
194 mNodeListSources.clear();
195 mNodeListSinks.clear();
196 mNodeListGateways.clear();
197 mNodeListConverters.clear();
203 for(
auto it = mNodeListSinks.begin(); it!=mNodeListSinks.end(); it++)
215 std::vector<CAmRoutingNode*> & value = mNodeListSinks[domainID];
216 auto iter = std::find_if(value.begin(), value.end(), [sinkID](
CAmRoutingNode* node){
217 return node->getData().data.sink->sinkID==sinkID;
219 if(iter!=value.end())
227 for(
auto it = mNodeListSources.begin(); it!=mNodeListSources.end(); it++)
239 std::vector<CAmRoutingNode*> & value = mNodeListSources[domainID];
240 auto iter = std::find_if(value.begin(), value.end(), [sourceID](
CAmRoutingNode* node){
241 return node->getData().data.source->sourceID==sourceID;
243 if(iter!=value.end())
251 std::vector<CAmRoutingNode*> & value = mNodeListConverters[domainID];
252 auto iter = std::find_if(value.begin(), value.end(), [sinkID](
CAmRoutingNode* node){
253 return node->getData().data.converter->sinkID==sinkID;
255 if(iter!=value.end())
262 for(
auto it = mNodeListGateways.begin(); it!=mNodeListGateways.end(); it++)
264 std::vector<CAmRoutingNode*> & value = it->second;
265 auto iter = std::find_if(value.begin(), value.end(), [sinkID](
CAmRoutingNode* node){
266 return node->getData().data.gateway->sinkID==sinkID;
268 if(iter!=value.end())
274 #ifdef ROUTING_BUILD_CONNECTIONS
276 void CAmRouter::constructSourceSinkConnections()
278 std::vector<am_CustomConnectionFormat_t> intersection;
279 for(
auto itSrc = mNodeListSources.begin(); itSrc!=mNodeListSources.end(); itSrc++)
281 for(
auto it = itSrc->second.begin(); it!=itSrc->second.end(); it++)
286 for(
auto itSink = mNodeListSinks[itSrc->first].begin(); itSink!=mNodeListSinks[itSrc->first].end(); itSink++)
292 intersection.clear();
295 if(intersection.size()>0)
304 void CAmRouter::constructGatewayConnections()
306 std::vector<am_CustomConnectionFormat_t> sourceFormats, sinkFormats;
307 for(
auto iter = mNodeListGateways.begin(); iter!=mNodeListGateways.end(); iter++)
309 for(
auto it = iter->second.begin(); it!=iter->second.end(); it++)
312 am_RoutingNodeData_s & gatewayNodeData = gatewayNode->
getData();
313 am_Gateway_s * gateway = gatewayNodeData.
data.
gateway;
315 if(!mOnlyFreeConversionNodes || !isComponentConnected(*gateway))
321 am_RoutingNodeData_s & gatewaySinkData = gatewaySinkNode->getData();
323 sourceFormats.clear();
328 if(gatewaySourceNode)
341 void CAmRouter::constructConverterConnections()
343 std::vector<am_CustomConnectionFormat_t> sourceFormats, sinkFormats;
345 for(
auto iter = mNodeListConverters.begin(); iter!=mNodeListConverters.end(); iter++)
347 for(
auto it = iter->second.begin(); it!=iter->second.end(); it++)
350 am_RoutingNodeData_s & converterNodeData = converterNode->
getData();
351 am_Converter_s * converter = converterNodeData.
data.
converter;
353 if(!mOnlyFreeConversionNodes || !isComponentConnected(*converter))
357 if(converterSinkNode)
359 am_RoutingNodeData_s & converterSinkData = converterSinkNode->getData();
361 sourceFormats.clear();
366 if(converterSourceNode)
382 am_RoutingNodeData_s & srcNodeData = ((
CAmRoutingNode*)&node)->getData();
383 std::vector<am_CustomConnectionFormat_t> intersection;
384 am_Source_s * source = srcNodeData.data.source;
385 std::vector<CAmRoutingNode*> & sinks = mNodeListSinks[source->domainID];
386 for(
auto itSink = sinks.begin(); itSink!=sinks.end(); itSink++)
389 am_RoutingNodeData_s & sinkNodeData = sinkNode->getData();
390 am_Sink_s * sink = sinkNodeData.
data.
sink;
392 intersection.clear();
395 if(intersection.size()>0)
404 am_RoutingNodeData_s & sinkNodeData = ((
CAmRoutingNode*)&node)->getData();
405 std::vector<am_CustomConnectionFormat_t> intersection;
406 am_Sink_s * sink = sinkNodeData.data.sink;
411 std::vector<am_CustomConnectionFormat_t> sourceFormats, sinkFormats;
412 am_RoutingNodeData_s & converterData = converterNode->getData();
413 am_Converter_s * converter = converterData.data.converter;
414 if(!mOnlyFreeConversionNodes || !isComponentConnected(*converter))
417 list.emplace_back(converterNode,
CF_UNKNOWN, 1);
422 std::vector<am_CustomConnectionFormat_t> sourceFormats, sinkFormats;
426 std::vector<am_CustomConnectionFormat_t> sourceFormats, sinkFormats;
427 am_RoutingNodeData_s & gatewayData = gatewayNode->getData();
428 am_Gateway_s * gateway = gatewayData.data.gateway;
429 if(!mOnlyFreeConversionNodes || !isComponentConnected(*gateway))
432 list.emplace_back(gatewayNode,
CF_UNKNOWN, 1);
441 std::vector<am_CustomConnectionFormat_t> sourceFormats, sinkFormats;
442 am_RoutingNodeData_s & converterNodeData = ((
CAmRoutingNode*)&node)->getData();
443 am_Converter_s * converter = converterNodeData.data.converter;
448 if(converterSourceNode)
450 list.emplace_back(converterSourceNode,
CF_UNKNOWN, 1);
457 am_RoutingNodeData_s & gatewayNodeData = ((
CAmRoutingNode*)&node)->getData();
458 std::vector<am_CustomConnectionFormat_t> sourceFormats, sinkFormats;
459 am_Gateway_s * gateway = gatewayNodeData.data.gateway;
463 if(gatewaySourceNode)
466 list.emplace_back(gatewaySourceNode,
CF_UNKNOWN, 1);
471 void CAmRouter::getVerticesForNode(
476 am_RoutingNodeData_s & nodeData = ((
CAmRoutingNode*)&node)->getData();
477 if(nodeData.type==CAmNodeDataType::SOURCE)
479 getVerticesForSource(node, list);
481 else if(nodeData.type==CAmNodeDataType::SINK)
483 getVerticesForSink(node, list);
485 else if(nodeData.type==CAmNodeDataType::CONVERTER)
487 getVerticesForConverter(node, list);
489 else if(nodeData.type==CAmNodeDataType::GATEWAY)
491 getVerticesForGateway(node, list);
497 am_Error_e CAmRouter::determineConnectionFormatsForPath(am_Route_s & routeObjects, std::vector<CAmRoutingNode*> & nodes)
499 std::vector<am_RoutingElement_s>::iterator routingElementIterator = routeObjects.route.begin();
500 std::vector<CAmRoutingNode*>::iterator nodeIterator = nodes.begin();
501 if( routingElementIterator!= routeObjects.route.end() && nodeIterator!=nodes.end() )
502 return doConnectionFormatsForPath(routeObjects, nodes, routingElementIterator, nodeIterator);
506 am_Error_e CAmRouter::doConnectionFormatsForPath(am_Route_s & routeObjects,
507 std::vector<CAmRoutingNode*> & nodes,
508 std::vector<am_RoutingElement_s>::iterator routingElementIterator,
509 std::vector<CAmRoutingNode*>::iterator nodeIterator)
512 std::vector<am_CustomConnectionFormat_t> listConnectionFormats;
513 std::vector<am_CustomConnectionFormat_t> listMergeConnectionFormats;
515 std::vector<CAmRoutingNode*>::iterator currentNodeIterator = nodeIterator;
516 std::vector<am_RoutingElement_s>::iterator currentRoutingElementIterator = routingElementIterator;
518 if (currentRoutingElementIterator!=routeObjects.route.begin())
520 std::vector<am_CustomConnectionFormat_t> listConnectionFormats;
521 std::vector<am_RoutingElement_s>::iterator tempIterator = (currentRoutingElementIterator-1);
525 if(currentNode->getData().type==CAmNodeDataType::GATEWAY)
527 am_Gateway_s *gateway = currentNode->getData().data.gateway;
530 else if(currentNode->getData().type==CAmNodeDataType::CONVERTER)
532 am_Converter_s *converter = currentNode->getData().data.converter;
535 currentNodeIterator+=3;
540 assert(currentNode->getData().type==CAmNodeDataType::SOURCE);
542 currentNodeIterator++;
543 assert(currentNodeIterator!=nodes.end());
546 assert(nodeSink->getData().type==CAmNodeDataType::SINK);
549 am_Sink_s *sink = nodeSink->getData().data.sink;
551 currentNodeIterator+=1;
555 std::vector<am_CustomConnectionFormat_t> listPriorityConnectionFormats;
556 mpControlSender->
getConnectionFormatChoice(currentRoutingElementIterator->sourceID, currentRoutingElementIterator->sinkID, routeObjects,
557 listMergeConnectionFormats, listPriorityConnectionFormats);
560 std::vector<am_CustomConnectionFormat_t>::iterator connectionFormatIterator = listPriorityConnectionFormats.begin();
562 std::vector<am_RoutingElement_s>::iterator nextIterator = currentRoutingElementIterator + 1;
563 if (nextIterator == routeObjects.route.end())
565 if (!listPriorityConnectionFormats.empty())
567 currentRoutingElementIterator->connectionFormat = listPriorityConnectionFormats.front();
574 for (; connectionFormatIterator != listPriorityConnectionFormats.end(); ++connectionFormatIterator)
576 currentRoutingElementIterator->connectionFormat = *connectionFormatIterator;
577 if ((returnError = doConnectionFormatsForPath(routeObjects, nodes, nextIterator, currentNodeIterator)) ==
E_OK)
582 return (returnError);
585 #ifdef ROUTING_BUILD_CONNECTIONS
589 std::vector<CAmRoutingNode*> & resultPath)
595 am_Route_s & resultPath, std::vector<CAmRoutingNode*> & resultNodesPath)
597 am_RoutingElement_s * element;
598 am_RoutingNodeData_s & sinkNodeData = aSink.getData();
599 am_RoutingNodeData_s & sourceNodeData = aSource.getData();
600 resultPath.sinkID = sinkNodeData.data.sink->sinkID;
601 resultPath.sourceID = sourceNodeData.data.source->sourceID;
605 resultNodesPath.insert(resultNodesPath.begin(), (
CAmRoutingNode*)&
object);
606 am_RoutingNodeData_s & routingData =
object.getData();
607 if(routingData.type==CAmNodeDataType::SINK)
609 auto iter = resultPath.route.emplace(resultPath.route.begin());
611 element->domainID = routingData.data.sink->domainID;
612 element->sinkID = routingData.data.sink->sinkID;
615 else if(routingData.type==CAmNodeDataType::SOURCE)
617 element->domainID = routingData.data.source->domainID;
618 element->sourceID = routingData.data.source->sourceID;
629 std::vector<am_Route_s> & resultPath,
630 std::vector<std::vector<CAmRoutingNode*>> & resultNodesPath,
631 const bool includeCycles)
633 #ifndef ROUTING_BUILD_CONNECTIONS
636 bool cycles = includeCycles;
638 if(((
CAmRoutingNode*)&aSource)->getData().type!=CAmNodeDataType::SOURCE ||
642 uint8_t errorsCount = 0, successCount = 0;
643 generateAllPaths(aSource, aSink, cycles, [&](
const std::vector<CAmRoutingNode*> & path) {
644 resultNodesPath.push_back(path);
645 resultPath.emplace_back();
650 for(
auto it = path.begin(); it!=path.end(); it++)
653 if(routingData.
type==CAmNodeDataType::SOURCE)
655 auto iter = nextRoute.
route.emplace(nextRoute.
route.end());
661 else if(routingData.
type==CAmNodeDataType::SINK)
669 am_Error_e err = determineConnectionFormatsForPath(nextRoute, (std::vector<CAmRoutingNode*> &)path);
673 auto last = resultPath.end()-1;
674 resultPath.erase(last);
676 std::cout<<
"Error by determining connection formats for path from source:"<<nextRoute.
sourceID<<
" to sink:"<<nextRoute.
sinkID<<
"\n";
682 std::cout<<
"\nSuccessfully determined connection formats for path from source:"<<nextRoute.
sourceID<<
" to sink:"<<nextRoute.
sinkID<<
"\n";
683 for(
auto it = nextRoute.
route.begin(); it!=nextRoute.
route.end(); it++)
710 if(visitedDomains.size())
712 if(visitedDomains.back()==nodeDomainID)
715 for(
auto it=visitedDomains.begin();it!=visitedDomains.end()-1; it++)
717 if(nodeDomainID==*it)
726 const bool includeCycles,
727 std::function<
void(
const std::vector<CAmRoutingNode*> & path)> cb)
731 std::vector<CAmRoutingNode*> visited;
732 std::vector<am_domainID_t> visitedDomains;
734 visitedDomains.push_back(((
CAmRoutingNode*)&src)->getData().domainID());
736 goThroughAllPaths(dst, visited, visitedDomains, cb);
743 std::vector<CAmRoutingNode*> & visited,
744 std::vector<am_domainID_t> & visitedDomains,
745 std::function<
void(
const std::vector<CAmRoutingNode*> & path)> cb)
747 #ifndef ROUTING_BUILD_CONNECTIONS
749 getVerticesForNode(*visited.back(), vertices);
754 CAmRoutingListVertices::const_iterator vItr(nodes->begin());
755 for (; vItr != nodes->end(); ++vItr)
758 if(vertex.getNode()->getStatus()!=GES_NOT_VISITED || !
shouldGoInDomain(visitedDomains, vertex.getNode()->getData().domainID()))
760 if (vertex.getNode()==&dst)
763 visited.push_back(vertex.getNode());
764 visitedDomains.push_back(vertex.getNode()->getData().domainID());
768 auto last = visited.end()-1;
770 visitedDomains.erase(visitedDomains.end()-1);
771 vertex.getNode()->setStatus(GES_NOT_VISITED);
775 vItr = nodes->begin();
777 for (; vItr != nodes->end(); ++vItr)
780 if(vertex.getNode()->getStatus()!=GES_NOT_VISITED
781 ||vertex.getNode()==&dst ||
785 visited.push_back(vertex.getNode());
786 visitedDomains.push_back(vertex.getNode()->getData().domainID());
787 goThroughAllPaths(dst, visited, visitedDomains, cb);
789 auto last = visited.end()-1;
791 visitedDomains.erase(visitedDomains.end()-1);
792 vertex.getNode()->setStatus(GES_NOT_VISITED);
797 const std::vector<am_CustomConnectionFormat_t> & listSourceFormats,
798 const std::vector<am_CustomConnectionFormat_t> & listSinkFormats,
799 std::vector<am_CustomConnectionFormat_t> & sourceFormats,
800 std::vector<am_CustomConnectionFormat_t> & sinkFormats)
802 const size_t sizeSourceFormats = listSourceFormats.size();
803 const size_t sizeSinkFormats = listSinkFormats.size();
804 const size_t sizeConvertionMatrix = convertionMatrix.size();
806 if(sizeSourceFormats==0||sizeSinkFormats==0||sizeConvertionMatrix==0||sizeConvertionMatrix!=sizeSinkFormats*sizeSourceFormats)
811 std::vector<bool>::const_iterator iterator = convertionMatrix.begin();
812 for (; iterator != convertionMatrix.end(); ++iterator)
814 if(
true == *iterator )
816 const size_t index = iterator-convertionMatrix.begin();
817 size_t idx = index%sizeSourceFormats;
818 sourceFormats.push_back(listSourceFormats.at(idx));
819 idx = index/sizeSourceFormats;
820 sinkFormats.push_back(listSinkFormats.at(idx));
823 return sourceFormats.size()>0;
827 std::vector<am_CustomConnectionFormat_t> & inListSinkFormats,
828 std::vector<am_CustomConnectionFormat_t> & outListFormats)
830 std::sort(inListSourceFormats.begin(), inListSourceFormats.end());
831 std::sort(inListSinkFormats.begin(), inListSinkFormats.end());
832 std::insert_iterator<std::vector<am_CustomConnectionFormat_t> > inserter(outListFormats, outListFormats.begin());
833 set_intersection(inListSourceFormats.begin(), inListSourceFormats.end(), inListSinkFormats.begin(), inListSinkFormats.end(), inserter);
838 const std::vector<am_CustomConnectionFormat_t> & listSourceFormats,
839 const std::vector<am_CustomConnectionFormat_t> & listSinkFormats,
841 std::vector<am_CustomConnectionFormat_t> & listFormats)
844 std::vector<am_CustomConnectionFormat_t>::const_iterator rowSinkIterator = listSinkFormats.begin();
845 std::vector<bool>::const_iterator matrixIterator = convertionMatrix.begin();
848 rowSinkIterator = find(listSinkFormats.begin(), listSinkFormats.end(), connectionFormat);
849 int rowNumberSink = rowSinkIterator - listSinkFormats.begin();
852 std::advance(matrixIterator, rowNumberSink);
859 listFormats.push_back(listSourceFormats.at((matrixIterator - convertionMatrix.begin()) / listSinkFormats.size()));
861 std::advance(matrixIterator, listSinkFormats.size());
862 }
while (convertionMatrix.end() - matrixIterator > 0);
864 return listFormats.size();
869 std::vector<CAmRoutingNode*>::iterator iteratorSink,
870 std::vector<am_CustomConnectionFormat_t> & outConnectionFormats)
873 assert(nodeSink->
getData().
type==CAmNodeDataType::SINK);
876 assert(nodeSource->getData().type==CAmNodeDataType::SOURCE);
878 am_Source_s *source = nodeSource->getData().data.source;
CAmRoutingNode * converterNodeWithSinkID(const am_sinkID_t sinkID, const am_domainID_t domainID)
Returns a converter node for given sinkID.
CAmRoutingNode * sourceNodeWithID(const am_sourceID_t sourceID)
Returns a source node with given sourceID.
virtual am_Error_e enumerateSources(std::function< void(const am_Source_s &element)> cb) const =0
am_sourceID_t sourceID
the source ID
am_Error_e
the errors of the audiomanager.
void getShortestPath(const CAmNode< T > &source, const CAmListNodePtrs &listTargets, std::vector< CAmListNodePtrs > &resultPath)
Finds the shortest path from given node to all nodes in listTargets.
void connectNodes(const CAmNode< T > &first, const CAmNode< T > &last, const V &vertexData, const int16_t weight=1)
Connect first with last node and set user data and weight to the vertex.
This struct describes the attribiutes of a sink.
NodeData & getData()
Setters and getters.
am_CustomConnectionFormat_t connectionFormat
the connectionformat that is used for the route
am_sinkID_t sinkID
This is the ID of the sink, it is unique in the system.
CAmNode< T > & addNode(const T &in)
Adds a new node to the graph with given user data.
am_domainID_t controlDomainID
This is the ID of the domain that registers the gateway.
am_NodeDataType_e type
data type:sink, source, gateway or converter
uint16_t am_CustomConnectionFormat_t
This type classifies the format in which data is exchanged within a connection.
am_sourceID_t sourceID
the sourceID where the route starts
union am::am_RoutingNodeData_s::@0 data
union pointer to sink, source, gateway or converter
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)
am_Error_e getAllPaths(CAmRoutingNode &aSource, CAmRoutingNode &aSink, std::vector< am_Route_s > &resultPath, std::vector< std::vector< CAmRoutingNode * >> &resultNodesPath, const bool includeCycles=false)
A_CONST am_CustomConnectionFormat_t CF_UNKNOWN
SPDX license identifier: MPL-2.0.
virtual am_Error_e enumerateConverters(std::function< void(const am_Converter_s &element)> cb) const =0
GRAPH_PATH_END am_GraphPathPosition_e
am_sinkID_t sinkID
the sinkID
am_Error_e getConnectionFormatChoice(const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_Route_s listRoute, const std::vector< am_CustomConnectionFormat_t > listPossibleConnectionFormats, std::vector< am_CustomConnectionFormat_t > &listPrioConnectionFormats)
SPDX license identifier: MPL-2.0.
virtual am_Error_e getSinkInfoDB(const am_sinkID_t sinkID, am_Sink_s &sinkData) const =0
CAmRoutingNode * sinkNodeWithID(const am_sinkID_t sinkID)
Returns a sink node with given sinkID.
static void listPossibleConnectionFormats(std::vector< am_CustomConnectionFormat_t > &inListSourceFormats, std::vector< am_CustomConnectionFormat_t > &inListSinkFormats, std::vector< am_CustomConnectionFormat_t > &outListFormats)
This represents one "hopp" in a route.
SPDX license identifier: MPL-2.0.
am_domainID_t domainID
The domainID is the domain the source belongs to.
uint16_t am_sourceID_t
a source ID
CAmRouter(IAmDatabaseHandler *iDatabaseHandler, CAmControlSender *iSender)
sends data to the commandInterface, takes the file of the library that needs to be loaded ...
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)
void trace(std::function< void(const CAmNode< T > &, const std::vector< CAmVertex< T, V > * > &)> cb)
Goes through all nodes and vertices and calls the callback.
void getMergeConnectionFormats(const X *element, const am_CustomConnectionFormat_t connectionFormat, const std::vector< am_CustomConnectionFormat_t > &listConnectionFormats, std::vector< am_CustomConnectionFormat_t > &outListMergeConnectionFormats)
This class handles and abstracts the database.
This struct describes the attributes of a converter.
CAmNode< am_RoutingNodeData_s > CAmRoutingNode
std::vector< am_RoutingElement_s > route
the actual route as list of routing elements
a list of routing elements that lead from source to sink
virtual am_Error_e enumerateSinks(std::function< void(const am_Sink_s &element)> cb) const =0
am_sourceID_t sourceID
This is the ID of the source, it is unique in the system.
the desired action is not possible
am_Converter_s * converter
std::list< CAmRoutingVertex > CAmRoutingListVertices
virtual am_Error_e enumerateGateways(std::function< void(const am_Gateway_s &element)> cb) const =0
am_domainID_t domainID
This is the ID of the domain that registers the converter.
void clear()
Clears all nodes and vertices.
This struct describes the attributes of a gateway.
am_sinkID_t sinkID
the sinkID where the route ends
CAmRoutingNode * gatewayNodeWithSinkID(const am_sinkID_t sinkID)
Returns a gateway node for given sinkID.
uint16_t getIndex() const
uint16_t am_domainID_t
a domain ID
no error - positive reply
SPDX license identifier: MPL-2.0.
void getAllPaths(const CAmNode< T > &src, const CAmNode< T > &dst, std::function< void(const CAmNodeReferenceList &path)> cb)
Finds all possible paths between two given nodes.
void getShortestPath(const CAmRoutingNode &source, const CAmRoutingNode &destination, std::vector< CAmRoutingNode * > &resultPath)
std::vector< am_CustomConnectionFormat_t > listConnectionFormats
This list holds information about the formats that the Source is capable of supporting when deliverin...
This struct describes the attribiutes of a source.
virtual am_Error_e getSourceInfoDB(const am_sourceID_t sourceID, am_Source_s &sourceData) const =0
uint16_t am_sinkID_t
a sink ID
const CAmVertexReferenceList & getVertexList() const
CAmVertex< am_RoutingNodeData_s, uint16_t > CAmRoutingVertex
am_domainID_t domainID
The domainID is the domain the sink belongs to.
am_domainID_t domainID
the domainID the routeElement is in
static void getSourceSinkPossibleConnectionFormats(std::vector< CAmRoutingNode * >::iterator iteratorSource, std::vector< CAmRoutingNode * >::iterator iteratorSink, std::vector< am_CustomConnectionFormat_t > &outConnectionFormats)
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.
static bool shouldGoInDomain(const std::vector< am_domainID_t > &visitedDomains, const am_domainID_t nodeDomainID)
std::vector< am_CustomConnectionFormat_t > listConnectionFormats
This list holds information about the formats that the Source is capable of supporting when deliverin...
void load(const bool onlyFree)
A structure used as user data in the graph nodes.