AudioManager
7.5.11
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 (const CAmNode< T > &src, const CAmNode< T > &dst, std::function< void(const CAmNodeReferenceList &path)> cb) |
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 118 of file CAmGraph.h.
|
inlineexplicit |
Definition at line 306 of file CAmGraph.h.
|
inline |
Definition at line 318 of file CAmGraph.h.
|
inline |
Definition at line 319 of file CAmGraph.h.
|
inline |
Adds a new node to the graph with given user data.
Definition at line 375 of file CAmGraph.h.
|
inline |
Clears all nodes and vertices.
Definition at line 488 of file CAmGraph.h.
|
inline |
Connect first with last node and set user data and weight to the vertex.
Definition at line 446 of file CAmGraph.h.
|
inline |
Returns pointer to a node which data is equal to the given.
Definition at line 335 of file CAmGraph.h.
|
inline |
Returns pointer to a vertex which two ends are equal to the given nodes.
Definition at line 352 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. |
cb | callabck. |
Definition at line 618 of file CAmGraph.h.
|
inline |
Definition at line 321 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 519 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 550 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 569 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 596 of file CAmGraph.h.
|
inline |
Definition at line 326 of file CAmGraph.h.
|
inline |
Definition at line 365 of file CAmGraph.h.
|
inline |
Exists any vertex with two given ends.
Definition at line 457 of file CAmGraph.h.
|
inline |
Removes all vertices to given node .
Definition at line 401 of file CAmGraph.h.
|
inline |
Removes a node with given user data .
Definition at line 419 of file CAmGraph.h.
|
inline |
Removes the given node from the graph .
Definition at line 429 of file CAmGraph.h.
|
inline |
Removes a vertex with two ends equal to the given nodes .
Definition at line 388 of file CAmGraph.h.
|
inline |
Sets the status of all nodes and vertices to GES_NOT_VISITED.
Definition at line 465 of file CAmGraph.h.
|
inline |
Goes through all nodes and vertices and calls the callback.
Definition at line 500 of file CAmGraph.h.