A Property object define a static property. Compared to a dynamic one, a static property is linked with a accessor and optionaly a mutator declared in the same class than the property.

Because a Node object can store properties with any string as key, a user could decide to call a property with a key corresponding to an existing member (for example, Node's name). What should be the behaviour of this property? Instead of having a possible ambiguity between properties and other members known at compile time (or even data duplication), it was decided to implement a mechanism of static and dynamic properties transparent to the user. The static properties would reflect some members known at compile time, while dynamic properties are created during run time.

Note

the type U must be exactly the same than the type returned/required by the accessor/mutator with all the qualifiers. For example, if the accessor is const std::string& name() const, and the mutator is void setName(const std::string& name), then U as to be set to const std::string& (i.e. const reference to a std::string).

In this example, The class TestNode will have a new property name "version" which is associated with the accessor TestNode::version and the mutator TestNode::setVersion. Internally, these methods rely on the member TestNodePrivate::Version. If the member is read-only the pointer to the mutation must be set to nullptr (e.g. in the definition of the propoerty version2 for the class TestNode2).