34
33
class CTemplateInfo;
37
/** \class CTemplateParamInfo CTemplateParamInfo.h Puma/CTemplateParamInfo.h
38
* Semantic information about a template parameter. There are
39
* three kinds of template parameter: type, non-type, and template
43
* // T is a type template parameter
44
* // I is a non-type template parameter
45
* // TT is a template template parameter
46
* template<class T, int I, template<typename,int> class TT>
37
51
class CTemplateParamInfo : public CObjectInfo {
38
52
CTemplateInfo *_TemplateInfo;
39
53
CTemplateInfo *_TemplateTemplate;
45
60
CTemplateParamInfo ();
61
/** Destructor. If the object type is CObjectInfo::TEMPLATE_PARAM_INFO,
62
* then CObjectInfo::CleanUp() is called and the template instance
63
* information object of a template template parameter is destroyed. */
46
64
~CTemplateParamInfo ();
49
bool isTemplate () const; // is template template parameter?
50
bool isTypeParam () const; // is type parameter?
51
CTemplateInfo *TemplateInfo () const; // the template parameters of the
52
CTemplateInfo *TemplateTemplate () const; // the template parameters of
53
CT_TemplateParamDecl *Tree () const; // the template template parameter
54
CT_ExprList *DefaultArgument () const; // default template argument
66
/** Check if this is a template template parameter. */
67
bool isTemplate () const;
68
/** Check if this is a type template parameter. */
69
bool isTypeParam () const;
70
/** Get the template parameters of a template template parameter. */
71
CTemplateInfo *TemplateInfo () const;
72
/** Get the template information of a template template parameter. */
73
CTemplateInfo *TemplateTemplate () const;
74
/** Get the syntax tree node representing the template parameter. */
75
CT_TemplateParamDecl *Tree () const;
76
/** Get the default argument of the template parameter.
77
* \return The default argument expression or NULL if no default argument. */
78
CT_ExprList *DefaultArgument () const;
79
/** Get the template parameter type. */
55
80
CTypeTemplateParam *TypeInfo () const;
81
/** Get the value type of a type template parameter. */
56
82
CTypeInfo *ValueType () const;
83
/** Get the template instance information for an instantiated
84
* template template parameter. */
57
85
CTemplateInstance *TemplateInstance () const;
58
int getPosition () const; // position in template parameter list
86
/** Get the position/index of this parameter in the template parameter list. */
87
int getPosition () const;
61
void isTypeParam (bool);
62
void ValueType (CTypeInfo *);
63
void TemplateInfo (CTemplateInfo *);
64
void TemplateTemplate (CTemplateInfo *);
65
void TemplateInstance (CTemplateInstance *);
89
/** Set whether this is a type template parameter.
90
* \param v True for yes, false for no. */
91
void isTypeParam (bool v);
92
/** Set the value type of a type template parameter.
93
* \param type The value type. */
94
void ValueType (CTypeInfo *type);
95
/** Set the template parameter list information for
96
* a template template parameter.
97
* \param info The template parameter list information. */
98
void TemplateInfo (CTemplateInfo *info);
99
/** Set the template information for a template template parameter.
100
* \param info The template information. */
101
void TemplateTemplate (CTemplateInfo *info);
102
/** Set the template instance information for an instantiated template
103
* template parameter.
104
* \param inst The template instance. */
105
void TemplateInstance (CTemplateInstance *inst);
68
108
inline CTemplateParamInfo::CTemplateParamInfo () :