-
Notifications
You must be signed in to change notification settings - Fork 1
/
CQEnum_Constants.hpp
59 lines (45 loc) · 1.65 KB
/
CQEnum_Constants.hpp
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
#pragma once
//
// This file handles the constants section of the definition file. So we
// have a class to store the info for an individual constant and then
// a list of constants.
//
namespace CQSL { namespace CQEnum {
enum class EConstTypes { Const, ConstExpr, ExtConst, Count };
class ConstInfo
{
public :
ConstInfo() noexcept : m_eType(EConstTypes::Count) {}
ConstInfo(const ConstInfo&) = default;
ConstInfo(ConstInfo&&) = default;
~ConstInfo() = default;
ConstInfo& operator=(const ConstInfo&) = delete;
ConstInfo& operator=(ConstInfo&&) = default;
//
// We have to track the constant type (const, constexpr, etc...), the
// name, the data type, and the value of the constant. This is all loaded
// from the file during parsing of course.
//
EConstTypes m_eType;
std::string m_strName;
std::string m_strType;
std::string m_strValue;
};
// Represents the overall constants definition block
class ConstInfoList
{
public :
ConstInfoList() = default;
~ConstInfoList() = default;
ConstInfoList(ConstInfoList&&) = default;
/// Unimplemented
ConstInfoList(const ConstInfoList&) = delete;
ConstInfoList& operator=(const ConstInfoList&) = delete;
ConstInfoList& operator=(ConstInfoList&&) = delete;
void ParseFrom(InputSrc& srcFile);
// We keep a list of const info objects
std::vector<ConstInfo> m_vConstList;
// And for efficient 'name used' checks, we keep a set of constant names
std::set<std::string> m_sNameDupCheck;
};
}};