#include <qgarlib/GenNode.H>
A node includes:
See class qgar::GenEdge for edges.
Definition at line 85 of file GenNode.H.
Public Types | |
Types | |
| typedef TEDGE | edge_type |
| Type of the data stored in an edge. | |
| typedef edge_type & | edge_type_reference |
| Reference to qgar::GenEdge::edge_type. | |
| typedef const edge_type & | edge_type_const_reference |
| Constant reference to qgar::GenEdge::edge_type. | |
| typedef edge_type * | edge_type_pointer |
| Pointer to qgar::GenEdge::edge_type. | |
| typedef const edge_type * | edge_type_const_pointer |
| Constant pointer to qgar::GenEdge::edge_type. | |
| typedef TNODE | node_type |
| Type of the data stored in a node. | |
| typedef node_type & | node_type_reference |
| Reference to qgar::GenEdge::node_type. | |
| typedef const node_type & | node_type_const_reference |
| Constant reference to qgar::GenEdge::node_type. | |
| typedef node_type * | node_type_pointer |
| Pointer to qgar::GenEdge::node_type. | |
| typedef const node_type * | node_type_const_pointer |
| Constant pointer to qgar::GenEdge::node_type. | |
Public Member Functions | |
Constructors | |
| GenNode (short int aFlag=0) | |
| Default constructor. | |
| GenNode (node_type_const_reference aData, short int aFlag=0) | |
| Initialize with data. | |
| GenNode (GenEdge< node_type, edge_type > *const aPEdge, node_type_const_reference aData, short int aFlag=0) | |
| Initialize with a pointer to an edge, and data. | |
| GenNode (GenEdge< node_type, edge_type > *const aPEdge1, GenEdge< node_type, edge_type > *const aPEdge2, node_type_const_reference aData, short int aFlag=0) | |
| Initialize with two pointers to an edge, and data. | |
| GenNode (GenEdge< node_type, edge_type > *const aPEdge1, GenEdge< node_type, edge_type > *const aPEdge2, GenEdge< node_type, edge_type > *const aPEdge3, node_type_const_reference aData, short int aFlag=0) | |
| Initialize with three pointers to an edge, and data. | |
| GenNode (const GenNode< node_type, edge_type > &aNode) | |
| Copy constructor. | |
Destructor | |
| ~GenNode () | |
| Non-virtual destructor. | |
Node characteristics | |
| int | degree () const |
| Get node degree (number of edges adjacent to the node). | |
Node data | |
| node_type_const_reference | accessData () const |
| Get node data. | |
| node_type | data () const |
| Get a copy of the node data. | |
| void | setData (node_type_const_reference aData) |
| Set node data. | |
| short int | flag () const |
| Get node flag. | |
| void | setFlag (short int aFlag) |
| Set node flag. | |
Access to edges | |
| const std::list< GenEdge< node_type, edge_type > * > & | accessEdges () const |
| Get (a constant reference to) the edges list. | |
| std::list< GenEdge< node_type, edge_type > * > & | getEdges () |
| Get the edges list. | |
| std::list< GenEdge< node_type, edge_type > * > | edges () const |
| Get a copy of the edges list. | |
Edge insertion | |
| GenEdge< node_type, edge_type > * | addEdge (GenEdge< node_type, edge_type > *const aPEdge) |
| Add a created edge from given data and flag, and return a pointer to it.Add (a pointer to) an edge at the end of the edges list of the node. | |
| GenEdge< node_type, edge_type > * | addEdgeFront (GenEdge< node_type, edge_type > *const aPEdge) |
| Add (a pointer to) an edge at the beginning of the edges list of the node. | |
Edge removal | |
Warning: The client is in charge of the deletion of the removed elements. Removals invalidate iterators pointing to removed elements. | |
| GenEdge< node_type, edge_type > * | removeEdge (typename std::list< GenEdge< node_type, edge_type > * >::iterator aPos) |
| Remove the edge at given position in the edges list, and return it. | |
| GenEdge< node_type, edge_type > * | removeEdge (GenEdge< node_type, edge_type > *const aPEdge) |
| Remove the first pointer to an edge that compares equal to the given pointer in the edges list. | |
Operators | |
| GenNode< node_type, edge_type > & | operator= (const GenNode< node_type, edge_type > &aNode) |
| Assignment. | |
| bool | operator== (const GenNode< node_type, edge_type > &aNode) |
| Equality. | |
| bool | operator!= (const GenNode< node_type, edge_type > &aNode) |
| Inequality. | |
Protected Attributes | |
Representation of a node | |
| node_type | _data |
| Data contained in the node. | |
| short int | _flag |
| Flag at client's disposal (default 0). | |
| std::list< GenEdge< node_type, edge_type > * > | _edges |
| List of (pointers to) edges adjacent to the node. | |
|
|||||
|
Type of the data stored in an edge.
|
|
|||||
|
Constant pointer to qgar::GenEdge::edge_type.
|
|
|||||
|
Constant reference to qgar::GenEdge::edge_type.
|
|
|||||
|
Pointer to qgar::GenEdge::edge_type.
|
|
|||||
|
Reference to qgar::GenEdge::edge_type.
|
|
|||||
|
Type of the data stored in a node.
|
|
|||||
|
Constant pointer to qgar::GenEdge::node_type.
|
|
|||||
|
Constant reference to qgar::GenEdge::node_type.
|
|
|||||
|
Pointer to qgar::GenEdge::node_type.
|
|
|||||
|
Reference to qgar::GenEdge::node_type.
|
|
||||||||||
|
Default constructor. The edges list of the node is empty.
Definition at line 51 of file GenNode.TCC. |
|
||||||||||||||||
|
Initialize with data. The edges list of the node is empty.
|
|
||||||||||||||||||||
|
Initialize with a pointer to an edge, and data. The pointer to the edge is inserted in the edges list of the node.
|
|
||||||||||||||||||||||||
|
Initialize with two pointers to an edge, and data. The pointers to edges are inserted in the edges list of the node.
|
|
||||||||||||||||||||||||||||
|
Initialize with three pointers to an edge, and data. The pointers to edges are inserted in the edges list of the node.
|
|
||||||||||
|
Copy constructor.
|
|
|||||||||
|
Non-virtual destructor.
Definition at line 155 of file GenNode.TCC. |
|
|||||||||
|
Get node data.
Definition at line 189 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_data. |
|
|||||||||
|
Get (a constant reference to) the edges list.
Definition at line 244 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges. |
|
||||||||||
|
Add a created edge from given data and flag, and return a pointer to it.Add (a pointer to) an edge at the end of the edges list of the node. Iterators to the edges list are not invalidated.
Definition at line 279 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges. |
|
||||||||||
|
Add (a pointer to) an edge at the beginning of the edges list of the node. Iterators to the edges list are not invalidated.
Definition at line 295 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges. |
|
|||||||||
|
Get a copy of the node data.
Definition at line 199 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_data. |
|
|||||||||
|
Get node degree (number of edges adjacent to the node).
Definition at line 174 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges. |
|
|||||||||
|
Get a copy of the edges list.
Definition at line 264 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges. |
|
|||||||||
|
Get node flag.
Definition at line 219 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_flag. |
|
|||||||||
|
Get the edges list.
Definition at line 254 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges. |
|
||||||||||
|
Inequality. Tests if the data of the current node do not compare equal to the data of given node aNode, using operator != applying to objects of type TNODE, The values of the flags are not taken into account.
|
|
||||||||||
|
Assignment.
|
|
||||||||||
|
Equality. Tests if the data of the current node compare equal to the data of given node aNode, using operator <b>== applying to objects of type TNODE, The values of the flags are not taken into account.
|
|
||||||||||
|
Remove the first pointer to an edge that compares equal to the given pointer in the edges list. The function return the given pointer if the removal is performed, 0 otherwise.
Definition at line 329 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges, and qgar::GenNode< TNODE, TEDGE >::removeEdge(). |
|
||||||||||
|
Remove the edge at given position in the edges list, and return it. No effect when aPos points to the end of the list.
Definition at line 315 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_edges. Referenced by qgar::GenNode< TNODE, TEDGE >::removeEdge(). |
|
||||||||||
|
Set node data.
|
|
||||||||||
|
Set node flag.
Definition at line 229 of file GenNode.TCC. References qgar::GenNode< TNODE, TEDGE >::_flag. |
|
|||||
|
Data contained in the node.
Definition at line 464 of file GenNode.H. Referenced by qgar::GenNode< TNODE, TEDGE >::accessData(), and qgar::GenNode< TNODE, TEDGE >::data(). |
|
|||||
|
List of (pointers to) edges adjacent to the node.
Definition at line 474 of file GenNode.H. Referenced by qgar::GenNode< TNODE, TEDGE >::accessEdges(), qgar::GenNode< TNODE, TEDGE >::addEdge(), qgar::GenNode< TNODE, TEDGE >::addEdgeFront(), qgar::GenNode< TNODE, TEDGE >::degree(), qgar::GenNode< TNODE, TEDGE >::edges(), qgar::GenNode< TNODE, TEDGE >::getEdges(), and qgar::GenNode< TNODE, TEDGE >::removeEdge(). |
|
|||||
|
Flag at client's disposal (default 0).
Definition at line 469 of file GenNode.H. Referenced by qgar::GenNode< TNODE, TEDGE >::flag(), and qgar::GenNode< TNODE, TEDGE >::setFlag(). |