Changes between Version 3 and Version 4 of code/howto/XMLPort
- Timestamp:
- Apr 12, 2017, 11:50:29 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/howto/XMLPort
v3 v4 1 1 = HowTo: XML Loading = 2 [[TracNav(TracNav/TOC_Development)]]3 2 4 3 To make a new class XML-loadable, you have to do three things: 5 4 6 5 == 1. Derive from !BaseObject == 7 First the new class has to derive directly or indirectly from [wiki: BaseObject] (indirectly: deriving from another class following the same rule):6 First the new class has to derive directly or indirectly from [wiki:doc/BaseObject] (indirectly: deriving from another class following the same rule): 8 7 9 8 MyClass.h file: … … 33 32 34 33 == 2. Register Class and Object == 35 Additionally you have to register the new class in the framework. Use the [wiki: CoreIncludes RegisterClass] macro outside a function in a source file:34 Additionally you have to register the new class in the framework. Use the [wiki:doc/CoreIncludes RegisterClass] macro outside a function in a source file: 36 35 37 36 MyClass.cc file: … … 51 50 52 51 == 3. XMLPort == 53 At last you have to implement the [wiki: XMLPort] function for the new class:52 At last you have to implement the [wiki:doc/XMLPort] function for the new class: 54 53 {{{ 55 54 void MyClass::XMLPort(Element& xmlelement, XMLPort::Mode mode) … … 67 66 }}} 68 67 Read the related page to learn more about XMLPort and how to load parameters and subobjects: 69 * [wiki: XMLPort]68 * [wiki:doc/XMLPort]