-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_node.h
More file actions
40 lines (32 loc) · 1002 Bytes
/
run_node.h
File metadata and controls
40 lines (32 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef RUN_NODE_H
#define RUN_NODE_H
#include "typedefs.h"
class Run_node;
class Non_root_run_node
{
};
class Run_node final
{
public:
state_t state;
Run_node *parent;
Run_node *left;
Run_node *right;
bool graft;
Run_node(const state_t q) : state{q}, parent{nullptr}, left{nullptr}, right{nullptr}, graft{false} {};
Run_node(const state_t q, Run_node *const p) : state{q}, parent{p}, left{nullptr}, right{nullptr}, graft{false} {};
Run_node(const Run_node &, const bool = false);
Run_node(Run_node &&);
~Run_node();
Run_node &operator=(const Run_node &) = delete;
Run_node &operator=(Run_node &&) = delete;
bool is_root() const { return nullptr == parent; };
bool is_left() const { return nullptr != parent && this == parent->left; };
bool is_right() const { return nullptr != parent && this == parent->right; };
const Run_node *root() const;
Run_node *root();
Run_node *clone() const;
private:
static Run_node *copy_constr_aux(const Run_node &, Run_node *const);
};
#endif