--- deliantra/server/include/cfperl.h 2007/01/01 00:41:03 1.46 +++ deliantra/server/include/cfperl.h 2007/01/07 02:39:14 1.47 @@ -122,12 +122,13 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +INTERFACE_CLASS (attachable) struct attachable { static MGVTBL vtbl; static unordered_vector mortals; - static void check_mortals (); + MTH static void check_mortals (); enum { F_DESTROYED = 0x01, @@ -135,22 +136,22 @@ }; // object is delete'd after the refcount reaches 0 - mutable int refcnt; - int flags; + mutable int ACC (RW, refcnt); + int ACC (RW, flags); - void refcnt_inc () const { ++refcnt; } - void refcnt_dec () const { --refcnt; } + MTH void refcnt_inc () const { ++refcnt; } + MTH void refcnt_dec () const { --refcnt; } // check wether the object has died and destroy - void refcnt_chk () { if (refcnt <= 0) do_check (); } + MTH void refcnt_chk () { if (refcnt <= 0) do_check (); } // destroy the object unless it was already destroyed // this politely asks everybody interested the reduce // the refcount to 0 as soon as possible. - void destroy (); + MTH void destroy (); // return wether an object was destroyed already - bool destroyed () const { return flags & F_DESTROYED; } + MTH bool destroyed () const { return flags & F_DESTROYED; } virtual void gather_callbacks (AV *&callbacks, event_type event) const; @@ -325,7 +326,7 @@ put (k, (T *)v); } - bool save (const char *filename); + bool save (const char *path); char *as_string (); // like strdup operator bool () { return !!av; } @@ -341,10 +342,11 @@ AV *av; // perl part char *line; // current beginning of line char *last_keyword, *last_value; + const char *name; operator bool () { return !!text; } - object_thawer (const char *filename = 0); + object_thawer (const char *path = 0); object_thawer (const char *data, AV *perlav); ~object_thawer ();