#include <Base/Persistence.h>
#include <Core/PropertyValue.h>
#include <bitset>
Go to the source code of this file.
|
#define | TYPESYSTEM_PROPERTY_HEADER(_prop_, _parentProp_) |
|
#define | __ADD_PROPERTY(_prop_, _defaultval_, _propertyKind_) |
|
#define | LX_ADD_PROPERTY(_prop_, _defaultval_, _propertyKind_) |
|
#define | __ADD_PROPERTY_OPT(_prop_, _propertyKind_) |
|
#define | LX_ADD_PROPERTY_OPT(_prop_, _propertyKind_) |
|
#define | __ADD_PROPERTY_EMPTY(_prop_, _propertyKind_) |
|
#define | LX_ADD_PROPERTY_EMPTY(_prop_, _propertyKind_) |
|
#define | DECLARE_PROPERTY_FACTORY(_factoryName_, _property_) |
|
#define | REGISTER_PROPERTY_FACTORY(_factoryName_, _property_) Core::PropertyFactory::registry[#_property_] = (Core::PropertyFactory*)new _factoryName_(); |
|
#define | DECLARE_OPTIONAL_PROPERTY_HEADER(_class_, _parentclass_) |
|
#define | DECLARE_OPTIONAL_PROPERTY_SOURCE(_class_, _parentclass_) |
|
#define | DECL_PROPERTY_ACCESS(_name_, _type_) |
| DECL_PROPERTY and DEFINE_PROPERTY are macros used for accessing the properties via a getter and setter method. More...
|
|
#define | DEFINE_PROPERTY_ACCESS(_class_, _name_, _propname_, _type_) |
|
◆ __ADD_PROPERTY
#define __ADD_PROPERTY |
( |
|
_prop_, |
|
|
|
_defaultval_, |
|
|
|
_propertyKind_ |
|
) |
| |
Value: do \
{ \
assert(!this->_prop_.isOptional() && "Don't set a default value for an optional property!"); \
this->_prop_.enableNotify(false); \
this->_prop_.setContainer(this); \
this->_prop_.addToContainer(#_prop_); \
this->_prop_.setValue(_defaultval_); \
this->_prop_.setHasValue(true); \
this->_prop_.enableNotify(true); \
this->_prop_.setDefaultValue(true); \
this->_prop_.setPropertyKind(_propertyKind_); \
} while (0)
◆ __ADD_PROPERTY_EMPTY
#define __ADD_PROPERTY_EMPTY |
( |
|
_prop_, |
|
|
|
_propertyKind_ |
|
) |
| |
Value: do \
{ \
this->_prop_.enableNotify(false); \
this->_prop_.setContainer(this); \
this->_prop_.addToContainer(#_prop_); \
this->_prop_.enableNotify(true); \
this->_prop_.setPropertyKind(_propertyKind_); \
this->_prop_.setHasValue(false); \
} while (0)
◆ __ADD_PROPERTY_OPT
#define __ADD_PROPERTY_OPT |
( |
|
_prop_, |
|
|
|
_propertyKind_ |
|
) |
| |
Value: do \
{ \
this->_prop_.enableNotify(false); \
this->_prop_.setContainer(this); \
this->_prop_.addToContainer(#_prop_); \
this->_prop_.enableNotify(true); \
this->_prop_.setPropertyKind(_propertyKind_); \
this->_prop_.setHasValue(false); \
} while (0)
◆ DECL_PROPERTY_ACCESS
#define DECL_PROPERTY_ACCESS |
( |
|
_name_, |
|
|
|
_type_ |
|
) |
| |
Value:public: \
_type_ get##_name_() const; \
\
public: \
void set##_name_(const _type_& aValue);
DECL_PROPERTY and DEFINE_PROPERTY are macros used for accessing the properties via a getter and setter method.
- Author
- HPK
- Since
- 24.0
◆ DECLARE_OPTIONAL_PROPERTY_HEADER
#define DECLARE_OPTIONAL_PROPERTY_HEADER |
( |
|
_class_, |
|
|
|
_parentclass_ |
|
) |
| |
Value: class LX_CORE_EXPORT _class_ : public _parentclass_ \
{ \
TYPESYSTEM_HEADER(); \
\
public: \
bool isOptional() const { return true; } \
};
◆ DECLARE_OPTIONAL_PROPERTY_SOURCE
#define DECLARE_OPTIONAL_PROPERTY_SOURCE |
( |
|
_class_, |
|
|
|
_parentclass_ |
|
) |
| |
◆ DECLARE_PROPERTY_FACTORY
#define DECLARE_PROPERTY_FACTORY |
( |
|
_factoryName_, |
|
|
|
_property_ |
|
) |
| |
Value:
{ \
private: \
{ \
Core::Property* p = new _property_; \
return p; \
} \
};
◆ DEFINE_PROPERTY_ACCESS
#define DEFINE_PROPERTY_ACCESS |
( |
|
_class_, |
|
|
|
_name_, |
|
|
|
_propname_, |
|
|
|
_type_ |
|
) |
| |
Value: _type_
_class_::get##_name_()
const {
return _propname_.getValue(); } \
void _class_::set##_name_(const _type_& aValue) { _propname_.setValue(aValue); }
◆ LX_ADD_PROPERTY
#define LX_ADD_PROPERTY |
( |
|
_prop_, |
|
|
|
_defaultval_, |
|
|
|
_propertyKind_ |
|
) |
| |
Value: do \
{ \
assert(!this->_prop_.isOptional() && "Don't set a default value for an optional property!"); \
this->_prop_.enableNotify(false); \
this->_prop_.setContainer(this); \
\
this->_prop_.setValue(_defaultval_); \
this->_prop_.setHasValue(true); \
this->_prop_.enableNotify(true); \
this->_prop_.setDefaultValue(true); \
this->_prop_.setPropertyKind(_propertyKind_); \
} while (0)
◆ LX_ADD_PROPERTY_EMPTY
#define LX_ADD_PROPERTY_EMPTY |
( |
|
_prop_, |
|
|
|
_propertyKind_ |
|
) |
| |
Value: do \
{ \
this->_prop_.enableNotify(false); \
this->_prop_.setContainer(this); \
this->_prop_.enableNotify(true); \
this->_prop_.setPropertyKind(_propertyKind_); \
this->_prop_.setHasValue(false); \
this->fieldData->addField(this, #_prop_, &this->_prop_); \
} while (0)
◆ LX_ADD_PROPERTY_OPT
#define LX_ADD_PROPERTY_OPT |
( |
|
_prop_, |
|
|
|
_propertyKind_ |
|
) |
| |
Value: do \
{ \
this->_prop_.enableNotify(false); \
this->_prop_.setContainer(this); \
\
this->_prop_.enableNotify(true); \
this->_prop_.setPropertyKind(_propertyKind_); \
this->_prop_.setHasValue(false); \
this->fieldData->addField(this, #_prop_, &this->_prop_); \
} while (0)
◆ REGISTER_PROPERTY_FACTORY
◆ TYPESYSTEM_PROPERTY_HEADER
#define TYPESYSTEM_PROPERTY_HEADER |
( |
|
_prop_, |
|
|
|
_parentProp_ |
|
) |
| |
Value:public: \
static void* create(void) { return new _prop_(); } \
static void init(const char* propName) { initSubclass(_prop_::classTypeId, propName, #_parentProp_, &(_prop_::create)); } \
static
Base::Type getClassTypeId(
void) {
return _prop_::classTypeId; } \
virtual
Base::Type getTypeId(
void)
const {
return _prop_::classTypeId; } \
\
private: \
◆ DocObjectMap