Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CLocal Class Reference

The CLocal class is a container for local variables, backpointers, and data that are associated with a CThing. More...

Collaboration diagram for CLocal:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Construct ()
 The Construct function sets up the internal structure of the CLocal object.
void Destruct ()
 The Destruct function properly de-allocates and cleans up the internal structure of a CLocal.
void AddTypedDataAndLength (unsigned long type, unsigned long length, const void *data)
 The AddTypedDataAndLength attaches data to the CLocal object.
__int8 * GetDataByType (unsigned long type) const
 GetDataByType returns a pointer to data attached to a CLocal.

Public Attributes

CThingArray localrefs
 references to CThings that are associated with this local
PointerArray datumrefs
 references to data that may be associated with this object -- see data format for more
CThingcontainer
 the owner, may be null, indicates that the CLocal is a member of another rebi
CThingArray destobjects
 A list of all objects that locals of this rebi are tied to.
LongArray localtierefs
 A list of all the names (as string indices) of the locals that are tied.
LongArray desttierefs
 A list of all the names (as string indices) of the locals in the destination rebi that are tied.

Detailed Description

The CLocal class is a container for local variables, backpointers, and data that are associated with a CThing.

Not all CThing objects have a CLocal associated with them, only the ones that represent instances of rebis do. A CLocal may only be attached to a single CThing at a time.


Member Function Documentation

void CLocal::AddTypedDataAndLength unsigned long  type,
unsigned long  length,
const void *  data
 

The AddTypedDataAndLength attaches data to the CLocal object.

This function is used primarily internally, it is usually best to use AddData instead. If the CLocal already has data attached of the same type the old data is removed and replaced with the new data. The data that is attached is a copy of the data that you pass. Any alterations to this data after it has been added will not affect the data that is attached. Likewise if your data pointer was dynamically allocated it is safe (and probably neccessary) to free it.

See also:
AddData()
Parameters:
type the id of the type of data that is being added
length the size of the data in bytes
data the pointer to the data to be attached

void CLocal::Construct  ) 
 

The Construct function sets up the internal structure of the CLocal object.

If you create a CLocal though a call to malloc or new you must call its construct function after creating it. The Construct function is properly used by any functions in this API that returns a new CLocal.

See also:
CLocal::Destruct()

void CLocal::Destruct  ) 
 

The Destruct function properly de-allocates and cleans up the internal structure of a CLocal.

If you are manually destroying a CLocal by any method you must call Destruct on it before doing so. Failure to call Destruct will cause memory leaks.

See also:
CLocal::Construct()

__int8 * CLocal::GetDataByType unsigned long  type  )  const
 

GetDataByType returns a pointer to data attached to a CLocal.

This function is used primarily internally, it is usually best to use GetData instead. If the type of data requested cannot be found NULL is returned. The pointer returned is to the data itsself and not to a copy. Modifying this data will affect the attached data. Freeing the returned pointer is an error. If you are unsure how long the attached data is you can use GetDataLength to find out.

See also:
GetData()

GetDataLength()

Parameters:
type the id of the type of data that is being returned
Returns:
a pointer to the requested type of data, or NULL if that type of data is not attached.


The documentation for this class was generated from the following files:
Generated on Sat Apr 16 16:31:09 2005 for Centum API by  doxygen 1.4.2