-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOptree.h
59 lines (47 loc) · 880 Bytes
/
Optree.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef ___Optree_H___
#define ___Optree_H___
#include <vector>
#include <iostream>
#include <set>
#include "TimeOperator.h"
class OptreeNode
{
private:
public:
int ID;
std::vector<OptreeNode*> children;
int timeSpend;
int rows;
OptreeNode* parent;
std::string name;
OptreeNode()
{
ID = -1;
parent = NULL;
timeSpend = 0;
rows = 0;
}
virtual ~OptreeNode()
{
}
};
class SlaveWorker;
class Optree
{
private:
int SetParent( int _parent, int _index );
int SetChildren( int _children, int _index );
int id_max;
public:
SlaveWorker* upLayer;
OptreeNode* root;
std::vector<std::string> attemptId;
int operator += ( Optree* _income );
std::vector<OptreeNode*> index;
int InitTree( std::string _optree );
int DisplayOptree();
OptreeNode* getOptree(int _index);
Optree(SlaveWorker* _upLayer);
~Optree();
};
#endif //___Optree_H___