AudioManager
7.6.6
Native Application Runtime Environment
|
Class representing a directed or undirected graph. More...
#include <CAmGraph.h>
Public Member Functions | |
CAmGraph (const std::vector< T > &v) | |
CAmGraph () | |
~CAmGraph () | |
const CAmListNodes & | getNodes () const |
const CAmVertexReferenceList & | getVertexList () const |
const CAmNode< T > * | findNode (const T &in) |
Returns pointer to a node which data is equal to the given. More... | |
const CAmVertex< T, V > * | findVertex (const CAmNode< T > &edge1, const CAmNode< T > &edge2) const |
Returns pointer to a vertex which two ends are equal to the given nodes. More... | |
bool | hasCycles () const |
CAmNode< T > & | addNode (const T &in) |
Adds a new node to the graph with given user data. More... | |
void | removeVertex (const CAmNode< T > &edge1, const CAmNode< T > &edge2) |
Removes a vertex with two ends equal to the given nodes . More... | |
void | removeAllVerticesToNode (const CAmNode< T > &node) |
Removes all vertices to given node . More... | |
void | removeNode (const T &in) |
Removes a node with given user data . More... | |
void | removeNode (const CAmNode< T > &node) |
Removes the given node from the graph . More... | |
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. More... | |
bool | isAnyVertex (const CAmNode< T > &edge1, const CAmNode< T > &edge2) const |
Exists any vertex with two given ends. More... | |
void | reset () |
Sets the status of all nodes and vertices to GES_NOT_VISITED. More... | |
void | clear () |
Clears all nodes and vertices. More... | |
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. More... | |
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. More... | |
void | getShortestPath (const CAmNode< T > &source, const CAmNode< T > &destination, CAmListNodePtrs &resultPath) |
Finds the shortest path between two nodes. More... | |
void | getShortestPath (const CAmNode< T > &source, const CAmListNodePtrs &listTargets, std::function< void(const am_GraphPathPosition_e, CAmNode< T > &)> cb) |
Finds the shortest path from given node to all nodes in listTargets. More... | |
void | getShortestPath (const CAmNode< T > &source, const CAmNode< T > &destination, std::function< void(const am_GraphPathPosition_e, CAmNode< T > &)> cb) |
Finds the shortest path between two given nodes. More... | |
void | getAllPaths (CAmNode< T > &src, CAmNode< T > &dst, std::function< bool(const CAmNode< T > *)> cbShouldVisitNode, std::function< void(const CAmNode< T > *)> cbWillVisitNode, std::function< void(const CAmNode< T > *)> cbDidVisitNode, std::function< void(const CAmNodeReferenceList &path)> cbDidFindPath) |
Finds all possible paths between two given nodes. More... | |
Class representing a directed or undirected graph.
It contains nodes and connections. T, V are types for custom user data.
Definition at line 119 of file CAmGraph.h.
|
inlineexplicit |
Definition at line 341 of file CAmGraph.h.
|
inline |
Definition at line 353 of file CAmGraph.h.
|
inline |
Definition at line 354 of file CAmGraph.h.
|
inline |
Adds a new node to the graph with given user data.
Definition at line 410 of file CAmGraph.h.
|
inline |
Clears all nodes and vertices.
Definition at line 523 of file CAmGraph.h.
|
inline |
Connect first with last node and set user data and weight to the vertex.
Definition at line 481 of file CAmGraph.h.
|
inline |
Returns pointer to a node which data is equal to the given.
Definition at line 370 of file CAmGraph.h.
|
inline |
Returns pointer to a vertex which two ends are equal to the given nodes.
Definition at line 387 of file CAmGraph.h.
|
inline |
Finds all possible paths between two given nodes.
Delegates the construction of the path to the caller.
src | start node. |
dst | destination node. |
cbShouldVisitNode | ask the delegate if we should proceed with the current node. |
cbWillVisitNode | tell the delegate the current node will be visited. |
cbDidVisitNode | tell the delegate the current node was visited. |
cbDidFindPath | return the path to the delegate. |
Definition at line 656 of file CAmGraph.h.
|
inline |
Definition at line 356 of file CAmGraph.h.
|
inline |
Finds the shortest path from given node to all nodes in listTargets.
source | start node. |
listTargets | destination nodes. |
resultPath | list with all shortest paths. |
Definition at line 554 of file CAmGraph.h.
|
inline |
Finds the shortest path between two nodes.
source | start node. |
destination | destination node. |
resultPath | list with the found shortest paths. |
Definition at line 585 of file CAmGraph.h.
|
inline |
Finds the shortest path from given node to all nodes in listTargets.
Delegates the construction of the path to the caller.
source | start node. |
listTargets | destination nodes. |
cb | callabck. |
Definition at line 604 of file CAmGraph.h.
|
inline |
Finds the shortest path between two given nodes.
Delegates the construction of the path to the caller.
source | start node. |
destination | destination node. |
cb | callabck. |
Definition at line 631 of file CAmGraph.h.
|
inline |
Definition at line 361 of file CAmGraph.h.
|
inline |
Definition at line 400 of file CAmGraph.h.
|
inline |
Exists any vertex with two given ends.
Definition at line 492 of file CAmGraph.h.
|
inline |
Removes all vertices to given node .
Definition at line 436 of file CAmGraph.h.
|
inline |
Removes a node with given user data .
Definition at line 454 of file CAmGraph.h.
|
inline |
Removes the given node from the graph .
Definition at line 464 of file CAmGraph.h.
|
inline |
Removes a vertex with two ends equal to the given nodes .
Definition at line 423 of file CAmGraph.h.
|
inline |
Sets the status of all nodes and vertices to GES_NOT_VISITED.
Definition at line 500 of file CAmGraph.h.
|
inline |
Goes through all nodes and vertices and calls the callback.
Definition at line 535 of file CAmGraph.h.