@@ -24,51 +24,123 @@ namespace clang {
2424namespace mrdocs {
2525
2626/* * 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.
2738*/
2839struct Tranche
2940{
3041 #define INFO (Type ) std::vector<SymbolID> Type;
3142 #include < mrdocs/Metadata/InfoNodesPascalPlural.inc>
3243
44+ // / The types with the same access specifier in a scope.
3345 std::vector<SymbolID> Types;
46+
47+ // / The static functions with the same access specifier in a scope.
3448 std::vector<SymbolID> StaticFunctions;
3549
50+ // / The overloads with the same access specifier in a scope.
3651 ScopeInfo Overloads;
52+
53+ // / The static overloads with the same access specifier in a scope.
3754 ScopeInfo StaticOverloads;
3855};
3956
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+
4081/* * 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+
4196*/
4297class Interface
4398{
4499public:
100+ // / The corpus containing the complete metadata.
45101 Corpus const & corpus;
46102
47103 /* * The aggregated public interfaces.
48- */
104+
105+ This tranche contains all public members of a record
106+ or namespace.
107+
108+ */
49109 std::shared_ptr<Tranche> Public;
50110
51111 /* * The aggregated protected interfaces.
52- */
112+
113+ This tranche contains all protected members of a record
114+ or namespace.
115+
116+ */
53117 std::shared_ptr<Tranche> Protected;
54118
55119 /* * The aggregated private interfaces.
56- */
120+
121+ This tranche contains all private members of a record
122+ or namespace.
123+
124+ */
57125 std::shared_ptr<Tranche> Private;
58126
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+ */
59133 MRDOCS_DECL
60134 friend
61135 Interface
62136 makeInterface (
63- RecordInfo const & Derived ,
137+ RecordInfo const & I ,
64138 Corpus const & corpus);
65139
66140private:
67141 explicit Interface (Corpus const &) noexcept ;
68142};
69143
70- // ------------------------------------------------
71-
72144/* * Return the composite interface for a record.
73145
74146 @return The interface.
@@ -82,22 +154,18 @@ class Interface
82154MRDOCS_DECL
83155Interface
84156makeInterface (
85- RecordInfo const & Derived ,
157+ RecordInfo const & I ,
86158 Corpus const & corpus);
87159
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+ */
96162MRDOCS_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);
101169
102170} // mrdocs
103171} // clang
0 commit comments