29 #ifndef GUM_INDEXED_TREE_H 30 #define GUM_INDEXED_TREE_H 52 template <
typename Key,
typename Data >
129 void insertNode(
const std::vector< Key >& index,
const Data* data);
140 void insertNode(
const std::vector< Key >& index,
const Data& data);
149 void setNode(
const std::vector< Key >& index, Data* data);
158 void setNode(
const std::vector< Key >& index,
const Data& data);
168 Data&
getData(
const std::vector< Key >& index)
const;
196 template <
typename Key,
typename Data >
197 std::ostream& operator<<(std::ostream&, const IndexedTree< Key, Data >&);
Data & getData(const std::vector< Key > &index) const
Returns the value of a given node of the tree.
The class for storing the nodes of the Arborescence.
IndexedTree< Key, Data > * parent
The parent of the node.
IndexedTree(Data *data=nullptr)
Creates a tree with one node with or without data.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTable< Key, IndexedTree< Key, Data > *> children
The list of children nodes of the current node.
void insertNode(const std::vector< Key > &index, const Data *data)
Adds a new node into the tree.
Data * data
The data stored into the node.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for generic Hash Tables.
IndexedTree< Key, Data > & getNode(const std::vector< Key > &index) const
Returns a given node of the tree.
IndexedTree< Key, Data > & operator=(const IndexedTree< Key, Data > &from)
Copy operator.
void setNode(const std::vector< Key > &index, Data *data)
Updates the value of a node (or adds it if it does not already exist).
Key key
The key of the current node.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
~IndexedTree()
Class destructor.