18 #define MEMBER_TYPE_METHOD 0x01000000 19 #define MEMBER_TYPE_FIELD 0x02000000 21 #define _ismethod(o) (_integer(o)&MEMBER_TYPE_METHOD) 22 #define _isfield(o) (_integer(o)&MEMBER_TYPE_FIELD) 23 #define _make_method_idx(i) ((SQInteger)(MEMBER_TYPE_METHOD|i)) 24 #define _make_field_idx(i) ((SQInteger)(MEMBER_TYPE_FIELD|i)) 25 #define _member_type(o) (_integer(o)&0xFF000000) 26 #define _member_idx(o) (_integer(o)&0x00FFFFFF) 34 new (newclass)
SQClass(ss, base);
40 if(_members->Get(key,val)) {
42 SQObjectPtr &o = _defaultvalues[_member_idx(val)].val;
46 val = _methods[_member_idx(val)].val;
54 if(_constructoridx != -1) {
55 ctor = _methods[_constructoridx].val;
62 void Lock() { _locked =
true;
if(_base) _base->Lock(); }
64 if (_hook) { _hook(_typetag,0);}
69 #ifndef NO_GARBAGE_COLLECTOR 71 SQObjectType GetType() {
return OT_CLASS;}
81 SQUserPointer _typetag;
84 SQInteger _constructoridx;
88 #define calcinstancesize(_theclass_) \ 89 (_theclass_->_udsize + sq_aligning(sizeof(SQInstance) + (sizeof(SQObjectPtr)*(_theclass_->_defaultvalues.size()>0?_theclass_->_defaultvalues.size()-1:0)))) 99 SQInteger size = calcinstancesize(theclass);
102 if(theclass->_udsize) {
103 newinst->_userpointer = ((
unsigned char *)newinst) + (size - theclass->_udsize);
109 SQInteger size = calcinstancesize(_class);
112 if(_class->_udsize) {
113 newinst->_userpointer = ((
unsigned char *)newinst) + (size - _class->_udsize);
119 if(_class->_members->Get(key,val)) {
125 val = _class->_methods[_member_idx(val)].val;
133 if(_class->_members->Get(key,idx) && _isfield(idx)) {
134 _values[_member_idx(idx)] = val;
141 if (_hook) { _hook(_userpointer,0);}
143 if(_uiRef > 0)
return;
144 SQInteger size = _memsize;
149 #ifndef NO_GARBAGE_COLLECTOR 151 SQObjectType GetType() {
return OT_INSTANCE;}
157 SQUserPointer _userpointer;
Definition: sqobject.h:339
Definition: sqobject.h:205
Definition: sqobject.h:313