@@ -24,51 +24,123 @@ namespace clang {
24
24
namespace mrdocs {
25
25
26
26
/* * A group of children that have the same access specifier.
27
+
28
+ This struct represents a collection of symbols that share
29
+ the same access specifier within a scope.
30
+
31
+ It includes one vector for each info type,
32
+ and individual vectors for static functions, types,
33
+ and overloads.
34
+
35
+ The tranche is not part of the Corpus. It is a temporary
36
+ structure generated to aggregate the symbols of a scope. This
37
+ structure is provided to the user via the DOM.
27
38
*/
28
39
struct Tranche
29
40
{
30
41
#define INFO (Type ) std::vector<SymbolID> Type;
31
42
#include < mrdocs/Metadata/InfoNodesPascalPlural.inc>
32
43
44
+ // / The types with the same access specifier in a scope.
33
45
std::vector<SymbolID> Types;
46
+
47
+ // / The static functions with the same access specifier in a scope.
34
48
std::vector<SymbolID> StaticFunctions;
35
49
50
+ // / The overloads with the same access specifier in a scope.
36
51
ScopeInfo Overloads;
52
+
53
+ // / The static overloads with the same access specifier in a scope.
37
54
ScopeInfo StaticOverloads;
38
55
};
39
56
57
+ /* * Return a tranche representing the members of a namespace.
58
+
59
+ @return The tranche.
60
+
61
+ @param Derived The namespace to build the tranche for.
62
+
63
+ @param corpus The complete metadata.
64
+ */
65
+ MRDOCS_DECL
66
+ Tranche
67
+ makeTranche (
68
+ NamespaceInfo const & Namespace,
69
+ Corpus const & corpus);
70
+
71
+ /* * Return the Tranche as a @ref dom::Value object.
72
+ */
73
+ MRDOCS_DECL
74
+ void
75
+ tag_invoke (
76
+ dom::ValueFromTag,
77
+ dom::Value& v,
78
+ std::shared_ptr<Tranche> const & sp,
79
+ DomCorpus const * domCorpus);
80
+
40
81
/* * The aggregated interface for a given struct, class, or union.
82
+
83
+ This class represents the public, protected, and private
84
+ interfaces of a record. It is used to generate the
85
+ "interface" value of the DOM for symbols that represent
86
+ records or namespaces.
87
+
88
+ The interface is not part of the Corpus. It is a temporary
89
+ structure generated to aggregate the symbols of a record.
90
+ This structure is provided to the user via the DOM.
91
+
92
+ While the members of a Namespace are directly represented
93
+ with a Tranche, the members of a Record are represented
94
+ with an Interface.
95
+
41
96
*/
42
97
class Interface
43
98
{
44
99
public:
100
+ // / The corpus containing the complete metadata.
45
101
Corpus const & corpus;
46
102
47
103
/* * The aggregated public interfaces.
48
- */
104
+
105
+ This tranche contains all public members of a record
106
+ or namespace.
107
+
108
+ */
49
109
std::shared_ptr<Tranche> Public;
50
110
51
111
/* * The aggregated protected interfaces.
52
- */
112
+
113
+ This tranche contains all protected members of a record
114
+ or namespace.
115
+
116
+ */
53
117
std::shared_ptr<Tranche> Protected;
54
118
55
119
/* * The aggregated private interfaces.
56
- */
120
+
121
+ This tranche contains all private members of a record
122
+ or namespace.
123
+
124
+ */
57
125
std::shared_ptr<Tranche> Private;
58
126
127
+ /* * Creates an Interface object for a given record.
128
+
129
+ @param I The record to create the interface for.
130
+ @param corpus The complete metadata.
131
+ @return The interface.
132
+ */
59
133
MRDOCS_DECL
60
134
friend
61
135
Interface
62
136
makeInterface (
63
- RecordInfo const & Derived ,
137
+ RecordInfo const & I ,
64
138
Corpus const & corpus);
65
139
66
140
private:
67
141
explicit Interface (Corpus const &) noexcept ;
68
142
};
69
143
70
- // ------------------------------------------------
71
-
72
144
/* * Return the composite interface for a record.
73
145
74
146
@return The interface.
@@ -82,22 +154,18 @@ class Interface
82
154
MRDOCS_DECL
83
155
Interface
84
156
makeInterface (
85
- RecordInfo const & Derived ,
157
+ RecordInfo const & I ,
86
158
Corpus const & corpus);
87
159
88
- /* * Return a tranche representing the members of a namespace.
89
-
90
- @return The tranche.
91
-
92
- @param Derived The namespace to build the tranche for.
93
-
94
- @param corpus The complete metadata.
95
- */
160
+ /* * Return the Tranche as a @ref dom::Value object.
161
+ */
96
162
MRDOCS_DECL
97
- Tranche
98
- makeTranche (
99
- NamespaceInfo const & Namespace,
100
- Corpus const & corpus);
163
+ void
164
+ tag_invoke (
165
+ dom::ValueFromTag,
166
+ dom::Value& v,
167
+ std::shared_ptr<Interface> const & sp,
168
+ DomCorpus const * domCorpus);
101
169
102
170
} // mrdocs
103
171
} // clang
0 commit comments