Navigation:  Reference > Classes >

gwst() - CLASS

Previous pageReturn to chapter overviewNext page

Base class for structure implementation.

 

Class Methods

::New([oParent],[nShift])

oParent and nShift params are used to allow child nested structures.

 

Instance Methods

::_gwst_([oParent],[nShift]) -> Self

If you need to redefine the ::init() method of a gwst()subclass you must call the method ::_gwst_() inside ::init() instead of the :init() method of the parent class.

 

::_alloc_([lCopy = .T.],[@pMem]) -> Self

Alloc heap memory for the structure. If lCopy not .F. the existing character buffer will be dumped to the new allocated memory. You can retrieve the memory pointer if you provide the second parameter by reference.

 

::_free_([lCopy = .T.]) -> Self

Release previously allocated heap memory for the structure. If lCopy not .F. the content of the memory will dumped to an internal character buffer.

 

::_link_(pMemory,[lCopy = .T.]) -> Self

Attach a structure to an existing memory pointer. If lCopy not .F. the content of the internal character buffer will be dumped to the attached memory.

 

::_unlink_([lCopy = .T.]) -> Self

Detach a structure from previously attached memory pointer.If lCopy not .F. the content of the memory pointer will dumped to an internal character buffer.

 

::_zeromemory_() -> Self

Initialize the struct buffer with zeros.

 

::_sizeof_([cMember]) -> nSize

Return the size of a member. With no params return the size of the structure.

 

::_addressof_([cMember]) -> nAddress

Return the memory address of a member. With no params return the memory address of the structure. Working with internal character buffer this method will return always NIL except betwen ::_lock_() ::_unlock_() calls.

 

::_lock_([@nLen]) -> pMemory

Return a memory pointer for the structure, allocating heap memory when needed.

Every ::_lock_() call must be paired with a corresponding ::_unlock_().

 

::_unlock_()

Decrease the lock counter and release the temporary heap memory if needed.

 

Vars:

:_m__pt_

Can store the memory address, the character buffer or a reference to the parent object if is a child structure.