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.12 by root, Mon Aug 28 14:05:24 2006 UTC vs.
Revision 1.13 by root, Mon Aug 28 16:52:51 2006 UTC

83struct attachable_base 83struct attachable_base
84{ 84{
85 void *self, *cb; // CF+ perl self and callback 85 void *self, *cb; // CF+ perl self and callback
86 const char *attach; // generic extension attachment information 86 const char *attach; // generic extension attachment information
87 87
88 void clear (); // called when free'ing objects 88 void clear (); // called when free'ing objects
89 void optimise (); // possibly save some memory by destroying unneeded data 89 void optimise (); // possibly save some memory by destroying unneeded data
90 void instantiate (data_type type, void *obj);
90 91
91 void attachable_init () 92 void attachable_init ()
92 { 93 {
93 self = cb = 0; 94 self = cb = 0;
94 attach = 0; 95 attach = 0;
101template<class subclass> 102template<class subclass>
102struct attachable : attachable_base 103struct attachable : attachable_base
103{ 104{
104 static data_type get_dt () 105 static data_type get_dt ()
105 { 106 {
106 subclass::get_dt (); 107 return subclass::get_dt ();
108 }
109
110 void instantiate ()
111 {
112 if (attach)
113 attachable_base::instantiate (get_dt (), static_cast<subclass *>(this));
107 } 114 }
108}; 115};
109 116
110struct object_freezethaw 117struct object_freezethaw
111{ 118{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines