Added
Link Here
|
1 |
--- src/ixlib_garbage.hh.orig Tue Jun 19 16:16:29 2001 |
2 |
+++ src/ixlib_garbage.hh Fri Dec 1 19:56:04 2006 |
3 |
@@ -126,24 +126,24 @@ |
4 |
// compiler generates one, which is *ahem* - fatal |
5 |
ref(ref const &src) |
6 |
: ref_base<T>(src) { |
7 |
- reference_manager_keeper<T_Managed>::Manager.addReference(Instance); |
8 |
+ reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance); |
9 |
} |
10 |
template<class T2> |
11 |
ref(ref<T2,T_Managed> const &src) |
12 |
: ref_base<T>(src.get()) { |
13 |
- reference_manager_keeper<T_Managed>::Manager.addReference(Instance); |
14 |
+ reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance); |
15 |
} |
16 |
template<class T2> |
17 |
ref(no_free_ref<T2,T_Managed> const &src) |
18 |
: ref_base<T>(src.get()) { |
19 |
- reference_manager_keeper<T_Managed>::Manager.addReference(Instance); |
20 |
+ reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance); |
21 |
} |
22 |
ref(T *instance = NULL) |
23 |
: ref_base<T>(instance) { |
24 |
- reference_manager_keeper<T_Managed>::Manager.addReference(Instance); |
25 |
+ reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance); |
26 |
} |
27 |
~ref() { |
28 |
- reference_manager_keeper<T_Managed>::Manager.freeReference(Instance); |
29 |
+ reference_manager_keeper<T_Managed>::Manager.freeReference(this->Instance); |
30 |
} |
31 |
|
32 |
ref &operator=(ref const &src) { |
33 |
@@ -157,20 +157,20 @@ |
34 |
|
35 |
// methods |
36 |
void release() { |
37 |
- reference_manager_keeper<T_Managed>::Manager.freeReference(Instance); |
38 |
- Instance = NULL; |
39 |
+ reference_manager_keeper<T_Managed>::Manager.freeReference(this->Instance); |
40 |
+ this->Instance = NULL; |
41 |
} |
42 |
void set(T *instance) { |
43 |
- if (instance == Instance) return; |
44 |
+ if (instance == this->Instance) return; |
45 |
|
46 |
- reference_manager_keeper<T_Managed>::Manager.freeReference(Instance); |
47 |
- Instance = instance; |
48 |
- reference_manager_keeper<T_Managed>::Manager.addReference(Instance); |
49 |
+ reference_manager_keeper<T_Managed>::Manager.freeReference(this->Instance); |
50 |
+ this->Instance = instance; |
51 |
+ reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance); |
52 |
} |
53 |
T *releaseFromGCArena() { |
54 |
- T *oldinst = Instance; |
55 |
- reference_manager_keeper<T_Managed>::Manager.forgetReference(Instance); |
56 |
- Instance = NULL; |
57 |
+ T *oldinst = this->Instance; |
58 |
+ reference_manager_keeper<T_Managed>::Manager.forgetReference(this->Instance); |
59 |
+ this->Instance = NULL; |
60 |
return oldinst; |
61 |
} |
62 |
}; |
63 |
@@ -200,24 +200,24 @@ |
64 |
// compiler generates one, which is *ahem* - fatal |
65 |
no_free_ref(no_free_ref const &src) |
66 |
: ref_base<T>(src) { |
67 |
- reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance); |
68 |
+ reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance); |
69 |
} |
70 |
template<class T2> |
71 |
no_free_ref(ref<T2,T_Managed> const &src) |
72 |
: ref_base<T>(src.get()) { |
73 |
- reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance); |
74 |
+ reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance); |
75 |
} |
76 |
template<class T2> |
77 |
no_free_ref(no_free_ref<T2,T_Managed> const &src) |
78 |
: ref_base<T>(src.get()) { |
79 |
- reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance); |
80 |
+ reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance); |
81 |
} |
82 |
no_free_ref(T *instance = NULL) |
83 |
: ref_base<T>(instance) { |
84 |
- reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance); |
85 |
+ reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance); |
86 |
} |
87 |
~no_free_ref() { |
88 |
- reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(Instance); |
89 |
+ reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(this->Instance); |
90 |
} |
91 |
|
92 |
// assignment |
93 |
@@ -232,20 +232,20 @@ |
94 |
|
95 |
// methods |
96 |
void release() { |
97 |
- reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(Instance); |
98 |
- Instance = NULL; |
99 |
+ reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(this->Instance); |
100 |
+ this->Instance = NULL; |
101 |
} |
102 |
void set(T *instance) { |
103 |
- if (instance == Instance) return; |
104 |
+ if (instance == this->Instance) return; |
105 |
|
106 |
- reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(Instance); |
107 |
- Instance = instance; |
108 |
- reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance); |
109 |
+ reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(this->Instance); |
110 |
+ this->Instance = instance; |
111 |
+ reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance); |
112 |
} |
113 |
T *releaseFromGCArena() { |
114 |
- T *oldinst = Instance; |
115 |
- reference_manager_keeper<T_Managed>::Manager.forgetReference(Instance); |
116 |
- Instance = NULL; |
117 |
+ T *oldinst = this->Instance; |
118 |
+ reference_manager_keeper<T_Managed>::Manager.forgetReference(this->Instance); |
119 |
+ this->Instance = NULL; |
120 |
return oldinst; |
121 |
} |
122 |
}; |
123 |
@@ -265,14 +265,14 @@ |
124 |
public: |
125 |
dynamic_ref(dynamic_ref const &src) |
126 |
: ref_base<T>(src),Manager(src.Manager) { |
127 |
- Manager.addReference(Instance); |
128 |
+ Manager.addReference(this->Instance); |
129 |
} |
130 |
dynamic_ref(reference_manager<T> &mgr,T *instance = NULL) |
131 |
: ref_base<T>(instance),Manager(mgr) { |
132 |
- Manager.addReference(Instance); |
133 |
+ Manager.addReference(this->Instance); |
134 |
} |
135 |
~dynamic_ref() { |
136 |
- Manager.freeReference(Instance); |
137 |
+ Manager.freeReference(this->Instance); |
138 |
} |
139 |
|
140 |
// assignment |
141 |
@@ -287,20 +287,20 @@ |
142 |
|
143 |
// methods |
144 |
void release() { |
145 |
- Manager.freeReference(Instance); |
146 |
- Instance = NULL; |
147 |
+ Manager.freeReference(this->Instance); |
148 |
+ this->Instance = NULL; |
149 |
} |
150 |
void set(T *instance) { |
151 |
- if (instance == Instance) return; |
152 |
+ if (instance == this->Instance) return; |
153 |
|
154 |
- Manager.freeReference(Instance); |
155 |
- Instance = instance; |
156 |
- Manager.addReference(Instance); |
157 |
+ Manager.freeReference(this->Instance); |
158 |
+ this->Instance = instance; |
159 |
+ Manager.addReference(this->Instance); |
160 |
} |
161 |
T *releaseFromGCArena() { |
162 |
- T *oldinst = Instance; |
163 |
- Manager.forgetReference(Instance); |
164 |
- Instance = NULL; |
165 |
+ T *oldinst = this->Instance; |
166 |
+ Manager.forgetReference(this->Instance); |
167 |
+ this->Instance = NULL; |
168 |
return oldinst; |
169 |
} |
170 |
}; |
171 |
@@ -330,14 +330,14 @@ |
172 |
public: |
173 |
no_free_dynamic_ref(no_free_dynamic_ref const &src) |
174 |
: ref_base<T>(src),Manager(src.Manager) { |
175 |
- Manager.addNoFreeReference(Instance); |
176 |
+ Manager.addNoFreeReference(this->Instance); |
177 |
} |
178 |
no_free_dynamic_ref(reference_manager<T> &mgr,T *instance = NULL) |
179 |
: ref_base<T>(instance),Manager(mgr) { |
180 |
- Manager.addNoFreeReference(Instance); |
181 |
+ Manager.addNoFreeReference(this->Instance); |
182 |
} |
183 |
~no_free_dynamic_ref() { |
184 |
- Manager.removeNoFreeReference(Instance); |
185 |
+ Manager.removeNoFreeReference(this->Instance); |
186 |
} |
187 |
|
188 |
// assignment |
189 |
@@ -352,20 +352,20 @@ |
190 |
|
191 |
// methods |
192 |
void release() { |
193 |
- Manager.removeNoFreeReference(Instance); |
194 |
- Instance = NULL; |
195 |
+ Manager.removeNoFreeReference(this->Instance); |
196 |
+ this->Instance = NULL; |
197 |
} |
198 |
void set(T *instance) { |
199 |
- if (instance == Instance) return; |
200 |
+ if (instance == this->Instance) return; |
201 |
|
202 |
- Manager.removeNoFreeReference(Instance); |
203 |
- Instance = instance; |
204 |
- Manager.addNoFreeReference(Instance); |
205 |
+ Manager.removeNoFreeReference(this->Instance); |
206 |
+ this->Instance = instance; |
207 |
+ Manager.addNoFreeReference(this->Instance); |
208 |
} |
209 |
T *releaseFromGCArena() { |
210 |
- T *oldinst = Instance; |
211 |
- Manager.forgetReference(Instance); |
212 |
- Instance = NULL; |
213 |
+ T *oldinst = this->Instance; |
214 |
+ Manager.forgetReference(this->Instance); |
215 |
+ this->Instance = NULL; |
216 |
return oldinst; |
217 |
} |
218 |
}; |
219 |
@@ -482,7 +482,7 @@ |
220 |
|
221 |
|
222 |
#define IXLIB_GARBAGE_DECLARE_MANAGER(TYPE) \ |
223 |
- ixion::reference_manager<TYPE> ixion::reference_manager_keeper<TYPE>::Manager; |
224 |
+ template <> ixion::reference_manager<TYPE> ixion::reference_manager_keeper<TYPE>::Manager = ixion::reference_manager<TYPE>(); |
225 |
} |
226 |
|
227 |
|