PropertyObject: enable creation of property

add a create-flag to the node() method of a PropertyObject,
defaulting to false to maintain existing behaviour.
This could be used to add a listener to a non-existing property
without having to write a dummy-value beforehand.

Usage:
myPropertyObject->node() returns the corresponding node or NULL if
does not exist or has not been accessed before.
myPropertyObject->node(true) returns the corresponding node, never NULL.
If the property does not exist, it will gets created.
This commit is contained in:
Torsten Dreyer 2015-05-27 20:18:22 +02:00
parent 0369d1f506
commit 0b1399479a

View File

@ -144,9 +144,9 @@ public:
#undef SG_DEF_ASSIGN_OP
SGPropertyNode* node() const
SGPropertyNode* node(bool aCreate = false) const
{
return PropertyObjectBase::node(false);
return PropertyObjectBase::node(aCreate);
}
}; // of template PropertyObject