-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnits.cpp
More file actions
79 lines (65 loc) · 1.3 KB
/
Units.cpp
File metadata and controls
79 lines (65 loc) · 1.3 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include "Units.h"
BaseUnit::BaseUnit()
{
this->_name = "";
this->_code = "";
}
BaseUnit::~BaseUnit()
{
}
BaseUnit::BaseUnit(std::string name, std::string code)
{
this->_code = code;
this->_name = name;
}
std::string BaseUnit::name()
{
return this->_name;
}
std::string BaseUnit::code()
{
return this->_code;
}
bool BaseUnit::operator<(const BaseUnit& B)
{
return this->_code < B._code;
}
bool BaseUnit::operator==(const BaseUnit& B)
{
return this->_code == B._code;
}
bool BaseUnit::operator>(const BaseUnit& B)
{
return this->_code > B._code;
}
bool BaseUnit::operator!=(const BaseUnit& B)
{
return this->_code != B._code;
}
void BaseUnit::printAllInfo()
{
std::cout << "BaseUnit{ name: " << this->_name << ", code: " << this->_code << " }";
}
BaseUnitNode::BaseUnitNode()
{
this->pre = nullptr;
this->trans_factor_pre = 0;
}
BaseUnitNode::~BaseUnitNode()
{
delete this->pre;
this->pre = nullptr;
for (int i = 0; i < this->next.size(); i++) {
delete this->next[i];
this->next[i] = nullptr;
}
this->next.clear();
this->trans_factor_next.clear();
}
void BaseUnitNode::add_nextNode(BaseUnitNode& node)
{
//std::lower_bound(this->next.begin(), this->next.end(), node);
}
void BaseUnitNode::link_preNode(BaseUnitNode& node)
{
}