This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues/pull-requests.
2023-04-22 10:01:39 +02:00
|
|
|
#pragma once
|
|
|
|
|
2023-04-21 22:46:18 +02:00
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class node {
|
|
|
|
public:
|
2023-04-21 23:13:26 +02:00
|
|
|
node(const std::string &name = "");
|
2023-04-21 22:46:18 +02:00
|
|
|
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;
|
2023-04-21 23:13:26 +02:00
|
|
|
static unsigned int node_id;
|
2023-04-21 22:46:18 +02:00
|
|
|
};
|
2023-04-21 23:56:14 +02:00
|
|
|
|
|
|
|
node *create_complete_tree(std::size_t nr_child_nodes, unsigned int tree_depth);
|