~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/src/infos/CTemplateParamInfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef __CTemplateParamInfo_h__
20
20
#define __CTemplateParamInfo_h__
21
21
 
22
 
// template parameter info
23
 
// knows whether it is a type, non-type, or template 
24
 
// template parameter
25
 
 
 
22
/** \file
 
23
 *  Semantic information about a template parameter. */
 
24
 
26
25
#include "Puma/CObjectInfo.h"
27
26
 
28
27
namespace Puma {
34
33
class CTemplateInfo;
35
34
class CT_ExprList;
36
35
 
 
36
 
 
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
 
40
 *  template parameter. 
 
41
 *
 
42
 *  \code
 
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> 
 
47
 * class X {
 
48
 *   TT<T,I> x;
 
49
 * };
 
50
 *  \endcode */
37
51
class CTemplateParamInfo : public CObjectInfo {
38
52
  CTemplateInfo *_TemplateInfo;
39
53
  CTemplateInfo *_TemplateTemplate;
42
56
  bool _TypeParam;
43
57
 
44
58
public: 
 
59
  /** Constructor. */
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 ();
47
65
  
48
 
  // Get ...
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;
59
88
 
60
 
  // Set ...
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);
66
106
};
67
107
 
68
108
inline CTemplateParamInfo::CTemplateParamInfo () :