~ubuntu-branches/ubuntu/quantal/aspectc++/quantal

« back to all changes in this revision

Viewing changes to AspectC++/TUnitModelElementFactory.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:
 
1
// This file is part of the AspectC++ compiler 'ac++'.
 
2
// Copyright (C) 1999-2003  The 'ac++' developers (see aspectc.org)
 
3
//                                                                
 
4
// This program is free software;  you can redistribute it and/or 
 
5
// modify it under the terms of the GNU General Public License as 
 
6
// published by the Free Software Foundation; either version 2 of 
 
7
// the License, or (at your option) any later version.            
 
8
//                                                                
 
9
// This program is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
 
12
// GNU General Public License for more details.                   
 
13
//                                                                
 
14
// You should have received a copy of the GNU General Public      
 
15
// License along with this program; if not, write to the Free     
 
16
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 
17
// MA  02111-1307  USA                                            
 
18
 
 
19
#ifndef __TUnitModelElementFactory_h__
 
20
#define __TUnitModelElementFactory_h__
 
21
 
 
22
#include "ModelElementFactory.h"
 
23
#include "JoinPointLoc.h"
 
24
#include "TransformInfo.h"
 
25
 
 
26
/* helper classes to merge the TI_ classes into the JPL_ classes, i.e. to
 
27
 * extend the join point model elements by transformation infos
 
28
 */
 
29
 
 
30
class TU_Type : public JPL_Type, public TI_Type {
 
31
public:
 
32
  TU_Type (const string &s) : JPL_Type (s) { transform_info (this); }
 
33
  ~TU_Type () { transform_info (0); }
 
34
  virtual JoinPointLoc &jpl () { return *this; }
 
35
};
 
36
 
 
37
class TU_Namespace : public JPL_Namespace, public TI_Namespace {
 
38
public:
 
39
  TU_Namespace (const string &s) : JPL_Namespace (s) { transform_info (this); }
 
40
  ~TU_Namespace () { transform_info (0); }
 
41
  virtual JoinPointLoc &jpl () { return *this; }
 
42
};
 
43
 
 
44
class TU_Class : public JPL_Class, public TI_Class {
 
45
public:
 
46
  TU_Class (const string &s) : JPL_Class (s) { transform_info (this); }
 
47
  ~TU_Class () { transform_info (0); }
 
48
  virtual JoinPointLoc &jpl () { return *this; }
 
49
};
 
50
 
 
51
class TU_Aspect : public JPL_Aspect, public TI_Aspect {
 
52
public:
 
53
  TU_Aspect (const string &s) : JPL_Aspect (s) { transform_info (this); }
 
54
  ~TU_Aspect () { transform_info (0); }
 
55
  virtual JoinPointLoc &jpl () { return *this; }
 
56
};
 
57
 
 
58
class TU_Function : public JPL_Function, public TI_Function {
 
59
public:
 
60
  TU_Function (const string &n, const string &s) : JPL_Function (n, s) { transform_info (this); }
 
61
  ~TU_Function () { transform_info (0); }
 
62
  virtual JoinPointLoc &jpl () { return *this; }
 
63
};
 
64
 
 
65
class TU_AdviceCode : public JPL_AdviceCode, public TI_AdviceCode {
 
66
public:
 
67
  TU_AdviceCode (const string &n, const string &s) : JPL_AdviceCode (n, s) { transform_info (this); }
 
68
  ~TU_AdviceCode () { transform_info (0); }
 
69
  virtual JoinPointLoc &jpl () { return *this; }
 
70
};
 
71
 
 
72
class TU_ClassSlice : public JPL_ClassSlice, public TI_ClassSlice {
 
73
public:
 
74
  TU_ClassSlice (const string &s) : JPL_ClassSlice (s) { transform_info (this); }
 
75
  ~TU_ClassSlice () { transform_info (0); }
 
76
  virtual JoinPointLoc &jpl () { return *this; }
 
77
};
 
78
 
 
79
class TU_MethodCall : public JPL_MethodCall, public TI_MethodCall {
 
80
public:
 
81
  TU_MethodCall () { transform_info (this); }
 
82
  ~TU_MethodCall () { transform_info (0); }
 
83
  virtual JoinPointLoc &jpl () { return *this; }
 
84
};
 
85
 
 
86
class TU_Method : public JPL_Method, public TI_Method {
 
87
public:
 
88
  TU_Method () { transform_info (this); }
 
89
  ~TU_Method () { transform_info (0); }
 
90
  virtual JoinPointLoc &jpl () { return *this; }
 
91
};
 
92
 
 
93
class TU_Construction : public JPL_Construction, public TI_Construction {
 
94
public:
 
95
  TU_Construction () { transform_info (this); }
 
96
  ~TU_Construction () { transform_info (0); }
 
97
  virtual JoinPointLoc &jpl () { return *this; }
 
98
};
 
99
 
 
100
class TU_Destruction : public JPL_Destruction, public TI_Destruction {
 
101
public:
 
102
  TU_Destruction () { transform_info (this); }
 
103
  ~TU_Destruction () { transform_info (0); }
 
104
  virtual JoinPointLoc &jpl () { return *this; }
 
105
};
 
106
 
 
107
class TU_Introduction : public JPL_Introduction, public TI_Introduction {
 
108
public:
 
109
  TU_Introduction () { transform_info (this); }
 
110
  ~TU_Introduction () { transform_info (0); }
 
111
  virtual JoinPointLoc &jpl () { return *this; }
 
112
};
 
113
 
 
114
class TU_Order : public JPL_Order, public TI_Order {
 
115
public:
 
116
  TU_Order () { transform_info (this); }
 
117
  ~TU_Order () { transform_info (0); }
 
118
  virtual JoinPointLoc &jpl () { return *this; }
 
119
};
 
120
 
 
121
 
 
122
/* a model element factory for the translation unit model that additionally
 
123
 * contains references to the Puma information about the model elements,
 
124
 * which is needed for transformations.
 
125
 */
 
126
 
 
127
class TUnitModelElementFactory {
 
128
public:
 
129
  virtual ~TUnitModelElementFactory () {}
 
130
  
 
131
  virtual TU_Namespace *make_namespace (const string &s) {
 
132
    return new TU_Namespace (s); 
 
133
  }
 
134
  virtual TU_Class *make_class (const string &s) {
 
135
    return new TU_Class (s);
 
136
  }
 
137
  virtual TU_Aspect *make_aspect (const string &s) {
 
138
    return new TU_Aspect (s);
 
139
  }
 
140
  virtual TU_Function *make_function (const string &n, const string &s) {
 
141
    return new TU_Function (n, s);
 
142
  }
 
143
  virtual TU_AdviceCode *make_advice_code (const string &n, const string &s) {
 
144
    return new TU_AdviceCode (n, s);
 
145
  }
 
146
  virtual TU_ClassSlice *make_class_slice (const string &s) {
 
147
    return new TU_ClassSlice (s);
 
148
  }
 
149
  virtual TU_Type *make_type (const string &s)  { return new TU_Type (s); }
 
150
  virtual TU_Method *make_execution ()          { return new TU_Method; }
 
151
  virtual TU_MethodCall *make_call ()           { return new TU_MethodCall; }
 
152
  virtual TU_Construction *make_construction () { return new TU_Construction; }
 
153
  virtual TU_Destruction *make_destruction ()   { return new TU_Destruction; }
 
154
  virtual TU_Introduction *make_introduction () { return new TU_Introduction; }
 
155
  virtual TU_Order *make_order ()               { return new TU_Order; }
 
156
};
 
157
 
 
158
#endif // __TUnitModelElementFactory_h__