~ubuntu-branches/ubuntu/maverick/aspectc++/maverick

« back to all changes in this revision

Viewing changes to AspectC++/MatchType.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
  // perform a type match
53
53
  bool qual_matches (CTypeQualified *qtype) const;
 
54
  bool qual_matches (const MTQual *qual) const;
54
55
};
55
56
 
56
57
// this is a common base class for all nodes in a tree that represents
75
76
  virtual bool operator ==(const MatchType &) const;
76
77
  inline bool operator !=(const MatchType &t) const { return !(*this == t); }
77
78
  
78
 
  // print the string representation of this type
 
79
  //! print the string representation of this type
79
80
  virtual void print (ostream &, const char* = 0, bool = false) const = 0;
80
81
  
81
 
  // check whether this is a function type
 
82
  //! check whether this is a function type
82
83
  virtual bool is_function () const { return false; }
83
 
  // check whether this is an array type
 
84
  //! check whether this is an array type
84
85
  virtual bool is_array () const { return false; }
85
 
  // check whether this type is 'void'
 
86
  //! check whether this type is 'void'
86
87
  virtual bool is_void () const { return false; }
 
88
  //! check whether this type is primitive
 
89
  virtual bool is_primitive () const { return false; }
 
90
  //! check whether this type is a reference
 
91
  virtual bool is_reference () const { return false; }
87
92
 
88
 
  // create a clone of this match type
 
93
  //! create a clone of this match type
89
94
  virtual MatchType *clone () const = 0;
90
95
  
91
 
  // get the base type if this is a derived type
 
96
  //! get the base type if this is a derived type
92
97
  virtual MatchType *base () const { return 0; }
93
98
  
94
99
  // perform a type match
95
100
  virtual bool matches (CTypeInfo *ctype) const = 0;
 
101
  virtual bool matches (const MatchType &type) const = 0;
96
102
  
97
103
  // adjust the argument types according to �8.3.5.2 and �8.3.5.3 of ISO C++
98
104
  virtual void adjust_args (bool &f, bool &a, bool &q, bool &v) {}
99
105
  
100
106
  // converts the type into an MTQual if it is one
101
107
  virtual MTQual *qualified () { return 0; }
 
108
  virtual const MTQual *qualified () const { return 0; }
102
109
};
103
110
 
104
111
// should later become "MatchType"
158
165
  bool matches (CTypeInfo *ctype) const {
159
166
    return _type_info->matches (ctype);
160
167
  }
 
168
  bool matches (MatchTypeRef type) const {
 
169
    return _type_info->matches (*type.type_info ());
 
170
  }
161
171
  
162
172
  // adjust the argument types according to �8.3.5.2 and �8.3.5.3 of ISO C++
163
173
  void adjust_args (bool &f, bool &a, bool &q, bool &v) {
165
175
  }
166
176
  
167
177
  // print the string representation of this type
168
 
  void print (ostream &os) const {
169
 
    _type_info->print (os);
 
178
  void print (ostream &os, const char *prefix = 0) const {
 
179
    _type_info->print (os, prefix);
170
180
  }
171
181
  
172
182
  // check and get specific properties of this type
180
190
  bool is_function () const { return _type_info->is_function (); }
181
191
  bool is_array () const { return _type_info->is_array (); }
182
192
  bool is_void () const { return _type_info->is_void(); }
183
 
  
 
193
  bool is_primitive () const { return _type_info->is_primitive(); }
 
194
  bool is_reference () const { return _type_info->is_reference(); }
 
195
 
184
196
  MatchTypeRef base () const {
185
197
    MatchType *b = _type_info->base ();
186
198
    return b ? MatchTypeRef (b->clone ()) : MatchTypeRef ();