~ubuntu-branches/ubuntu/lucid/aspectc++/lucid

« back to all changes in this revision

Viewing changes to Puma/src/infos/acinfos/ACClassDatabase.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-04-07 11:56:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060407115635-e8wfgmetasrf2p27
Tags: 0.99+1.0pre3-1
* new upstream release
* Apply patch from Martin Michlmayr for g++-4.1 (Closes: #357901)
* further (simple) patches in Puma/ and AspectC++ for g++-4.1
* note that Puma needs to be rewoven so that it can be compiled
  with g++-4.1. This will be done we switch the default compiler
  version.
* Patch JoinPointRepo.cc so that it doesn't loop endlessly anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "Puma/ACClassDatabase.h"
20
20
#include "Puma/ACAspectInfo.h"
21
21
#include "Puma/ACPointcutInfo.h"
 
22
#include "Puma/ACSliceInfo.h"
22
23
#include "Puma/CClassInfo.h"
23
24
#include "Puma/CFunctionInfo.h"
24
25
#include <string.h>
38
39
  return pi;
39
40
}
40
41
 
 
42
ACSliceInfo *ACClassDatabase::new_slice (CObjectInfo *oi) { 
 
43
  ACSliceInfo *si = new ACSliceInfo (oi);
 
44
  _slice.append (si);
 
45
  return si;
 
46
}
 
47
 
41
48
ACAspectInfo *ACClassDatabase::AspectInfo (const char *n) const {
42
49
  for (int a = 0; a < AspectInfos (); a++)
43
50
    if (strcmp (AspectInfo (a)->name (), n) == 0)
59
66
  return (ACPointcutInfo*)0;
60
67
}
61
68
 
 
69
ACSliceInfo *ACClassDatabase::SliceInfo (CObjectInfo *oi) const {
 
70
  for (int s = 0; s < SliceInfos (); s++)
 
71
    if (SliceInfo (s)->object () == oi)
 
72
      return SliceInfo (s);
 
73
  return (ACSliceInfo*)0;
 
74
}
 
75
 
62
76
void ACClassDatabase::clear () {
63
77
  for (int a = _aspect.length () - 1; a >= 0; a--) {
64
78
    delete _aspect[a];
68
82
    delete _pointcut[p];
69
83
    _pointcut.remove (p);
70
84
  }
 
85
  for (int s = _slice.length () - 1; s >= 0; s--) {
 
86
    delete _slice[s];
 
87
    _slice.remove (s);
 
88
  }
71
89
}
72
90
 
73
91
// dump the contents of the database
87
105
      out << " (aspect: " << PointcutInfo (i)->Aspect ()->name () << ")";
88
106
    out << endl;
89
107
  }
90
 
 
91
 
//  CClassDatabase::Dump (out, level);
 
108
  out << "  " << SliceInfos () << " slices:" << endl;
 
109
  for (int i = 0; i < SliceInfos (); i++) {
 
110
    out << "    " << SliceInfo (i)->object ()->QualName ();
 
111
    out << endl;
 
112
  }
92
113
}
93
114
 
94
115