PhoenixGraph  01.0.0
Set of tools to simplify graph manipulation
Loading...
Searching...
No Matches
Node.h
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7#ifndef __NODE_H__
8#define __NODE_H__
9
10#include "list_index_utils.h"
11
13
16template<typename T, typename UIdx>
17class Node{
18 public:
19 Node(const std::string & name = "");
20 Node(const T & data, const std::string & name = "");
21 Node(const Node<T, UIdx> & other);
22 virtual ~Node();
23 Node & operator = (const Node<T, UIdx> & other);
24
25 void addChild(UIdx child);
26 void addParent(UIdx parent);
27
28 void removeChild(UIdx child);
29 void removeParent(UIdx parent);
30
31 void setListChild(const std::list<UIdx> & listChild);
32 void setListParent(const std::list<UIdx> & listParent);
33 void setIndex(UIdx index);
34 void setName(const std::string & name);
35 void setIsUpdated(bool isUpdated);
36 void setData(const T & data);
37
38 const std::list<UIdx> & getListChild() const;
39 std::list<UIdx> & getListChild();
40 const std::list<UIdx> & getListParent() const;
41 std::list<UIdx> & getListParent();
42 UIdx getIndex() const;
43 const std::string & getName() const;
44 std::string & getName();
45 bool getIsUpdated() const;
46 bool & getIsUpdated();
47 const T & getData() const;
48 T & getData();
49
50 bool isStart() const;
51 bool isEnd() const;
52
53 std::string getDotName() const;
54 std::string getDotDefinition() const;
55
56 protected:
57 void copyNode(const Node<T, UIdx> & other);
58
59 private:
60 void initialisationNode();
61
63 std::list<UIdx> p_listChild;
65 std::list<UIdx> p_listParent;
67 UIdx p_index;
69 std::string p_name;
74};
75
76#include "Node_impl.h"
77
78
79#endif
80
void setName(const std::string &name)
Set the name of the Node.
Definition Node_impl.h:134
const std::list< UIdx > & getListParent() const
Get the list of parents of the Node.
Definition Node_impl.h:164
const T & getData() const
Get the data of the Node.
Definition Node_impl.h:206
void setIsUpdated(bool isUpdated)
Say if the node is updated.
Definition Node_impl.h:140
std::string getDotName() const
Get the dot name of the current Node.
Definition Node_impl.h:230
std::string p_name
Name of the current Node.
Definition Node.h:69
void setData(const T &data)
Set the data of the Node.
Definition Node_impl.h:146
std::list< UIdx > p_listParent
List of parent Node.
Definition Node.h:65
void setListChild(const std::list< UIdx > &listChild)
Set the list of children of the Node.
Definition Node_impl.h:116
std::string getDotDefinition() const
Get the dot definition name of the current Node.
Definition Node_impl.h:241
Node & operator=(const Node< T, UIdx > &other)
Definition of equal operator of Node.
Definition Node_impl.h:75
void removeParent(UIdx parent)
Remove connection with parent.
Definition Node_impl.h:108
void addChild(UIdx child)
Add a child to the current Node.
Definition Node_impl.h:84
Node(const std::string &name="")
Default constructor of Node.
Definition Node_impl.h:41
const std::list< UIdx > & getListChild() const
Get the list of children of the Node.
Definition Node_impl.h:152
UIdx getIndex() const
Get the index of the Node.
Definition Node_impl.h:176
void setIndex(UIdx index)
Set the index of the Node.
Definition Node_impl.h:128
void addParent(UIdx parent)
Add a parent to the current Node.
Definition Node_impl.h:92
virtual ~Node()
Destructor of Node.
Definition Node_impl.h:66
void copyNode(const Node< T, UIdx > &other)
Copy function of Node.
Definition Node_impl.h:263
void setListParent(const std::list< UIdx > &listParent)
Set the list of parents of the Node.
Definition Node_impl.h:122
bool p_isUpdated
Check if the current Node has been already updated.
Definition Node.h:71
bool isEnd() const
Say if the current Node has no child.
Definition Node_impl.h:224
void initialisationNode()
Initialisation function of the class Node.
Definition Node_impl.h:274
bool getIsUpdated() const
Say if the node is updated.
Definition Node_impl.h:194
const std::string & getName() const
Get the name of the Node.
Definition Node_impl.h:182
std::list< UIdx > p_listChild
List of children Node.
Definition Node.h:63
void removeChild(UIdx child)
Remove connection with child.
Definition Node_impl.h:100
T p_data
Data of the node.
Definition Node.h:73
bool isStart() const
Say if the current Node has no parent.
Definition Node_impl.h:218
UIdx p_index
Index of the current Node.
Definition Node.h:67