Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 2 and Version 3 of code/howto/XMLPort


Ignore:
Timestamp:
Oct 4, 2015, 9:35:41 PM (9 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/howto/XMLPort

    v2 v3  
    1414{
    1515    public:
    16         MyClass();
     16        MyClass(Context* context);
     17        virtual ~MyClass();
     18
    1719        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    1820
     
    3032}}}
    3133
    32 == 2. Create a Factory ==
    33 Additionally you have to create a [wiki:Factory] for the new class. Use the [wiki:CoreIncludes CreateFactory] macro outside a function in a source file:
     34== 2. Register Class and Object ==
     35Additionally you have to register the new class in the framework. Use the [wiki:CoreIncludes RegisterClass] macro outside a function in a source file:
    3436
    3537MyClass.cc file:
     
    3739#include "MyClass.h"
    3840
    39 CreateFactory(MyClass);
     41RegisterClass(MyClass);
    4042
    4143// Constructor:
    42 MyClass::MyClass()
     44MyClass::MyClass(Context* context) : BaseObject(context) // or "OtherClass(context)"
    4345{
    4446    RegisterObject(MyClass);