-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathAbstractValueViewVisitor.h
More file actions
93 lines (75 loc) · 3.9 KB
/
AbstractValueViewVisitor.h
File metadata and controls
93 lines (75 loc) · 3.9 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
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2012-2021. All rights reserved.
*/
#ifndef UNITTESTBOT_ABSTRACTVALUEVIEWVISITOR_H
#define UNITTESTBOT_ABSTRACTVALUEVIEWVISITOR_H
#include "Tests.h"
#include <string>
namespace visitor {
class AbstractValueViewVisitor {
protected:
types::TypesHandler const * const typesHandler;
types::PointerUsage usage;
size_t additionalPointersCount = 0;
bool inUnion = false;
public:
explicit AbstractValueViewVisitor(types::TypesHandler const *typesHandler,
types::PointerUsage usage);
virtual ~AbstractValueViewVisitor() = default;
virtual void visitAny(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
protected:
virtual void visitArrayElementAfter(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
virtual void visitPointer(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
virtual void visitArray(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
size_t size,
int depth);
virtual void visitCString(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
virtual void visitStruct(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
virtual void visitUnion(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
virtual void visitEnum(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
virtual void visitPrimitive(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth) = 0;
virtual void visitPointerToFunction(const types::Type &type,
const std::string &name,
const tests::AbstractValueView *view,
const std::string &access,
int depth);
[[nodiscard]] static std::string
getDecoratedVarName(const string& varName, size_t pointersCount, const string& access);
};
}
#endif // UNITTESTBOT_ABSTRACTVALUEVIEWVISITOR_H