-
Notifications
You must be signed in to change notification settings - Fork 0
/
OperatorProvider.h
35 lines (28 loc) · 958 Bytes
/
OperatorProvider.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
#pragma once
namespace E{
enum Operator_Type { __None = 0, _Add, _Substract, _Multiply, _Divide, _Power, _Negative, __LeftBracket, __RightBracket };
struct OperatorInfo
{
Operator_Type OperatorType;
enum { None = 0, Single_Left, Single_Right, Double } Type;
};
struct OperatorInfoEx
{
Operator_Type OperatorType;
int Priority;
enum { LeftToRight, RightToLeft } order;
enum { None = 0, Single_Left, Single_Right, Double } Type;
char Name[4];
int NameLength;
};
class OperatorProvider
{
public:
OperatorProvider() = delete;
OperatorProvider(const OperatorProvider&) = delete;
static OperatorInfo GetOperatorInfo(Operator_Type);
static OperatorInfoEx GetOperatorInfoEx(Operator_Type);
static Value_Type SingleCalculate(Operator_Type, Value_Type)throw(std::invalid_argument);
static Value_Type DoubleCalculate(Operator_Type, Value_Type, Value_Type)throw(std::invalid_argument);
};
}