PackList_TimeTrack Class Reference
[Base Type Serializable Classes]

#include <PackList_TimeTrack.h>

Inherits PackList.

List of all members.


Detailed Description

List that defines a set of TimeTrackElement extended objects. Each elements define when they begin, when they end, and an order number, which is different from zero if another element is in the same time range. The Goal with this class is to unify the ways to create timed lists, that can be managed by a single GUI gadget for script or spline management. It was actually made to be used in spline key list, a script manager this is only a simple serializable class.

Definition at line 24 of file PackList_TimeTrack.h.

Public Types

typedef TimeTrackElement *(* TimeTrackElementCreatorCallBackFunction )(void)
 TimeTrackElementCreatorCallBackFunction stands for a pointer to a static method that make a new TimeTrackElement.
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

 PackList_TimeTrack (TimeTrackElementCreatorCallBackFunction _func)
 Constructor. Like PAckList you specify an element constructor, and the meaning of time by elements. Dates and length are then given in seconds.
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.
virtual void SwapElements (unsigned int _indexOfElementToSwapWithNext)
 Edition tool: Exchange 2 neighbour elements in the list, if there is a next element. if index is 0, 0 will be 1 and 1 will be 0.
virtual Cell * GetCellByDate (double _dateInSecond)
 Find the Cell which match a given date in the list. It means the date is between this element and the next elment's date. Then get its TimeTrackElement with ->GetManagedObject().
virtual Cell * AddElement (int _indexWhereToInsert=-1, BaseType *_pObjectToAdd=0L)
 Override PackList to assure the list is date-sorted. Add a new element, at the given index, in edition context. in non-editable, it shouldnt be used, and serialization recreate the elements. when asked a first element, as the track must have a length, we create 2 elements: a zero timed one, and a end with default time length.
virtual void DeleteElement (BaseType *_pObWhichCellIsToDestroy)
 delete an element at a given index. It closes and destroys the object.
virtual const unsigned char * Serialize_In (const unsigned char *_pDescriptionChunk)
 Special patch in edition mode to add an init to the elements.
float GetEndTime ()
 returns the Total Time length of this media, in seconds, when played at normal speed. This is just an information about the time length of this media, and you can pass any date to ProcessMedia().
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 DeleteElement (unsigned int _index)
 delete an element at a given index. It closes and destroys the object.
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 void CloneElement (unsigned int _indexOfElementToClone)
 Insert a new element after _indexOfElementToClone, and clone it with the previous element shape. Note this can exclude some data members, like Object reference.
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.
BaseTypeGet (unsigned int _index)
 get an element at a given index.
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 Member Functions

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

Cell * m_pLastCellFound
 optimisation: GetCellByDate() keep the last searched Cell: most of the time, it is the same from a frame to another.
PackULong mSerUlong_ChunkLength
 thechunk length of the list:
BaseTypeCreatorCallBackFunction m_CreatorFunc
 Static Method Pointer to the NewObject function used to create the object that this node manage.
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 TimeTrackElement

Classes

class  TimeTrackElement
 Nested class that describe a dated element in the list. It has to be extended with new serializable members (ex: splines, scripts, music tracks..). It manages the fact that the time are kept sorted in edition mode. More...


Member Typedef Documentation

typedef TimeTrackElement*(* TimeTrackElementCreatorCallBackFunction)(void)
 

TimeTrackElementCreatorCallBackFunction stands for a pointer to a static method that make a new TimeTrackElement.

Definition at line 32 of file PackList_TimeTrack.h.


Member Enumeration Documentation

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.


Constructor & Destructor Documentation

PackList_TimeTrack TimeTrackElementCreatorCallBackFunction  _func  ) 
 

Constructor. Like PAckList you specify an element constructor, and the meaning of time by elements. Dates and length are then given in seconds.

Parameters:
_func a function that return a new object to manage as an element of the list.
_SerializeLengthBlock if false, the date in seconds is serialized by elements,if true, the length of elements is serialized.


Member Function Documentation

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

Override PackList to assure the list is date-sorted. Add a new element, at the given index, in edition context. in non-editable, it shouldnt be used, and serialization recreate the elements. when asked a first element, as the track must have a length, we create 2 elements: a zero timed one, and a end with default time length.

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

Reimplemented from PackList.

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.

virtual void CloneElement unsigned int  _indexOfElementToClone  )  [virtual, inherited]
 

Insert a new element after _indexOfElementToClone, and clone it with the previous element shape. Note this can exclude some data members, like Object reference.

Parameters:
_indexOfElementToClone any row, from zero to GetNumberOfCell()-1

void DeleteAllElements void   )  [inherited]
 

close and destroy the whole list.

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

delete an element at a given index. It closes and destroys the object.

Parameters:
_index index of the object to destroy.

Reimplemented from PackStruct.

virtual void DeleteElement BaseType _pObWhichCellIsToDestroy  )  [virtual]
 

delete an element at a given index. It closes and destroys the object.

Parameters:
_pObWhichCellIsToDestroy ob WhichCellIsToDestroy.

Reimplemented from PackList.

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.

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.

virtual Cell* GetCellByDate double  _dateInSecond  )  [virtual]
 

Find the Cell which match a given date in the list. It means the date is between this element and the next elment's date. Then get its TimeTrackElement with ->GetManagedObject().

Parameters:
_dateInSecond double date in second.
Returns:
the element, or the first elt if date before.

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 PackList.

Definition at line 50 of file PackList_TimeTrack.h.

float GetEndTime  )  [inline]
 

returns the Total Time length of this media, in seconds, when played at normal speed. This is just an information about the time length of this media, and you can pass any date to ProcessMedia().

Returns:
Total Time length of this media, in seconds, when played at normal speed. Can be used or not.

Definition at line 165 of file PackList_TimeTrack.h.

References PackStruct::GetLastCell().

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().

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 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.

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.

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.

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 PackStruct.

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.

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.

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.

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

Special patch in edition mode to add an init to the elements.

Parameters:
_pDescriptionChunk 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 PackList.

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 PackStruct.

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

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.

virtual void SwapElements unsigned int  _indexOfElementToSwapWithNext  )  [virtual]
 

Edition tool: Exchange 2 neighbour elements in the list, if there is a next element. if index is 0, 0 will be 1 and 1 will be 0.

Parameters:
_indexOfElementToSwapWithNext any row, from zero to GetNumberOfCell()-2

Reimplemented from PackList.

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

BaseTypeCreatorCallBackFunction m_CreatorFunc [protected, inherited]
 

Static Method Pointer to the NewObject function used to create the object that this node manage.

Definition at line 127 of file PackList.h.

unsigned int m_NumberOfCell [protected, inherited]
 

the number of cell.

Definition at line 197 of file PackStruct.h.

Referenced by PackStruct::GetNumberOfCell().

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().

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().

Cell* m_pLastCellFound [protected]
 

optimisation: GetCellByDate() keep the last searched Cell: most of the time, it is the same from a frame to another.

Definition at line 168 of file PackList_TimeTrack.h.

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().

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.

PackULong mSerUlong_ChunkLength [protected, inherited]
 

thechunk length of the list:

Definition at line 125 of file PackList.h.


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