BaseContext Input & Output Methods
[BaseContext Related Documentations]


Detailed Description

Serialization methods. Also note BaseType::WriteFile() and BaseType::ReadFile() are valid for BaseContext.


Functions

virtual const unsigned char * BaseContext::Serialize_In (const unsigned char *_pDescriptionChunk)
 Read the object description from a byte chunk. Could crash if chunk not valid. It serializes first the class name, the number of object instancied, then the number of sub-classnodes instancied, then all object instancied, then all subclasses recursively.
virtual unsigned int BaseContext::GetSerializedDescriptionSize (void)
 get the size of the whole byte chunk that will be written by Serialize_Out().
virtual unsigned char * BaseContext::Serialize_Out (unsigned char *_pDescriptionChunkToFill)
 write the Current object definition to a Chunk using private packed types, recursively.
virtual const unsigned char * BaseContext::MergeSerialize_In (const unsigned char *_pDescriptionChunk, const char *_pendName=0L)
 Acts like Serialize_In() but keep all previous objects. So you can load and mix 2 or more context this way.
void BaseContext::ExportAsCPPTableFile (const char *_pfileToExport, const char *_pGobalTableName, bool _optimize=true)
 Export a .cpp file with 2 tables:
  • First, a table of all the class descriptors used by the context, and that can be used with RegisterClassList().
  • Then, the context serialization binary, standing as a unsigned char table.

This can be used for automatic executable generation by some implementations.


Function Documentation

void ExportAsCPPTableFile const char *  _pfileToExport,
const char *  _pGobalTableName,
bool  _optimize = true
[inherited]
 

Export a .cpp file with 2 tables:

  • First, a table of all the class descriptors used by the context, and that can be used with RegisterClassList().
  • Then, the context serialization binary, standing as a unsigned char table.

This can be used for automatic executable generation by some implementations.

Parameters:
_filePath the path of the file to write. '.c' is added.
_pGobalTableName the name of the global variable in the .c file
_optimize if true, names are flushed and preferences destroyed, in a clone.

virtual unsigned int GetSerializedDescriptionSize void   )  [virtual, inherited]
 

get the size of the whole byte chunk that will be written by Serialize_Out().

Returns:
byte size of the serialisation to do.

Reimplemented from ClassNode.

virtual const unsigned char* MergeSerialize_In const unsigned char *  _pDescriptionChunk,
const char *  _pendName = 0L
[virtual, inherited]
 

Acts like Serialize_In() but keep all previous objects. So you can load and mix 2 or more context this way.

Parameters:
_pDescriptionChunk the binary image of a context.
_pendName specify a name to add at the end of each new object.

Reimplemented from ClassNode.

virtual const unsigned char* Serialize_In const unsigned char *  _pDescriptionChunk  )  [virtual, inherited]
 

Read the object description from a byte chunk. Could crash if chunk not valid. It serializes first the class name, the number of object instancied, then the number of sub-classnodes instancied, then all object instancied, then all subclasses recursively.

Reimplemented from ClassNode.

virtual unsigned char* Serialize_Out unsigned char *  _pDescriptionChunkToFill  )  [virtual, inherited]
 

write the Current object definition to a Chunk using private packed types, recursively.

Parameters:
_pDescriptionChunkToFill the chunk where to write the objet description chunk.
Returns:
the end of the chunk written, possibly unlocated. Don't use this if you don't need it.

Reimplemented from ClassNode.


      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/