sgsHandle [class]
template< class T > class sgsHandle
This is the class used for handling SGS_OBJECT classes.
Variables
sgs_VarObj* object- the pointer to object with interface equal to T::_sgs_interface or NULLSGS_CTX(sgs_Context* C) - associated context
Constructors
sgsHandle()- initializes a NULL handlesgsHandle( const sgsHandle& h )- initializes a handle from another handlesgsHandle( sgs_Context* c, sgs_VarObj* obj )- initializes a handle from object pointer if it has the right interface, otherwise handle is initialized to NULLsgsHandle( sgs_Context* c, sgs_StkIdx item )- initializes a handle from stack index if it has the right interface, otherwise handle is initialized to NULLsgsHandle( sgs_Context* c, sgs_Variable* var )- initializes a handle from variable pointer if it has the right interface, otherwise handle is initialized to NULLexplicit sgsHandle( T* obj )- initializes a handle from class (SGS_OBJECT) instance pointer
Methods
void gcmark()- mark the object in handle as accessible (using sgs_ObjGCMark)void push( sgs_Context* c = NULL )- push the handle on the stack as object/nullbool not_null()- returns if object handle points to an instancesgsVariable get_variable()- returns this handle as sgsVariablevoid _acquire()- increment reference count on variablevoid _release()- decrement reference count on variable, remove it from the class
Operators
const sgsHandle& operator = ( const sgsHandle& h )- handle assignmentoperator T*(),operator const T*() const- implicit conversion to valid T* or NULLT* operator -> (),const T* operator -> () const- object accessbool operator <,bool operator ==,bool operator !=- comparison operators
