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:
parent
0369d1f506
commit
0b1399479a
@ -144,9 +144,9 @@ public:
|
|||||||
|
|
||||||
#undef SG_DEF_ASSIGN_OP
|
#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
|
}; // of template PropertyObject
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user