class RED::ChunkInterpretersDictionary

That class registers all the REDsdk default chunk interpreters. More...

#include <REDChunkInterpretersDictionary.h>

Inherits: Object.

Public static functions:

static voidClearAllChunksInterpreters ( )
static RED_RCGetChunkInterpreter ( RED::IChunkInterpreterProto & oChunkInterpreter, unsigned int iChunkSignature )
static RED_RCRegisterChunkInterpreter ( unsigned int iChunkSignature, RED::IChunkInterpreterProto iChunkInterpreter )

Protected static functions:

static RED_RCRegisterBuiltInChunksInterpreters ( )

Protected static variables:

static RED::Map< unsigned int, RED::IChunkInterpreterProto >_cilist0
static RED::Map< unsigned int, RED::IChunkInterpreterProto >_cilist1

Detailed description:

That class registers all the REDsdk default chunk interpreters.

Chunks are "atoms" of .red files. Data are organized into chunks inside a file and a valid chunk interpreter must be registered for every kind of chunk encountered to successfully load a file. By default, REDsdk provides valid registered chunk interpreters for every type of streamable built-in data.

The dictionary is used in a static manner to register all known file chunks into a lookup table used to select the right interpretation routine for every chunk to translate.

Custom user chunks may be registered for user data interpretation. This way, you can add and "versionize" as many chunks you wish and extend the .red file format to fulfill your requirements.

Functions documentation

Cleans everything up before process exits.

public static RED_RC RED::ChunkInterpretersDictionary::GetChunkInterpreter(RED::IChunkInterpreterProto &oChunkInterpreter,
unsigned intiChunkSignature

Gets a chunk interpreter for a given chunk signature.


oChunkInterpreter:Returned chunk interpreter, NULL if we have no interpreter for 'iSignature'.
iChunkSignature:Signature of the chunk interpreter to retrieve.


RED_OK when the operation has succeeded,
RED_BAD_PARAM if the chunk signature is not known,
RED_ALLOC_FAILURE if a memory allocation has failed.

Registers a chunk interpreter.

The range of valid custom chunk signatures is [0x0000ffff, 0xffffffff]. If the chunk interpreter is already registered, RED_OK is returned.


iChunkSignature:Chunk's signature.
iChunkInterpreter:Pointer to an implementation of the RED::IChunkInterpreter interface.


RED_OK on success,
RED_BAD_PARAM if the iChunkInterpreter pointer is invalid,
RED_ALLOC_FAILURE on a memory allocation error,
RED_FAIL otherwise.

Registers all default engine built-in chunk interpreters.


RED_OK in case of success,
RED_INIT_FAILED if we have a conflict within built-in IDs,
RED_ALLOC_FAILURE if an internal allocation has failed.

Variables documentation

First list of chunk interpreters. This list contains all the built-in chunk interpreters.

Second list of chunk interpreters. This list contains all user chunk interpreters that have been registered.