-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathcpp_type_alias.h
More file actions
107 lines (87 loc) · 1.93 KB
/
Copy pathcpp_type_alias.h
File metadata and controls
107 lines (87 loc) · 1.93 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Copyright (C) 2022 Satya Das and CppParser contributors
// SPDX-License-Identifier: MIT
#ifndef AB11A5E0_FDCE_4B20_B3D4_8B8B91501356
#define AB11A5E0_FDCE_4B20_B3D4_8B8B91501356
#include "cppast/cpp_entity.h"
#include "cppast/cpp_templatable_entity.h"
#include "cppast/cpp_var_list.h"
namespace cppast {
class CppTypedefName : public CppEntity
{
public:
static constexpr auto EntityType()
{
return CppEntityType::TYPEDEF_DECL;
}
public:
CppTypedefName(std::unique_ptr<CppVar> var)
: CppEntity(EntityType())
, var_(std::move(var))
{
}
public:
const CppVar* var() const
{
return var_.get();
}
private:
std::unique_ptr<CppVar> var_;
};
class CppTypedefList : public CppEntity
{
public:
static constexpr auto EntityType()
{
return CppEntityType::TYPEDEF_DECL_LIST;
}
public:
CppTypedefList(std::unique_ptr<CppVarList> varList)
: CppEntity(EntityType())
, varList_(std::move(varList))
{
}
public:
const CppVarList& varList() const
{
return *varList_;
}
private:
std::unique_ptr<CppVarList> varList_;
};
class CppUsingDecl : public CppEntity, public CppTemplatableEntity
{
public:
static constexpr auto EntityType()
{
return CppEntityType::USING_DECL;
}
using DeclData = std::variant<std::unique_ptr<CppVarType>,
std::unique_ptr<CppFunctionPointer>,
std::unique_ptr<CppCompound>>;
public:
CppUsingDecl(std::string name, DeclData declData)
: CppEntity(EntityType())
, name_(std::move(name))
, declData_(std::move(declData))
{
}
CppUsingDecl(std::string name)
: CppEntity(EntityType())
, name_(std::move(name))
{
}
public:
const std::string& name() const
{
return name_;
}
const DeclData& definition() const
{
return declData_;
}
private:
std::string name_;
DeclData declData_;
};
} // namespace cppast
#endif /* AB11A5E0_FDCE_4B20_B3D4_8B8B91501356 */