class RED::ChunkInterpretersDictionary
That class registers all the REDsdk default chunk interpreters. More...
#include <REDChunkInterpretersDictionary.h>
Inherits: Object.
Public static functions:
static void | ClearAllChunksInterpreters ( ) |
static RED_RC | GetChunkInterpreter ( RED::IChunkInterpreterProto & oChunkInterpreter, unsigned int iChunkSignature ) |
static RED_RC | RegisterChunkInterpreter ( unsigned int iChunkSignature, RED::IChunkInterpreterProto iChunkInterpreter ) |
Protected static functions:
static RED_RC | RegisterBuiltInChunksInterpreters ( ) |
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
public static void RED::ChunkInterpretersDictionary::ClearAllChunksInterpreters | ( | ) |
Cleans everything up before process exits.
public static RED_RC RED::ChunkInterpretersDictionary::GetChunkInterpreter | ( | RED::IChunkInterpreterProto & | oChunkInterpreter, |
unsigned int | iChunkSignature | ||
) |
Gets a chunk interpreter for a given chunk signature.
Parameters:
oChunkInterpreter: | Returned chunk interpreter, NULL if we have no interpreter for 'iSignature'. |
iChunkSignature: | Signature of the chunk interpreter to retrieve. |
Returns:
RED_BAD_PARAM if the chunk signature is not known,
RED_ALLOC_FAILURE if a memory allocation has failed.
public static RED_RC RED::ChunkInterpretersDictionary::RegisterChunkInterpreter | ( | unsigned int | iChunkSignature, |
RED::IChunkInterpreterProto | iChunkInterpreter | ||
) |
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.
Parameters:
iChunkSignature: | Chunk's signature. |
iChunkInterpreter: | Pointer to an implementation of the RED::IChunkInterpreter interface. |
Returns:
RED_BAD_PARAM if the iChunkInterpreter pointer is invalid,
RED_ALLOC_FAILURE on a memory allocation error,
RED_FAIL otherwise.
protected static RED_RC RED::ChunkInterpretersDictionary::RegisterBuiltInChunksInterpreters | ( | ) |
Registers all default engine built-in chunk interpreters.
Returns:
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.