-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariableOrderComp.h
More file actions
46 lines (34 loc) · 1.08 KB
/
variableOrderComp.h
File metadata and controls
46 lines (34 loc) · 1.08 KB
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
41
42
43
44
45
46
#ifndef VARIABLEORDER_H
#define VARIABLEORDER_H
#include <vector>
// #include <unordered_set>
#include <string>
// #include <functional>
typedef std::string variable;
class ExtendedVariableOrder {
protected:
variable m_name;
std::vector<variable> m_key;
public:
const variable& getName() const;
const std::vector<variable>& getKey() const;
virtual bool isLeaf() const = 0;
virtual ~ExtendedVariableOrder();
ExtendedVariableOrder(variable name, std::vector<variable> key = {});
};
class ExtendedVariableOrderLeaf : public ExtendedVariableOrder {
public:
virtual bool isLeaf() const override;
ExtendedVariableOrderLeaf(variable name, std::vector<variable> key = {});
};
class ExtendedVariableOrderNode : public ExtendedVariableOrder {
private:
std::vector<ExtendedVariableOrder*> m_children;
public:
virtual bool isLeaf() const override;
const std::vector<ExtendedVariableOrder*>& getChildren() const;
void addChild(ExtendedVariableOrder* child);
~ExtendedVariableOrderNode();
ExtendedVariableOrderNode(variable name, std::vector<variable> key = {});
};
#endif