Public Member Functions | Public Attributes

AppDataChunk Class Reference

This reference page is linked to from the following overview topics: Application Data.


Search for all occurrences

Detailed Description

An application/plugin specific custom data that can be attached to animatables.

Instances of this class store custom data defined by plugins and are attached to animatables when plugins call Animatable::AddAppDataChunk. Plugins don't need to instanciate directly objects of type AppDataChunk, but can get to the instances stored on animatables by calling Animatable::GetAppDataChunk.

#include <AppDataChunk.h>

Inheritance diagram for AppDataChunk:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport  AppDataChunk (Class_ID cid, SClass_ID sid, DWORD sbid, DWORD len, void *data)
  Constructor.
CoreExport  AppDataChunk ()
  Constructor The length of the data buffer is set to 0 and the data pointer set to NULL.
CoreExport  ~AppDataChunk ()
  Destructor.
CoreExport IOResult  Load (ILoad *iload)
  Loads this AppDataChunk.
CoreExport IOResult  Save (ISave *isave)
  Saves this AppDataChunk.

Public Attributes

Class_ID  classID
  The Class_ID of the owner of this chunk.
SClass_ID  superClassID
  The SuperClassID of the owner of this chunk.
DWORD  subID
  An extra ID that lets the owner identify its sub chunks.
DWORD  length
  The length of the data in bytes.
void *  data
  The chunk data itself.

Constructor & Destructor Documentation

CoreExport AppDataChunk ( Class_ID  cid,
SClass_ID  sid,
DWORD  sbid,
DWORD  len,
void *  data 
)

Constructor.

The data members are initialized to the values passed.

Parameters:
cid - The Class_ID of the owner of the custom data.
sid - The SuperClassID of the owner of the custom data.
sbid - An extra ID that lets the owner identify its sub-custom-data (chunks).
len - The length of the data in bytes.
data - Pointer to the actual data. The data should be allocated on the heap by client code using MAX_malloc(). This will allow the system to free it safely (using MAX_free()). MAX_malloc() and MAX_free() are memory management routines implemented by the system.
Note:
Important: Not allocating on the heap the data passed to this method may lead to unexpected behaviour of the application.
Important: Client code does not need to free the data that has been passed to this method. The system will free it when the Animatable is deleted or when client code explicitely removes the custom data chunk from the Animatable by calling Animatable::RemoveAppDataChunk.
CoreExport AppDataChunk ( )

Constructor The length of the data buffer is set to 0 and the data pointer set to NULL.

CoreExport ~AppDataChunk ( )

Destructor.

The data buffer is freed using MAX_free(). This implies that plug-ins must use MAX_malloc() to allocate it.


Member Function Documentation

CoreExport IOResult Load ( ILoad iload )

Loads this AppDataChunk.

The system implements this method to load the AppDataChunk from disk.

CoreExport IOResult Save ( ISave isave )

Saves this AppDataChunk.

The system implements this method to save the AppDataChunk to disk.


Member Data Documentation

The Class_ID of the owner of this chunk.

SClass_ID superClassID

The SuperClassID of the owner of this chunk.

DWORD subID

An extra ID that lets the owner identify its sub chunks.

DWORD length

The length of the data in bytes.

void* data

The chunk data itself.


AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk
AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk AppDataChunk