BaseContext Class Reference
[BaseContext Related Documentations]

#include <BaseContext.h>

Inherits ClassNode.

List of all members.


Detailed Description

You may also browse the BaseContext Related Documentations page sorted by theme.
Class that manages a whole database as a set of Objects inheriting class BaseObject.
BaseContext::Serialize_Out() and BaseContext::Serialize_In() will provide a quick and full persistent serialization of all features of a whole azurveda Context. When reading the context, the objects references will be resolved. In editable compilation mode you can use:

Low Level internal notes:

Definition at line 52 of file BaseContext.h.

Public Types

enum  eVedaUpdate {
  eVedaUpdate_NoUpdate = 0, eVedaUpdate_MemberIsGoingToChange, eVedaUpdate_MemberChanged, eVedaUpdate_MemberChangedBecauseOfUndo,
  eVedaUpdate_MemberDestroyed, eVedaUpdate_ObjectNew, eVedaUpdate_ObjectDestroyed, eVedaUpdate_ObjectReCreated,
  eVedaUpdate_ObjectClosed, eVedaUpdate_NewRegisteredClass
}
 enum used by BaseContext::NotifyObjectChange() to describe the notification meaning. Used by interfaces to monitor a context. More...

Public Member Functions

 BaseContext (void)
 Constructor.
virtual ~BaseContext (void)
 Destructor.
BaseObjectNewObject (const BaseObject::ClassDescription &_classDescription, char *_ObjectName=0L)
 Faktory Method to create a new Object in the context. All object members should be inited to default, then use BaseObject's Set methods in editable mode to modify them. You must pass a valid Class descriptor and an _ObjectName, or nothing, in which case a name will be computed according to the class. If an object with the same name exists, then a new name is computed. get the final name with BaseObject::GetName(); This method is only compiled in editable mode, in non-editable, Serialize_In() should construct everything.
void DestroyObject (BaseObject *_objectToDelete)
 In editable mode, it is possible to destroy an object from the context base: You got to use this method, not "delete".
void DestroyAllObjects ()
 Really destroy all object from the context. It should result a clean context like it it was just constructed empty.
void Resources_SetLinkModeToAll (bool _isLink)
 All File Resources used by objects in the context will be set as binaries Linked within the context, or not according to parameter.
virtual const unsigned char * 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 GetSerializedDescriptionSize (void)
 get the size of the whole byte chunk that will be written by Serialize_Out().
virtual unsigned char * Serialize_Out (unsigned char *_pDescriptionChunkToFill)
 write the Current object definition to a Chunk using private packed types, recursively.
virtual void SetMachine (VirtualMachine *_pMachine)
 Link a VirtualMachine object to the Context, to provide a hardware/API abstraction that objects will use. You must use this after the constructor and before serialization or any edition. the context DOES NOT manage machine object destruction. so don't destroy it 'till context is destroyed.
VirtualMachineGetMachine ()
 return the machine currently linked to the context.
virtual const char * GetClassID () const
 Each BaseType's inherited classes must explicit an ID for their class, or let use one of the super class at least through this virtual method. This is needed by GUIs to detect the types of each sub-members, and shape an interface for each Object according to their member list.
void NotifyObjectChange (eVedaUpdate _UpDateType, BaseObject *_pObjectEdited, BaseType *_ObjectMember, const unsigned char *_PreviousShapeChunk=0L, unsigned int _PreviousShapeChunkLength=0L, const unsigned char *_NewShapeChunk=0L, unsigned int _NewShapeChunkLength=0L)
 Used by BaseObjects "%Set()" member methods to notify what happened when one of the member was edited, to change its value. It is used to manage the Undo/Redo capability. You should not use this method unless you create a PackSerializable base type and code it's Set() accessor.
PackObjectReferenceGetFirstObjectReferenceInContextList ()
 used to scan the list of all object-to-object reference in this context. you can scan the list by then using PackObjectReference::GetPointerOnNextObjectReferenceInContextList()
virtual bool CanUndo ()
 test if an Undo() is currently possible. Useful to enable or disable an Undo Function in an interface.
virtual bool Undo ()
 Undo the last modification done on any object of the base, using a private "action history stack".
virtual bool CanRedo ()
 test if an Redo() is currently possible. Useful to enable or disable a Redo Function in an interface.
virtual bool Redo ()
 Redo the last undo on any object of the base, using a private "action history stack".
void FlushUndoStack ()
 Flush the Undo Stack: no undo or redo possible until next modification. Some edition events (object destruction) on the context need to completely erase the Undo stack, because the event stack coherence is broken.
void SetMaximumNumberOfUndoableEvents (unsigned int _maxNumber)
 The undo stack history can be less or more large. Default max is 0: no undo management.
void AddGUIUpdateFunction (void(*_func)(void *_GUIObjectToUpdateReturned, eVedaUpdate _updateType, BaseContext *_ContextUpdated, BaseObject *_ObjectUpdated, BaseType *_MemberUpdated), void *_GUIObjectToUpdate)
 You can specify one or more abstract GUI Views to update, by registering a function or a static method, that will be executed after each set() done on a member of a managed object, when editing, and even for a undo/redoes. This function will receive a const description of what was changed: the context concerned, the object concerned, and the object member concerned.
bool RemoveGUIUpdateFunction (void(*_func)(void *_GUIObjectToUpdateReturned, eVedaUpdate _updateType, BaseContext *_ContextUpdated, BaseObject *_ObjectUpdated, BaseType *_MemberUpdated))
 Remove an update function set by AddGUIUpdateFunction().
void UpdateAllGUI (eVedaUpdate _updateType, BaseObject *_ObjectUpdated, BaseType *_MemberUpdated)
 send an update function to all registered GUIs.
void DestroyAllIndependantObjects (BaseObject *_pObjectWhichAllOtherShouldDependOn)
 Remove all objects that are not refered directly or indirectly by the object passed.
virtual const unsigned char * 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.
virtual bool AddOneLockForThreadUse ()
 Even in editable mode, only one thread owns a context and can edit, modify, use and destroy it. Other threads can just use its objects and methods through a AddOneLockForThreadUse() RemoveOneLockForThreadUse() pair. If false is returned, it means the lock can't be done, and you should wait a bit and retry. This way, it avoids cases where an object is modified by the owner thread and used by another.(For Example, the sound management thread of the Machines use it.) Add/RemoveOneLockForThreadUse() must only be used by other threads. Don't use RemoveOneLockForThreadUse() if false is returned.
virtual void RemoveOneLockForThreadUse ()
 Even in editable mode, only one thread owns a context and can edit, modify, use and destroy it. Other threads can just use its objects and methods through a AddOneLockForThreadUse() RemoveOneLockForThreadUse() pair. This is to avoid using an object which could be modified or destroyed by the owner thread. (it was made for sound management.).
void CloneClassesAndObjects (BaseContext *_pContextToModify)
 give to _ContextToModify the same shape as this. It means, the same classes are first registered to it, and then the same objects are cloned into it.
void 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.

PackResourceGetFirstResourceInContextList ()
 Get first element of the resource list. It lists all Resources used as members in the objects. get the next with GetPointerOnNextResourceInContextList().
void CloseAllObjects ()
 Declare all objects as if each were used with BaseObject::Close(). This can be used to force a re-creation of the whole context.
BaseObjectGetBaseObject (const char *_ObjectName)
 Find an Object instancied from that class or another subclass. It is needed in non-editable mode to get a given object in the context base.
BaseObjectNewObject (const char *_ObjectName=0L)
 Factory Method to create a new Object in the context. All object members should be inited to default, then use BaseObject's Set methods in editable mode. This method is used in editable mode, but in serialize_in only mode, it does not compute a new name.
void RegisterClassList (const BaseObject::ClassDescription *const *_ppclassDescriptionList)
 Register a 0-ended list of static class descriptors ( BaseObject::ClassDescription ) from objects inherited from BaseObject, to the context, down the class tree. It is used by to register the classes in a context, before any serialization or context edition. IMPORTANT: You must register the classes in an order so that the inherited classes are set after their parents. BaseContext registers BaseObject itself in its constructor. It can look like:.
void DestroyManagedObject (BaseObject *_objectToDelete)
 In editable mode, it is possible to destroy an object from the context base: This should be only used privately by BaseContext. This version can only destroy objects managed by this ClassNode. This method is only compiled in editable mode.
virtual const char * GetDisplayClassName () const
 return an explicit name for the class the object is instancied.
virtual const char * GetDefaultObjectName () const
 return the default name that is set to new objects if not specified.
virtual const char * GetClassHelpDescription () const
 return an explicit name for the class the object is instancied.
ClassNodeGetSubClassNodeByDescription (const BaseObject::ClassDescription *_classDescription)
 Find a Son ClassNode by its static description. It looks recursively in all branches of the context.
const ClassNodeGetFirstSonClassNode () const
 get the first son classnode if not a leaf class, else NULL.Used by editors.
const ClassNodeGetNextBrotherClassNode () const
 get the next brother classnode. If we are the last broteher, NULL.Used by editors.
const PackListGetObjectList () const
 get the managed object list, in a read only way: you can get the object, edit the objects, but can't edit the list. Used by editors.
bool IsAbstract () const
 false if class is able to create objects, true if virtual.
bool IsUseful () const
 return true if this class has at least one object created, or got an inherited class that has at least an object created. false if it is not currently used. this method is used by serialize_out() to check if a class should be written.
unsigned int SetObjectsUniqueReferenceIndex (unsigned int _FirstnumberToSet=1, int _increment=1)
 reset a new unique index for PackObjectReference serialization. It does recursively in all branches of the context. This reference index is only valid during serialization. 1 is the minimum
virtual void FlushNames ()
 Set all object managed's name to "" (empty string) in order to same memory in the context. It is recursive to other sub classnodes.
BaseObjectGetBaseObjectBySerializedIndex (unsigned int _index)
 Find an Object instancied from that class or another subclass by its serialized index. Should only be used by BaseContext::Serialize_In.
void ExportCPPClassDescription (PackString &_fileTextImage) const
 tool for BaseContext::ExportAsCPPTableFile() , recursive write of a .cpp definition of a class description.
void ExportCPPClassDescriptionLine (PackString &_fileTextImage) const
 tool for BaseContext::ExportAsCPPTableFile() , recursive write of a .cpp definition of a class description.
const BaseObject::ClassDescriptionCheckClassListError () const
 If RegisterClassList() detected something wrong about the class list, the faulty class is reported here. From now on, the only possible error is: 2 class have the same serializer ID, on the same hierarchy level.
unsigned int GetChunkLength ()
 the chunk length once serialized. should be valid just after in or out serialisation, but not if the object was modified. use GetSerializedDescriptionSize() instead.
const char * GetName (void) const
 Return the name of the object as a character string.
void SetName (const char *_pname)
 set the name of the object as a character string. This is copied of course.
virtual void SetObjectThatManagesThis (BaseObject *_pManager)
 The Object this one belong to as a member. Should only be used at init.
virtual const char * ValueToString ()
 convert the value of this object to an explicit string. The object manages the string privately, so just read it or copy it. the string would be destroyed with the objects, and changed when using Set() methods. Note: this is not virtual, but each class can manage m_pValueString or not.
virtual Cell * AddElement (int _indexWhereToInsert=-1, BaseType *_pObjectToAdd=0L)
 Add a new element, at the given index.
BaseTypeGet (unsigned int _index)
 get an element at a given index.
virtual void DeleteElement (unsigned int _index)
 delete an element at a given object of the cell to destroy. does not destroy the object.
Cell * GetFirstCell () const
 FirstCell or null if empty.
Cell * GetLastCell () const
 the Last Cell or null if empty
unsigned int GetNumberOfCell () const
 return the number of cell.
void DeleteAllElements (void)
 close and destroy the whole list.
virtual unsigned int WriteFile (const char *_pFileName)
 write a serialized form, using GetSerializedDescriptionSize() and Serialize_Out().
virtual unsigned int ReadFile (const char *_pFileName)
 Try to read a serialized form, using Serialize_In().
void SetMemberName (const char *_MemberName)
 Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() returning NULL should not be edited by an interface or undo-managed. Use REGISTER_MEMBER macros family: it registers the members and use SetMemberName() automatically (or not, according to the compilation mode).
const char * GetMemberName () const
 Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() to NULL should not be edited by an interface or undo-managed. set with SetMemberName().
void SetMemberInfo (const char *_MemberInfo)
 Explicits the use of an object when used as a class member. It should explain what the member does for the object. It exists only in editable mode,and can be used by any GUI. Don't use html tags , only \n are allowed. Use REGISTER_MEMBER_INFO macro after the REGISTER_MEMBER macro in the constructors. It can be left NULL.
const char * GetMemberInfo () const
 Explicits the use of an object when used as a class member. It exists only in editable mode and can be used by any GUI. It should explain what the member does for the object.
BaseObjectGetObjectThatManagesThis ()
 If there is any, get the object that manages this one as a member.
void MakeCloneOf (BaseType &_ModelObject)
 Tool that makes an object take the values of another using serialization. Use with care: You got to clone a PackUlong with a PackULong, a PackString with a PackString: Clone Object of the same type or it will crash . A test is done at the beginning to check that for both types are the sames, if not it does nothing. however it may still crash with 2 objects from unherited classes. Also, some type like PackObjectReference, will not clone its value by copying a pointer.Reference member clonage is done with BaseObject::Clone().

Protected Types

enum  eSerializationError
 an enum used by serialization. More...

Protected Member Functions

void LinkObjectReference (PackObjectReference *_pObjectReferenceToLink)
 link a new PackObjectReference to the context list. Done at object member inition.
void UnLinkObjectReference (PackObjectReference *_pReferenceToUnlink)
 remove a PackObjectReference from the context list, at its deletion.
void LinkResource (PackResource *_pResourceToLink)
 link a new PackResource to the context list. Done at object member inition. It makes possible to keep an exact list of all managed resources.
void UnLinkResource (PackResource *_pResourceToUnlink)
 remove a PackResource from the context list, at its deletion.
void UpdateAllReferencesSerializationID ()
 Updates all reference members of the context so that the refered object 's serialization ID is took as serialized value.
void DestroyAllManagedObjects ()
 Destroy all managed object. Used to clean up the whole context.
void ProtectedDestroyAllObjects ()
 Destroy all managed object, and all object of all subclasses recursively.
void ProtectedDestroyAllIndependantObjects (BaseObject *_pObjectWhichAllOtherShouldDependOn)
 Remove all objects that are not refered directly or indirectly by the object passed.
void ProtectedAddSameClasses (BaseContext *_pContextToAddManagement)
 register management of the same classes to another context. (and so create another ClassNodes to it.) Used by BaseContext::CloneClassesAndObjects().
void RegisterSerializableMember (BaseType &_object)
 Register any serializable object to serialize for read or write operation, Use it in objects constructors. The object are serialized in the file in the same order as they are given by this method.
void BeginChangeNotification ()
 In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.
void EndChangeNotification ()
 In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

Protected Attributes

PackObjectReferencem_pFirstObjectReferenceInContextList
 The context knows a list of all object-to-object references. This list is updated when the context is edited, and is used for reference resolution at input serialization.
VirtualMachinem_pMachine
 The context knows or not a machine to use for hardware/API abstraction. This is not created or destroyed by the context.
PackResourcem_pFirstResourceInContextList
 The context knows a list of managed resource members.
PackList m_GUIUpdateFunctionList
 The list of GUI functions to update when editing this context:.
PackList m_UndoStack
 The stack of undoable/redoable events:.
PackStruct::Cellm_pCurrentUndoCell
 the cell of m_UndoStack currently focused by m_UndoStack;
unsigned int m_CurrentNumberOfUndoableEvents
 The current number of undo-able events:.
unsigned int m_MaximumNumberOfUndoableEvents
 The maximum number of undo-able events:.
const BaseObject::ClassDescriptionm_ClassDescription
 reference to the static class descriptor. This classNode manages this class in this context.
unsigned int m_NumberOfObjectInstancied
 Serializable member that stands for the number of objects instancied.
eSerializationError m_SerializationState
 this explicit the state after the last Serialize_In() done.
PackList m_BaseObjectList
 object that handle the object list: it is serialized without registration
ClassNodem_pNextBrotherClassNode
 pointer to Next class which inherit from the same upper class, or NULL (if it ends the list) .
ClassNodem_pFirstSonClassNode
 pointer to the First classNode which class managed inherit from the class managed here, or NULL.
volatile bool m_OwnerThreadIsCurrentlyManagingObjects
 Thread management: lock from the thread editing objects:.
volatile int m_TESTDEBUG_CONTEXTLOCK_ID
 test debug member, to check the lock state of a context if a crash occurs because of a bad lock.
volatile unsigned int m_NumberOfThreadsCurrentlyLockingTheContext
 Thread management: number of threads currently using objects. This should come back to zero most of the times.
const BaseObject::ClassDescriptionm_pLastClassDescWithFaultySerializer
 if a faulty class descriptor was registered, report it: It's a developper debugger feature.
PackULong mSerUlong_ChunkLength
 all named objects, ClassNode and BaseObjects, has the ability to jump over the chunk without reading it:
PackString mSerStr_ObjectName
BaseContextm_pBaseContext
 an object can belong (or not) to a BaseContext, as an object.
Cell * m_pFirstCell
 member that manages the list of members to serialize automatically.
Cell * m_pLastCell
 another member that manages the list of members to serialize automatically, and allow to grow the list by the end.
unsigned int m_NumberOfCell
 the number of cell.
BaseObjectm_pObjectThatManagesThis
 an object can belong (or not) to a BaseObject,( and to a BaseContext through it).
const char * m_pMemberName
 If used as a member in an object, the member name, or NULL (not editable member).
const char * m_pMemberInfo
 a short string explaining what's the object for in editable mode. OK if NULL (no info).
PackStringm_pValueString
 a string standing for an expression of the value of the object:
unsigned char * m_pPreviousValueShape
 used as a temp for object change notification in Begin/EndChangeNotification():
unsigned int m_PreviousValueShapeLength

Friends

class BaseObject
class BaseContextTool
class PackResource
class PackObjectReference

Classes

class  UndoCell
 the nested class used as cells of the undo stack: More...
class  UpdateFunctionListCell
 the nested class used by BaseContext::m_GUIUpdateFunctionList to manage a list of functions to send updates when the context is edited. More...


Member Enumeration Documentation

enum eSerializationError [protected, inherited]
 

an enum used by serialization.

Definition at line 315 of file ClassNode.h.

enum eVedaUpdate [inherited]
 

enum used by BaseContext::NotifyObjectChange() to describe the notification meaning. Used by interfaces to monitor a context.

Enumerator:
eVedaUpdate_NoUpdate  0 means No Update.
eVedaUpdate_MemberIsGoingToChange  Sent before a BaseObject member value change.( in order to lock the context to prevent object use from other thread.).
eVedaUpdate_MemberChanged  a member of a BaseObject just changed.
eVedaUpdate_MemberChangedBecauseOfUndo  a member of a BaseObject just changed, but because of an undo. you may treat it the same as eVedaUpdate_MemberChanged.
eVedaUpdate_MemberDestroyed  Member of object Destroyed ! Watch out, the ID of the member is a dead pointer.
eVedaUpdate_ObjectNew  new BaseObject created.
eVedaUpdate_ObjectDestroyed  BaseObject just destroyed.Watch out, the ID of the object is a dead pointer.
eVedaUpdate_ObjectReCreated  an object has just been Created; It's state has changed!
eVedaUpdate_ObjectClosed  an object has just been closed; It's state has changed!
eVedaUpdate_NewRegisteredClass  TODO: a new class has been registered to the context.

Definition at line 194 of file BaseType.h.


Member Function Documentation

virtual Cell* AddElement int  _indexWhereToInsert = -1,
BaseType _pObjectToAdd = 0L
[virtual, inherited]
 

Add a new element, at the given index.

Parameters:
_indexWhereToInsert the index where to insert. if -1, at the end.
_pObjectToAdd object to manage, or NULL to set it after on the returned cell.
Returns:
the element created.

Reimplemented in PackList, PackList_TimeBlockTrack, and PackList_TimeTrack.

void BeginChangeNotification  )  [protected, inherited]
 

In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

const BaseObject::ClassDescription* CheckClassListError  )  const [inherited]
 

If RegisterClassList() detected something wrong about the class list, the faulty class is reported here. From now on, the only possible error is: 2 class have the same serializer ID, on the same hierarchy level.

Returns:
the faulty class, or 0 if OK.

void DeleteAllElements void   )  [inherited]
 

close and destroy the whole list.

virtual void DeleteElement unsigned int  _index  )  [virtual, inherited]
 

delete an element at a given object of the cell to destroy. does not destroy the object.

Parameters:
_index index of the object to destroy.

Reimplemented in PackList.

void DestroyAllManagedObjects  )  [protected, inherited]
 

Destroy all managed object. Used to clean up the whole context.

void DestroyManagedObject BaseObject _objectToDelete  )  [inherited]
 

In editable mode, it is possible to destroy an object from the context base: This should be only used privately by BaseContext. This version can only destroy objects managed by this ClassNode. This method is only compiled in editable mode.

Parameters:
_objectToDelete The object to delete.

void EndChangeNotification  )  [protected, inherited]
 

In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

void ExportCPPClassDescription PackString _fileTextImage  )  const [inherited]
 

tool for BaseContext::ExportAsCPPTableFile() , recursive write of a .cpp definition of a class description.

Parameters:
_fileTextImage 

void ExportCPPClassDescriptionLine PackString _fileTextImage  )  const [inherited]
 

tool for BaseContext::ExportAsCPPTableFile() , recursive write of a .cpp definition of a class description.

Parameters:
_fileTextImage the source where a line is added.

virtual void FlushNames  )  [virtual, inherited]
 

Set all object managed's name to "" (empty string) in order to same memory in the context. It is recursive to other sub classnodes.

BaseType* Get unsigned int  _index  )  [inherited]
 

get an element at a given index.

Parameters:
_index the index of the element
Returns:
the element at the index or NULL if failed.

BaseObject* GetBaseObject const char *  _ObjectName  )  [inherited]
 

Find an Object instancied from that class or another subclass. It is needed in non-editable mode to get a given object in the context base.

Parameters:
_ObjectName the name of the object to get.
Returns:
the object or 0L if not found.

BaseObject* GetBaseObjectBySerializedIndex unsigned int  _index  )  [inherited]
 

Find an Object instancied from that class or another subclass by its serialized index. Should only be used by BaseContext::Serialize_In.

Parameters:
_index special number
Returns:
the object or 0L if not found.

unsigned int GetChunkLength  )  [inline, inherited]
 

the chunk length once serialized. should be valid just after in or out serialisation, but not if the object was modified. use GetSerializedDescriptionSize() instead.

Returns:
the chunk length

Definition at line 65 of file NamedObject.h.

References PackULong::Get(), and NamedObject::mSerUlong_ChunkLength.

virtual const char* GetClassHelpDescription  )  const [inline, virtual, inherited]
 

return an explicit name for the class the object is instancied.

Returns:
a const character string.

Definition at line 186 of file ClassNode.h.

References ClassNode::m_ClassDescription, and BaseObject::ClassDescription::m_ClassHelpDescription.

virtual const char* GetClassID  )  const [inline, virtual]
 

Each BaseType's inherited classes must explicit an ID for their class, or let use one of the super class at least through this virtual method. This is needed by GUIs to detect the types of each sub-members, and shape an interface for each Object according to their member list.

Returns:
a const character string, that must be unique and unchanged for all serializable base type.

Reimplemented from ClassNode.

Definition at line 165 of file BaseContext.h.

virtual const char* GetDefaultObjectName  )  const [inline, virtual, inherited]
 

return the default name that is set to new objects if not specified.

Returns:
a const character string.

Definition at line 179 of file ClassNode.h.

References ClassNode::m_ClassDescription, and BaseObject::ClassDescription::m_DefaultObjectName.

virtual const char* GetDisplayClassName  )  const [inline, virtual, inherited]
 

return an explicit name for the class the object is instancied.

Returns:
a const character string.

Definition at line 172 of file ClassNode.h.

References ClassNode::m_ClassDescription, and BaseObject::ClassDescription::m_DisplayClassName.

Cell* GetFirstCell  )  const [inline, inherited]
 

FirstCell or null if empty.

Returns:
the cell

Definition at line 171 of file PackStruct.h.

References PackStruct::m_pFirstCell.

Referenced by LightModel::GetFirstDifuseLight(), and LightModel::GetFirstLinearLight().

PackObjectReference* GetFirstObjectReferenceInContextList  )  [inline]
 

used to scan the list of all object-to-object reference in this context. you can scan the list by then using PackObjectReference::GetPointerOnNextObjectReferenceInContextList()

Returns:
the first PackObjectReference.

Definition at line 194 of file BaseContext.h.

References m_pFirstObjectReferenceInContextList.

PackResource* GetFirstResourceInContextList  )  [inline]
 

Get first element of the resource list. It lists all Resources used as members in the objects. get the next with GetPointerOnNextResourceInContextList().

Returns:
the first resource

Definition at line 364 of file BaseContext.h.

const ClassNode* GetFirstSonClassNode  )  const [inline, inherited]
 

get the first son classnode if not a leaf class, else NULL.Used by editors.

Returns:
the classnode or 0L if not found.

Definition at line 200 of file ClassNode.h.

References ClassNode::m_pFirstSonClassNode.

Cell* GetLastCell  )  const [inline, inherited]
 

the Last Cell or null if empty

Returns:
the cell

Definition at line 176 of file PackStruct.h.

References PackStruct::m_pLastCell.

Referenced by PackList_TimeTrack::GetEndTime().

const char* GetMemberInfo  )  const [inline, inherited]
 

Explicits the use of an object when used as a class member. It exists only in editable mode and can be used by any GUI. It should explain what the member does for the object.

Returns:
a short string explaining what's the object for, or NULL if not set.

Definition at line 144 of file BaseType.h.

References BaseType::m_pMemberInfo.

const char* GetMemberName  )  const [inline, inherited]
 

Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() to NULL should not be edited by an interface or undo-managed. set with SetMemberName().

Returns:
the member name or NULL

Definition at line 123 of file BaseType.h.

References BaseType::m_pMemberName.

const char* GetName void   )  const [inline, inherited]
 

Return the name of the object as a character string.

Returns:
the name.

Definition at line 71 of file NamedObject.h.

References PackString::Get(), and NamedObject::mSerStr_ObjectName.

const ClassNode* GetNextBrotherClassNode  )  const [inline, inherited]
 

get the next brother classnode. If we are the last broteher, NULL.Used by editors.

Returns:
the classnode or 0L if not found.

Definition at line 207 of file ClassNode.h.

References ClassNode::m_pNextBrotherClassNode.

unsigned int GetNumberOfCell  )  const [inline, inherited]
 

return the number of cell.

Returns:
the number of cell.

Definition at line 181 of file PackStruct.h.

References PackStruct::m_NumberOfCell.

const PackList* GetObjectList  )  const [inline, inherited]
 

get the managed object list, in a read only way: you can get the object, edit the objects, but can't edit the list. Used by editors.

Returns:
the classnode or 0L if not found.

Definition at line 214 of file ClassNode.h.

References ClassNode::m_BaseObjectList.

BaseObject* GetObjectThatManagesThis  )  [inline, inherited]
 

If there is any, get the object that manages this one as a member.

Returns:
the object that manages this one as a member, or NULL

Definition at line 170 of file BaseType.h.

References BaseType::m_pObjectThatManagesThis.

ClassNode* GetSubClassNodeByDescription const BaseObject::ClassDescription _classDescription  )  [inherited]
 

Find a Son ClassNode by its static description. It looks recursively in all branches of the context.

Parameters:
_classDescription the descripter.
Returns:
the classnode or 0L if not found.

bool IsAbstract  )  const [inline, inherited]
 

false if class is able to create objects, true if virtual.

Returns:
true or false

Definition at line 221 of file ClassNode.h.

References ClassNode::m_ClassDescription, and BaseObject::ClassDescription::m_NewMethod.

bool IsUseful  )  const [inherited]
 

return true if this class has at least one object created, or got an inherited class that has at least an object created. false if it is not currently used. this method is used by serialize_out() to check if a class should be written.

Returns:
true or false

void LinkObjectReference PackObjectReference _pObjectReferenceToLink  )  [protected]
 

link a new PackObjectReference to the context list. Done at object member inition.

Parameters:
_pObjectReferenceToLink the new reference to link.

void LinkResource PackResource _pResourceToLink  )  [protected]
 

link a new PackResource to the context list. Done at object member inition. It makes possible to keep an exact list of all managed resources.

Parameters:
_pResourceToLink the new reference to link.

void MakeCloneOf BaseType _ModelObject  )  [inherited]
 

Tool that makes an object take the values of another using serialization. Use with care: You got to clone a PackUlong with a PackULong, a PackString with a PackString: Clone Object of the same type or it will crash . A test is done at the beginning to check that for both types are the sames, if not it does nothing. however it may still crash with 2 objects from unherited classes. Also, some type like PackObjectReference, will not clone its value by copying a pointer.Reference member clonage is done with BaseObject::Clone().

Parameters:
_ModelObject the object took as a model.

BaseObject* NewObject const char *  _ObjectName = 0L  )  [inherited]
 

Factory Method to create a new Object in the context. All object members should be inited to default, then use BaseObject's Set methods in editable mode. This method is used in editable mode, but in serialize_in only mode, it does not compute a new name.

Parameters:
_ObjectName. the objectName then used to reference it. computed if NULL.
Returns:
The Object Created. 0L if class unknown or anywhat.

void ProtectedAddSameClasses BaseContext _pContextToAddManagement  )  [protected, inherited]
 

register management of the same classes to another context. (and so create another ClassNodes to it.) Used by BaseContext::CloneClassesAndObjects().

void ProtectedDestroyAllIndependantObjects BaseObject _pObjectWhichAllOtherShouldDependOn  )  [protected, inherited]
 

Remove all objects that are not refered directly or indirectly by the object passed.

Parameters:
_pObjectWhichAllOtherShouldDependOn Object Which All Other Should Depend On.

void ProtectedDestroyAllObjects  )  [protected, inherited]
 

Destroy all managed object, and all object of all subclasses recursively.

virtual unsigned int ReadFile const char *  _pFileName  )  [virtual, inherited]
 

Try to read a serialized form, using Serialize_In().

Parameters:
_pFileName the file path.
Returns:
0 if OK.

void RegisterSerializableMember BaseType _object  )  [protected, inherited]
 

Register any serializable object to serialize for read or write operation, Use it in objects constructors. The object are serialized in the file in the same order as they are given by this method.

Parameters:
_object reference to the member, which must inherit from BaseType.

void SetMemberInfo const char *  _MemberInfo  )  [inherited]
 

Explicits the use of an object when used as a class member. It should explain what the member does for the object. It exists only in editable mode,and can be used by any GUI. Don't use html tags , only \n are allowed. Use REGISTER_MEMBER_INFO macro after the REGISTER_MEMBER macro in the constructors. It can be left NULL.

Parameters:
_MemberName a short string explaining what's the object for.

void SetMemberName const char *  _MemberName  )  [inherited]
 

Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() returning NULL should not be edited by an interface or undo-managed. Use REGISTER_MEMBER macros family: it registers the members and use SetMemberName() automatically (or not, according to the compilation mode).

Parameters:
_MemberName the member name

void SetName const char *  _pname  )  [inherited]
 

set the name of the object as a character string. This is copied of course.

Parameters:
_pname teh new name

unsigned int SetObjectsUniqueReferenceIndex unsigned int  _FirstnumberToSet = 1,
int  _increment = 1
[inherited]
 

reset a new unique index for PackObjectReference serialization. It does recursively in all branches of the context. This reference index is only valid during serialization. 1 is the minimum

Parameters:
_FirstnumberToSet the first number for the first oject managed by this ClassNode.
_increment the number that is added to get the next number.
Returns:
the next available index.

virtual void SetObjectThatManagesThis BaseObject _pManager  )  [virtual, inherited]
 

The Object this one belong to as a member. Should only be used at init.

Parameters:
_pManager BaseObject

Reimplemented from BaseType.

Reimplemented in PackResource.

void UnLinkObjectReference PackObjectReference _pReferenceToUnlink  )  [protected]
 

remove a PackObjectReference from the context list, at its deletion.

Parameters:
_pReferenceToUnlink ...

void UnLinkResource PackResource _pResourceToUnlink  )  [protected]
 

remove a PackResource from the context list, at its deletion.

Parameters:
_pResourceToUnlink ...

void UpdateAllReferencesSerializationID  )  [protected]
 

Updates all reference members of the context so that the refered object 's serialization ID is took as serialized value.

virtual const char* ValueToString  )  [virtual, inherited]
 

convert the value of this object to an explicit string. The object manages the string privately, so just read it or copy it. the string would be destroyed with the objects, and changed when using Set() methods. Note: this is not virtual, but each class can manage m_pValueString or not.

Returns:
the value as a const string.

Reimplemented from BaseType.

Reimplemented in PackDynamicType.

virtual unsigned int WriteFile const char *  _pFileName  )  [virtual, inherited]
 

write a serialized form, using GetSerializedDescriptionSize() and Serialize_Out().

Parameters:
_pFileName the file path.
Returns:
0 if OK.


Member Data Documentation

PackList m_BaseObjectList [protected, inherited]
 

object that handle the object list: it is serialized without registration

Definition at line 323 of file ClassNode.h.

Referenced by ClassNode::GetObjectList().

const BaseObject::ClassDescription* m_ClassDescription [protected, inherited]
 

reference to the static class descriptor. This classNode manages this class in this context.

Definition at line 308 of file ClassNode.h.

Referenced by ClassNode::GetClassHelpDescription(), ClassNode::GetDefaultObjectName(), ClassNode::GetDisplayClassName(), and ClassNode::IsAbstract().

unsigned int m_CurrentNumberOfUndoableEvents [protected]
 

The current number of undo-able events:.

Definition at line 440 of file BaseContext.h.

PackList m_GUIUpdateFunctionList [protected]
 

The list of GUI functions to update when editing this context:.

Definition at line 414 of file BaseContext.h.

unsigned int m_MaximumNumberOfUndoableEvents [protected]
 

The maximum number of undo-able events:.

Definition at line 442 of file BaseContext.h.

unsigned int m_NumberOfCell [protected, inherited]
 

the number of cell.

Definition at line 197 of file PackStruct.h.

Referenced by PackStruct::GetNumberOfCell().

unsigned int m_NumberOfObjectInstancied [protected, inherited]
 

Serializable member that stands for the number of objects instancied.

Definition at line 311 of file ClassNode.h.

volatile unsigned int m_NumberOfThreadsCurrentlyLockingTheContext [protected, inherited]
 

Thread management: number of threads currently using objects. This should come back to zero most of the times.

Definition at line 337 of file ClassNode.h.

volatile bool m_OwnerThreadIsCurrentlyManagingObjects [protected, inherited]
 

Thread management: lock from the thread editing objects:.

Definition at line 333 of file ClassNode.h.

BaseContext* m_pBaseContext [protected, inherited]
 

an object can belong (or not) to a BaseContext, as an object.

Definition at line 93 of file NamedObject.h.

Referenced by BaseObject::GetContext().

PackStruct::Cell* m_pCurrentUndoCell [protected]
 

the cell of m_UndoStack currently focused by m_UndoStack;

Definition at line 438 of file BaseContext.h.

Cell* m_pFirstCell [protected, inherited]
 

member that manages the list of members to serialize automatically.

Definition at line 193 of file PackStruct.h.

Referenced by PackStruct::GetFirstCell().

PackObjectReference* m_pFirstObjectReferenceInContextList [protected]
 

The context knows a list of all object-to-object references. This list is updated when the context is edited, and is used for reference resolution at input serialization.

Definition at line 364 of file BaseContext.h.

Referenced by GetFirstObjectReferenceInContextList().

PackResource* m_pFirstResourceInContextList [protected]
 

The context knows a list of managed resource members.

Definition at line 376 of file BaseContext.h.

ClassNode* m_pFirstSonClassNode [protected, inherited]
 

pointer to the First classNode which class managed inherit from the class managed here, or NULL.

Definition at line 329 of file ClassNode.h.

Referenced by ClassNode::GetFirstSonClassNode().

Cell* m_pLastCell [protected, inherited]
 

another member that manages the list of members to serialize automatically, and allow to grow the list by the end.

Definition at line 195 of file PackStruct.h.

Referenced by PackStruct::GetLastCell().

const BaseObject::ClassDescription* m_pLastClassDescWithFaultySerializer [protected, inherited]
 

if a faulty class descriptor was registered, report it: It's a developper debugger feature.

Definition at line 341 of file ClassNode.h.

VirtualMachine* m_pMachine [protected]
 

The context knows or not a machine to use for hardware/API abstraction. This is not created or destroyed by the context.

Definition at line 373 of file BaseContext.h.

Referenced by GetMachine(), and SetMachine().

const char* m_pMemberInfo [protected, inherited]
 

a short string explaining what's the object for in editable mode. OK if NULL (no info).

Definition at line 259 of file BaseType.h.

Referenced by BaseType::GetMemberInfo().

const char* m_pMemberName [protected, inherited]
 

If used as a member in an object, the member name, or NULL (not editable member).

Definition at line 255 of file BaseType.h.

Referenced by BaseType::GetMemberName().

ClassNode* m_pNextBrotherClassNode [protected, inherited]
 

pointer to Next class which inherit from the same upper class, or NULL (if it ends the list) .

Definition at line 326 of file ClassNode.h.

Referenced by ClassNode::GetNextBrotherClassNode().

BaseObject* m_pObjectThatManagesThis [protected, inherited]
 

an object can belong (or not) to a BaseObject,( and to a BaseContext through it).

Definition at line 251 of file BaseType.h.

Referenced by BaseType::GetObjectThatManagesThis().

unsigned char* m_pPreviousValueShape [protected, inherited]
 

used as a temp for object change notification in Begin/EndChangeNotification():

Definition at line 269 of file BaseType.h.

PackString* m_pValueString [protected, inherited]
 

a string standing for an expression of the value of the object:

Definition at line 264 of file BaseType.h.

eSerializationError m_SerializationState [protected, inherited]
 

this explicit the state after the last Serialize_In() done.

Definition at line 320 of file ClassNode.h.

volatile int m_TESTDEBUG_CONTEXTLOCK_ID [protected, inherited]
 

test debug member, to check the lock state of a context if a crash occurs because of a bad lock.

Definition at line 335 of file ClassNode.h.

PackList m_UndoStack [protected]
 

The stack of undoable/redoable events:.

Definition at line 436 of file BaseContext.h.

PackString mSerStr_ObjectName [protected, inherited]
 

Serializable member that stands for the name of the object, and can be used to reference it in the context database. A name should not (and can't) be used twice in the whole context.

Definition at line 90 of file NamedObject.h.

Referenced by NamedObject::GetName().

PackULong mSerUlong_ChunkLength [protected, inherited]
 

all named objects, ClassNode and BaseObjects, has the ability to jump over the chunk without reading it:

Definition at line 86 of file NamedObject.h.

Referenced by NamedObject::GetChunkLength().


The documentation for this class was generated from the following file:
      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/