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

« back to all changes in this revision

Viewing changes to AspectC++/Condition.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:
26
26
 
27
27
#include "Puma/CClassInfo.h"
28
28
#include "JoinPointLoc.h"
 
29
#include "TransformInfo.h"
 
30
#include "Naming.h"
29
31
using namespace Puma;
30
32
 
31
33
class PointCutExpr;
32
34
class AdviceInfo;
 
35
class  JPL_Class;
33
36
 
34
37
typedef pair<CRecord*, string> TypeCheck;
35
38
typedef set<TypeCheck> TypeCheckSet;
211
214
    
212
215
  // create a 'that' condition, i.e. the current object is an instance
213
216
  // of a specific class that matches the argument of 'that'
214
 
  void that (const char *mangled) {
215
 
    _cond = new That (mangled);
 
217
  void that (JPL_Class *in_class, const string &mangled_check) {
 
218
    TI_Class *ti = (TI_Class*)in_class->transform_info();
 
219
    stringstream cond_name;
 
220
    Naming::type_check_func (cond_name, ti->class_info (), mangled_check.c_str ());
 
221
    _cond = new That (cond_name.str ());
216
222
  }
217
223
 
218
224
  // the target object is an instance of a specific class
219
 
  void target (const char *mangled) {
220
 
    _cond = new Target (mangled);
 
225
  void target (JPL_Class *in_class, const string &mangled_check) {
 
226
    TI_Class *ti = (TI_Class*)in_class->transform_info();
 
227
    stringstream cond_name;
 
228
    Naming::type_check_func (cond_name, ti->class_info (), mangled_check.c_str ());
 
229
    _cond = new Target (cond_name.str ());
221
230
  }
222
231
  
223
232
  // we are currently running in a control flow from ...
248
257
    _cond = new Not (_cond);
249
258
  }
250
259
 
251
 
  void matches (CRecord *rec) {
 
260
  void matches (const JPL_Class &cls_loc) {
 
261
    // TODO: matching should work without parser information
 
262
    CRecord *rec = ((TI_Class*)cls_loc.transform_info ())->class_info ();
252
263
    // this is a hack! I assume that the top-level node is a TypeCond.
253
264
    if (_cond)
254
265
      ((TypeCond*)_cond)->matches (rec);