Skip to content

Commit d2b0b7d

Browse files
committed
change comments on TemplateInfo public interface to javadocs
1 parent 91a8c3c commit d2b0b7d

File tree

1 file changed

+47
-40
lines changed

1 file changed

+47
-40
lines changed

include/mrdox/Metadata/Template.hpp

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ struct TParam;
3535

3636
struct TypeTParam
3737
{
38-
// default type for the type template parameter
38+
/** Default type for the type template parameter */
3939
std::optional<TypeInfo> Default;
4040
};
4141

4242
struct NonTypeTParam
4343
{
44-
// type of the non-type template parameter
44+
/** Type of the non-type template parameter */
4545
TypeInfo Type;
46-
// non-type template parameter default value (if any)
46+
// Non-type template parameter default value (if any)
4747
std::optional<std::string> Default;
4848
};
4949

5050
struct TemplateTParam
5151
{
52-
// template parameters for the template template parameter
52+
/** Template parameters for the template template parameter */
5353
std::vector<TParam> Params;
54-
// non-type template parameter default value (if any)
54+
/** Non-type template parameter default value (if any) */
5555
std::optional<std::string> Default;
5656
};
5757

@@ -96,11 +96,11 @@ struct TParam
9696
}
9797

9898
public:
99-
// The kind of template parameter this is.
99+
/** The kind of template parameter this is. */
100100
TParamKind Kind = TParamKind::None;
101-
// The template parameters name, if any
101+
/** The template parameters name, if any */
102102
std::string Name;
103-
// Whether this template parameter is a parameter pack.
103+
/** Whether this template parameter is a parameter pack. */
104104
bool IsParameterPack = false;
105105

106106

@@ -191,31 +191,34 @@ struct TArg
191191

192192
// ----------------------------------------------------------------
193193

194-
// stores information pertaining to an explicit specialization of a
195-
// member of an implicitly instantiated class template specialization.
196-
// this structure is stored in the TemplateInfo corresponding to the
197-
// outermost specialized template. if the explicitly specialized
198-
// member is itself a member of a nested template, the SpecializationInfo
199-
// which stores the arguments for the parent template will additionally
200-
// store a pointer to the SpecializationInfo for the nested template,
201-
// recursively. each SpecializationInfo node contains a vector of
202-
// SymbolIDs pairs `(specialized, primary)`, where `specialized` is the
203-
// replacement definition of `primary` for the given set of template
204-
// arguments of its parent template(s).
194+
/** Stores information pertaining to an explicit specialization of a
195+
member of an implicitly instantiated class template specialization.
196+
197+
This structure is stored in the `TemplateInfo` corresponding to the
198+
outermost specialized template. If the explicitly specialized
199+
member is itself a member of a nested template, the `SpecializationInfo`
200+
which stores the arguments for the parent template will additionally
201+
store a pointer to the SpecializationInfo for the nested template,
202+
recursively. Each `SpecializationInfo` node contains a vector of
203+
`SymbolID` pairs `(specialized, primary)`, where `specialized` is the
204+
replacement definition of `primary` for the given set of template
205+
arguments of its parent template(s).
206+
*/
205207
struct SpecializationInfo
206208
{
207-
// template arguments a parent template is specialized for
209+
/** The template arguments the parent template is specialized for */
208210
std::vector<TArg> Args;
209211

210-
// ID of the template to which the arguments pertain
212+
/** ID of the template to which the arguments pertain */
211213
SymbolID Template;
212214

213-
// SpecializationInfo for nested templates which are also specialized
215+
/** SpecializationInfo for nested templates which are also specialized */
214216
std::vector<SpecializationInfo> Nested;
215217

216-
// SymbolID pairs of any specialized members.
217-
// the first element is the ID of the original member (i.e. member that is replaced)
218-
// the second element is the ID of the specialized member (i.e. replacement)
218+
/** SymbolID pairs of any specialized members.
219+
the first element is the ID of the original member (i.e. member that is replaced)
220+
the second element is the ID of the specialized member (i.e. the replacement)
221+
*/
219222
std::vector<std::pair<SymbolID, SymbolID>> Members;
220223
};
221224

@@ -228,28 +231,32 @@ enum class TemplateSpecKind
228231
Partial
229232
};
230233

231-
// stores information pertaining to primary template and
232-
// partial/explicit specialization declarations
234+
/** Stores information pertaining to primary template and
235+
partial/explicit specialization declarations
236+
*/
233237
struct TemplateInfo
234238
{
235-
// for primary templates:
236-
// - Params will be non-empty
237-
// - Args will be empty
238-
// for explicit specializations:
239-
// - Params will be empty
240-
// for partial specializations:
241-
// - Params will be non-empty
242-
// - each template parameter will appear at least
243-
// once in Args outside of a non-deduced context
239+
/** For primary templates:
240+
- Params will be non-empty
241+
- Args will be empty
242+
For explicit specializations:
243+
- Params will be empty
244+
For partial specializations:
245+
- Params will be non-empty
246+
- each template parameter will appear at least
247+
once in Args outside of a non-deduced context
248+
*/
244249
std::vector<TParam> Params;
245250
std::vector<TArg> Args;
246251

247-
// stores the ID of the corresponding primary template
248-
// for partial and explicit specializations
252+
/** Stores the ID of the corresponding primary template
253+
for partial and explicit specializations
254+
*/
249255
OptionalSymbolID Primary;
250256

251-
// stores information for explicit specializations of members
252-
// of implicitly instantiated class template specializations
257+
/** Stores information for explicit specializations of members
258+
of implicitly instantiated class template specializations
259+
*/
253260
std::vector<SpecializationInfo> Specializations;
254261

255262
// KRYSTIAN NOTE: using the presence of args/params

0 commit comments

Comments
 (0)