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 NULL
- SGS_CTX(- sgs_Context* C) - associated context
Constructors
- sgsHandle()- initializes a NULL handle
- sgsHandle( const sgsHandle& h )- initializes a handle from another handle
- sgsHandle( sgs_Context* c, sgs_VarObj* obj )- initializes a handle from object pointer if it has the right interface, otherwise handle is initialized to NULL
- sgsHandle( sgs_Context* c, sgs_StkIdx item )- initializes a handle from stack index if it has the right interface, otherwise handle is initialized to NULL
- sgsHandle( sgs_Context* c, sgs_Variable* var )- initializes a handle from variable pointer if it has the right interface, otherwise handle is initialized to NULL
- explicit 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/null
- bool not_null()- returns if object handle points to an instance
- sgsVariable get_variable()- returns this handle as sgsVariable
- void _acquire()- increment reference count on variable
- void _release()- decrement reference count on variable, remove it from the class
Operators
- const sgsHandle& operator = ( const sgsHandle& h )- handle assignment
- operator T*(),- operator const T*() const- implicit conversion to valid T* or NULL
- T* operator -> (),- const T* operator -> () const- object access
- bool operator <,- bool operator ==,- bool operator !=- comparison operators
