|
| #define | DECLARE_CLASS |
| | This macro should be used in declaration of classes which are inherited from the Node class (or any descendant of that) to fill RTTI information. More...
|
| |
| #define | IMPLEMENT_SDK_VCLASS2(name, parent0, parent1, displayname, instanceclass, version, streamversion) |
| |
| #define | IMPLEMENT_SDK_VCLASS(name, parent, displayname, instanceclass, streamversion) IMPLEMENT_SDK_VCLASS2( name, parent, parent, displayname, instanceclass, 0, streamversion ) |
| |
| #define | IMPLEMENT_SDK_CLASS(name, parent, displayname, instanceclass) IMPLEMENT_SDK_VCLASS2( name, parent, parent, displayname, instanceclass, 0, 0 ) |
| |
| #define | IMPLEMENT_VCLASS2(name, parent0, parent1, displayname, version) IMPLEMENT_SDK_VCLASS2( name, parent0, parent1, displayname, name, version, 0 ) |
| |
| #define | IMPLEMENT_VCLASS(name, parent, displayname, version) IMPLEMENT_SDK_VCLASS2( name, parent, parent, displayname, name, version, 0 ) |
| |
| #define | IMPLEMENT_CLASS2(name, parent0, parent1, displayname) IMPLEMENT_SDK_VCLASS2( name, parent0, parent1, displayname, name, 0, 0 ) |
| |
| #define | IMPLEMENT_CLASS(name, parent, displayname) IMPLEMENT_SDK_VCLASS2( name, parent, parent, displayname, name, 0, 0 ) |
| |
| #define | IMPLEMENT_SCLASS(name, parent, displayname, streamversion) IMPLEMENT_SDK_VCLASS2( name, parent, parent, displayname, name, 0, streamversion ) |
| | This macro is the same as the IMPLEMENT_CLASS macro, but it also accepts an additional parameter, which is the stream version for the class. More...
|
| |
| #define | IMPLEMENT_SCLASS2(name, parent0, parent1, displayname, streamversion) IMPLEMENT_SDK_VCLASS2( name, parent0, parent1, displayname, name, 0, streamversion ) |
| |
| #define | OPERATORS_NOEXCMARK(type) |
| |
| #define | OPERATORS(type) |
| |
| #define | PTROPERATORS(type) |
| |
| #define | aptr AttributePointer |
| |
|
| typedef AttributeVoid | avoid |
| |
| typedef AttributeInstance< int > | aint |
| | This type has to be used instead of the general int type. More...
|
| |
| typedef AttributeInstance< float > | afloat |
| | This type has to be used instead of the general float type. More...
|
| |
| typedef AttributeInstance< bool > | abool |
| | This type has to be used instead of the general bool type. More...
|
| |
| typedef AttributeInstance< QString > | astring |
| | This type has to be used instead of the String type. More...
|
| |
| typedef EventGate | aevent |
| |
| typedef AttributeFloatRange | afloatr |
| |
| typedef AttributeNumber | anumber |
| |
| typedef AttributeEnumeration | aenum |
| |
| typedef AttributeFilename | afilename |
| |
| typedef AttributeTextureFilename | atexturefilename |
| |
| typedef AttributeBoolCollection | aboolc |
| |
|
| MBDLL_DECL AttributeWidget * | CreateNewPtrWidget (QWidget *pParent, int iWidth, Attribute *pAttribute, const ClassDesc *pType) |
| |
| MBDLL_DECL AttributeWidget * | CreateNewBoolWidget (QWidget *pParent, int iWidth, abool *pAttribute) |
| |
| MBDLL_DECL AttributeWidget * | CreateNewIntWidget (QWidget *pParent, int iWidth, aint *pAttribute) |
| |
| template<typename type > |
| bool | operator== (const Attribute &cA, const AttributeInstance< type > &cB) |
| | This operator compares the two attributes and NOT their values. More...
|
| |
| template<typename type > |
| Stream & | operator== (Stream &s, AttributeInstance< type > &c) |
| |
| template<typename type > |
| Stream & | operator== (Stream &cStream, AttributePointer< type > &cPointer) |
| |
| AttributeWidget * | CreateNewEventWidget (QWidget *pParent, int iWidth, EventGate *pAttribute) |
| | Creates an event widget. More...
|
| |
| MBDLL_DECL Stream & | operator== (Stream &s, afloatr &a) |
| |
| MBDLL_DECL Stream & | operator== (Stream &s, aenum &a) |
| |
| MBDLL_DECL Stream & | operator== (Stream &s, afilename &a) |
| |
This macro is the same as the IMPLEMENT_CLASS macro, but it also accepts an additional parameter, which is the stream version for the class.
When the IMPLEMENT_CLASS macro is used, the local stream version for the class is default to zero. This version number will be automatically written to each stream. When the stream is loaded, you can check which version of your class implementation was writing it, so you know how to read the content of the file. Normally you increase the local version number in your class by 1, when you change something in your Serialize function implementation. For example id your serialize function looks like this:
1 IMPLEMENT_SCLASS( MyClass, Node, "MyClass", 4 );
3 void MyClass::Serialize( Stream &s )
5 s == m_bEnabled == m_sName;
And you want to add a new member variable to the stream, you change the code to the following:
1 IMPLEMENT_SCLASS( MyClass, Node, "MyClass", 5 );
3 void MyClass::Serialize( Stream &s )
5 s == m_bEnabled == m_sName;
6 if ( s.IsNewerThan( 4, this )
7 s == m_iLevel; // this path will be executed when you load/save the most recent file format
9 m_iLevel = 0; // and this path will be executed when you load an old file format
This way, you will be able to load old files without problem, and maintain compatibility.
Definition at line 144 of file node.h.