Simon Bruder
c2804e2d3b
The test is not very pretty, I may think of something nicer (once I learn how to do it).
20 lines
417 B
C++
20 lines
417 B
C++
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class node {
|
|
public:
|
|
node(const std::string &name = "");
|
|
virtual ~node();
|
|
std::string get_name() const;
|
|
void set_name(const std::string new_name);
|
|
unsigned int get_nr_children() const;
|
|
node *get_child(std::size_t i) const;
|
|
void add_child(node *child);
|
|
|
|
private:
|
|
std::string name;
|
|
std::vector<node *> children;
|
|
static unsigned int node_id;
|
|
};
|