![]() |
fpmas 1.6
|
#include <graph.h>
Public Member Functions | |
Graph () | |
Graph (const Graph< NodeType, EdgeType > &)=delete | |
Graph< NodeType, EdgeType > & | operator= (const Graph< NodeType, EdgeType > &)=delete |
Graph (Graph< NodeType, EdgeType > &&graph) | |
Graph< NodeType, EdgeType > & | operator= (Graph< NodeType, EdgeType > &&) |
void | insert (NodeType *) override |
void | insert (EdgeType *) override |
void | erase (NodeType *) override |
void | erase (EdgeType *) override |
void | addCallOnInsertNode (api::utils::Callback< NodeType * > *callback) override |
std::vector< api::utils::Callback< NodeType * > * > | onInsertNodeCallbacks () const override |
void | addCallOnEraseNode (api::utils::Callback< NodeType * > *callback) override |
std::vector< api::utils::Callback< NodeType * > * > | onEraseNodeCallbacks () const override |
void | addCallOnInsertEdge (api::utils::Callback< EdgeType * > *callback) override |
std::vector< api::utils::Callback< EdgeType * > * > | onInsertEdgeCallbacks () const override |
void | addCallOnEraseEdge (api::utils::Callback< EdgeType * > *callback) override |
std::vector< api::utils::Callback< EdgeType * > * > | onEraseEdgeCallbacks () const override |
NodeType * | getNode (NodeIdType) override |
const NodeType * | getNode (NodeIdType) const override |
const NodeMap & | getNodes () const override |
EdgeType * | getEdge (EdgeIdType) override |
const EdgeType * | getEdge (EdgeIdType) const override |
const EdgeMap & | getEdges () const override |
void | clear () override |
virtual void | insert (NodeType *node)=0 |
virtual void | insert (EdgeType *edge)=0 |
virtual void | erase (NodeType *node)=0 |
virtual void | erase (EdgeType *edge)=0 |
virtual void | addCallOnInsertNode (api::utils::Callback< NodeType * > *callback)=0 |
virtual std::vector< api::utils::Callback< NodeType * > * > | onInsertNodeCallbacks () const =0 |
virtual void | addCallOnEraseNode (api::utils::Callback< NodeType * > *callback)=0 |
virtual std::vector< api::utils::Callback< NodeType * > * > | onEraseNodeCallbacks () const =0 |
virtual void | addCallOnInsertEdge (api::utils::Callback< EdgeType * > *callback)=0 |
virtual std::vector< api::utils::Callback< EdgeType * > * > | onInsertEdgeCallbacks () const =0 |
virtual void | addCallOnEraseEdge (api::utils::Callback< EdgeType * > *callback)=0 |
virtual std::vector< api::utils::Callback< EdgeType * > * > | onEraseEdgeCallbacks () const =0 |
virtual NodeType * | getNode (NodeIdType id)=0 |
virtual const NodeType * | getNode (NodeIdType id) const =0 |
virtual const NodeMap & | getNodes () const =0 |
virtual EdgeType * | getEdge (EdgeIdType id)=0 |
virtual const EdgeType * | getEdge (EdgeIdType) const =0 |
virtual const EdgeMap & | getEdges () const =0 |
virtual void | clear ()=0 |
Additional Inherited Members | |
![]() | |
typedef NodeType::IdType | NodeIdType |
typedef EdgeType::IdType | EdgeIdType |
typedef fpmas::api::graph::IdHash< typename NodeType::IdType > | NodeIdHash |
typedef fpmas::api::graph::IdHash< typename EdgeType::IdType > | EdgeIdHash |
typedef std::unordered_map< NodeIdType, NodeType *, NodeIdHash > | NodeMap |
typedef std::unordered_map< EdgeIdType, EdgeType *, EdgeIdHash > | EdgeMap |
api::graph::Graph implementation.
|
inline |
Graph default constructor.
fpmas::graph::Graph< NodeType, EdgeType >::Graph | ( | Graph< NodeType, EdgeType > && | graph | ) |
Graph move constructor.
|
virtual |
Reimplemented from fpmas::api::graph::Graph< NodeType, EdgeType >.
Graph< NodeType, EdgeType > & fpmas::graph::Graph< NodeType, EdgeType >::operator= | ( | Graph< NodeType, EdgeType > && | graph | ) |
Graph move assignment operator.
|
overridevirtual |
Inserts a Node into the graph.
Upon return, the NodeMap returned by getNodes() must contain an entry {node->getId(), node}
.
Callbacks registered using addCallOnInsertNode() are also called after the node has effectively been inserted into the graph.
node | pointer to node to insert in the graph |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
Inserts an Edge into the graph.
Upon return, the EdgeMap returned by getEdges() must contain an entry {edge->getId(), edge}
.
Callbacks registered using addCallOnInsertEdge() are also called after the edge has effectively been inserted into the graph.
edge | pointer to edge to insert in the graph |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
Erases a previously inserted node from the graph.
Upon return, the entry {node->getId(), node}
must not be contained anymore in the NodeMap returned by getNodes().
Moreover, all incoming and outgoing edges, as returned by Node::getIncomingEdges and Node::getOutgoingEdges, should also be erased from the Graph, as specified by the erase(EdgeType*) function.
Callbacks registered using addCallOnEraseNode() are also called after the node has effectively been removed from the graph.
Erasing a node not contained in the Graph produces an unexpected behavior.
node | node to erase from the graph |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
Erases a previously inserted edge from the graph.
Upon return, the entry {edge->getId(), edge}
must not be contained anymore in the NodeMap returned by getEdges().
Callbacks registered using addCallOnEraseEdge() are also called after the edge has effectively been removed from the graph.
Erasing an edge not contained in the Graph produces an unexpected behavior.
edge | edge to erase from the graph |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Adds an insert node callback, called on insert(NodeType*).
callback | insert node callback |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Current insert node callbacks list.
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Adds an erase node callback, called on erase(NodeType*).
callback | insert node callback |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Current erase node callbacks list.
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Adds an insert edge callback, called on insert(EdgeType*).
callback | insert edge callback |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Current insert edge callbacks list.
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Adds an erase edge callback, called on erase(EdgeType*).
callback | erase edge callback |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
inlineoverridevirtual |
Current erase edge callbacks list.
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
Gets the pointer to the node associated to the given id in the Graph.
The returned pointer must correspond to the entry {id, node}
contained in the NodeMap returned by getNodes().
If id does not correspond to a node contained in the graph, behavior is unspecified.
id | node id |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
Gets the pointer to the node associated to the given id in the Graph.
The returned pointer must correspond to the entry {id, node}
contained in the NodeMap returned by getNodes().
If id does not correspond to a node contained in the graph, behavior is unspecified.
id | node id |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
NodeMap representing the nodes contained in this graph.
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
Gets the pointer to the edge associated to the given id in the Graph.
The returned pointer must correspond to the entry {id, edge}
contained in the EdgeMap returned by getEdges().
If id does not correspond to an edge contained in the graph, behavior is unspecified.
id | edge id |
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
/copydoc getEdge(EdgeIdType)
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
EdgeMap representing the edges contained in this graph.
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.
|
overridevirtual |
Erases all nodes and edges contained in the graph.
All erase node and erase edge callbacks must be called properly for each item.
Implements fpmas::api::graph::Graph< NodeType, EdgeType >.