ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/cfperl.h
(Generate patch)

Comparing deliantra/server/include/cfperl.h (file contents):
Revision 1.85 by root, Wed Aug 1 20:07:06 2007 UTC vs.
Revision 1.86 by root, Mon Aug 6 10:54:12 2007 UTC

154int cfperl_result_INT (int idx); 154int cfperl_result_INT (int idx);
155 155
156////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 156//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
157 157
158INTERFACE_CLASS (attachable) 158INTERFACE_CLASS (attachable)
159struct attachable 159struct attachable : refcnt_base
160{ 160{
161 static MGVTBL vtbl; 161 static MGVTBL vtbl;
162 162
163 static unordered_vector<attachable *> mortals; 163 static unordered_vector<attachable *> mortals;
164 MTH static void check_mortals (); 164 MTH static void check_mortals ();
165 165
166 enum { 166 enum {
167 F_DESTROYED = 0x01, 167 F_DESTROYED = 0x01,
168 F_DEBUG_TRACE = 0x02, 168 F_DEBUG_TRACE = 0x02,
169 }; 169 };
170 int ACC (RW, flags);
170 171
171 // object is delete'd after the refcount reaches 0 172 // object is delete'd after the refcount reaches 0
172 int ACC (RW, flags);
173 mutable int ACC (RW, refcnt);
174
175 MTH void refcnt_inc () const { ++refcnt; }
176 MTH void refcnt_dec () const { --refcnt; }
177
178 MTH int refcnt_cnt () const; 173 MTH int refcnt_cnt () const;
179 // check wether the object has died and destroy 174 // check wether the object has died and destroy
180 MTH void refcnt_chk () { if (expect_false (refcnt <= 0)) do_check (); } 175 MTH void refcnt_chk () { if (expect_false (refcnt <= 0)) do_check (); }
181 176
182 // destroy the object unless it was already destroyed 177 // destroy the object unless it was already destroyed
201 196
202 void sever_self (); // sever this object from its self, if it has one. 197 void sever_self (); // sever this object from its self, if it has one.
203 void optimise (); // possibly save some memory by destroying unneeded data 198 void optimise (); // possibly save some memory by destroying unneeded data
204 199
205 attachable () 200 attachable ()
206 : flags (0), refcnt (0), self (0), cb (0), attach (0) 201 : flags (0), self (0), cb (0), attach (0)
207 { 202 {
208 } 203 }
209 204
210 attachable (const attachable &src) 205 attachable (const attachable &src)
211 : flags (0), refcnt (0), self (0), cb (0), attach (src.attach) 206 : flags (0), self (0), cb (0), attach (src.attach)
212 { 207 {
213 } 208 }
214 209
215 // set a custom key to the given value, or delete it if value = 0 210 // set a custom key to the given value, or delete it if value = 0
216 void set_key (const char *key, const char *value = 0); 211 void set_key (const char *key, const char *value = 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines