| Linderdaum Engine: clFieldProperty Class Reference | ![]() |
#include <Property.h>
Public Member Functions | |
| clFieldProperty () | |
| virtual | ~clFieldProperty () |
| virtual bool | Load (iObject *TheObject, mlNode *Node) const |
| Load single field of an object. | |
| virtual noexport bool | Save (iObject *TheObject, mlNode **Result) const |
| Save single field of an object. | |
Public Attributes | |
| LoadFunction_t | FLoadFunction |
| SaveFunction_t | FSaveFunction |
Single field property
Each property is either a reference to a field of an object or a getter/setter pair. Only read/write properties are supported (i.e., a field or both with setter and getter) for serialization.
To access the fields or getters/setters Load and Save function are generated and added to this property description in metaclass registration.
So, a field Field in class SomeClass
class SomeClass { Property(Name = MyProperty, FieldName = Field)
Type Field; };
generates a property description
REGISTER_PROPERTY__FIELD( SomeClass, )
and a pair of loader/saver function
LoadFieldFunction_SomeClass_Field(iObject* Obj, mlNode* Node) { dynamic_cast<SomeClass*>(Obj)->Field = Linker->Load(Node); // or a converion routine instead of Linker::Load, if it is a scalar field }
Loader/Saver functions are defined using macros in PropertyMacros.h End-users of the Linderdaum Runtime should not bother writing these functions - they are automatically generated by the LSDC tool.
| clFieldProperty::clFieldProperty | ( | ) | [inline] |
| virtual clFieldProperty::~clFieldProperty | ( | ) | [inline, virtual] |
Load single field of an object.
Implements iProperty.
Save single field of an object.
Implements iProperty.