SMLCLASS Struct Reference

Structure for defining a class in SML. More...

#include <sml.h>

List of all members.

Public Attributes

const char * name
const char * BaseClassName
SMLCLASSMEMBERmembers
void *(* Constructor )(void *data, SMLCONTEXT *context, struct SMLCLASS *)
void(* Destructor )(void *data, SMLCONTEXT *context, struct SMLCLASS *)
void *(* CopyConstructor )(void *src, SMLCONTEXT *context, struct SMLCLASS *, void *dest)
int size
INT32 CreateDate
INT32 ModDate
const char * description
SMLCLASSnext
SMLCLASSBaseClass
INT8 NotInWin32Native
int OffsetToNext
void * privdata
int sizeofSMLCLASS
int sizeofSMLCLASSMEMBER
void(* UninstallClass )(SMLCLASS *)


Detailed Description

Structure for defining a class in SML.

Definition at line 3166 of file sml.h.


Member Data Documentation

struct SMLCLASS* SMLCLASS::BaseClass
 

Leave this 0. InstallClass will look up BaseClassName and set it.

Definition at line 3201 of file sml.h.

const char* SMLCLASS::BaseClassName
 

Definition at line 3168 of file sml.h.

void*(* SMLCLASS::Constructor)(void *data, SMLCONTEXT *context, struct SMLCLASS *)
 

Constructors will be called in base to derived class order.

Data passed in will be NULL or preallocated and cleared to the size specified by the largest derived class. If no size is specified, the base class's constructor will get a NULL pointer and is expected to allocate the data itself. Derived classs constructors are expected to use the data passed and return it.

void*(* SMLCLASS::CopyConstructor)(void *src, SMLCONTEXT *context, struct SMLCLASS*, void* dest)
 

Copy a class.

If the size field in SMLCLASS is 0, then the copy constructor must malloc and return a copy of src (dest parameter is ignored) This is only used this way in one place currently. For copying colormaps If size is non-zero, src should be coppied into dest and return dest. This is used mostly for assigning into an array of classes. If there is no copy constructor, an array element assignment will use memcpy()

INT32 SMLCLASS::CreateDate
 

0 means some time before 19980603

Definition at line 3197 of file sml.h.

const char* SMLCLASS::description
 

Default description which is use to generate the documentation.

Definition at line 3199 of file sml.h.

void(* SMLCLASS::Destructor)(void *data, SMLCONTEXT *context, struct SMLCLASS*)
 

Destructors are called in derived to base class order.

It's up to you to make sure that if a constructor allocated the data, a destructor frees it. But make sure that only the lowest level destructor frees it or you will illop. If the data was not allocated by a constructor (ie, a size was given in one of the classes, then the data will be free'd automatically

SMLCLASSMEMBER* SMLCLASS::members
 

Definition at line 3169 of file sml.h.

INT32 SMLCLASS::ModDate
 

Definition at line 3198 of file sml.h.

const char* SMLCLASS::name
 

Name of this type class.

Definition at line 3167 of file sml.h.

struct SMLCLASS* SMLCLASS::next
 

Linked list of registered classes.

Definition at line 3200 of file sml.h.

INT8 SMLCLASS::NotInWin32Native
 

Definition at line 3205 of file sml.h.

int SMLCLASS::OffsetToNext
 

If class is a linked list, offset to the "next" pointer (-1 if not).

Definition at line 3210 of file sml.h.

void* SMLCLASS::privdata
 

Definition at line 3211 of file sml.h.

int SMLCLASS::size
 

Definition at line 3196 of file sml.h.

int SMLCLASS::sizeofSMLCLASS
 

Definition at line 3212 of file sml.h.

int SMLCLASS::sizeofSMLCLASSMEMBER
 

Definition at line 3213 of file sml.h.

void(* SMLCLASS::UninstallClass)(SMLCLASS*)
 


The documentation for this struct was generated from the following file:
Generated on Thu Aug 12 06:27:25 2004 for TNTsdk by doxygen 1.3.4-20031026