PropertyObject is the base class that supports setting and retrieving properties. More...
#include <kanzi/core/property/property_object.hpp>
Public Types | |
typedef intrusive_ptr< AbstractPropertyTypeDescriptor::PropertyStorage > | PropertyStoragePtr |
typedef vector< PropertyStoragePtr > | PropertyStorageContainer |
typedef PropertyStorageContainer::iterator | PropertyStorageIterator |
typedef PropertyStorageContainer::const_iterator | PropertyStorageConstIterator |
typedef PropertyStorageContainer::reverse_iterator | PropertyStorageReverseIterator |
Public Member Functions | |
PropertyObject () | |
virtual | ~PropertyObject () |
template<typename DataType > | |
void | setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
Sets the local value of a property. More... | |
void | removeKzbProperties () |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getProperty (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property. More... | |
template<typename DataType > | |
optional< typename PropertyType< DataType >::Traits::ReturnType > | getOptionalProperty (const PropertyType< DataType > &propertyType) const |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More... | |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getPropertyBase (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property disregarding modifiers. More... | |
template<typename DataType > | |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getAbstractProperty (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getAbstractPropertyBase (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
optional< typename PropertyType< DataType >::Traits::ReturnType > | getOptionalAbstractProperty (AbstractPropertyType abstractPropertyType) const |
void | setPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
bool | isPropertyFlagSet (AbstractPropertyType propertyType, uint32_t flag) const |
void | clearPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
bool | hasValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value. More... | |
bool | hasBaseValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value, disregarding modifiers. More... | |
bool | hasLocalValue (AbstractPropertyType propertyType) const |
Evaluates whether there is a local value set for the property. More... | |
bool | hasNonClassValue (AbstractPropertyType propertyType) const |
Evaluates whether there is a value of any precedence higher than class default value set for the property. More... | |
void | removeLocalValue (AbstractPropertyType propertyType) |
Removes the local value associated with the property. More... | |
void | copyLocalValue (const PropertyObject &other, AbstractPropertyType propertyType) |
Copies local value of single property from another object. More... | |
void | copyLocalValues (const PropertyObject &other) |
Copies all local values from another object. More... | |
virtual void | onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) |
Virtual function to handle property change notifications. More... | |
template<typename DataType > | |
void | addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, void *owner) |
template<typename DataType > | |
void | removePropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *owner) |
template<typename DataType > | |
void | addPropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
template<typename DataType > | |
void | removePropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
void | validatePropertyModifiers (AbstractPropertyType propertyType) |
template<typename DataType > | |
void | addPropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
template<typename DataType > | |
void | removePropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
template<typename DataType > | |
size_t | getPropertyNotificationHandlerCount (const PropertyType< DataType > &propertyType) |
Gets number of current notification handlers for given property type. More... | |
PropertyObject is the base class that supports setting and retrieving properties.
See PropertyType, AbstractPropertyType, DynamicPropertyType.
typedef intrusive_ptr<AbstractPropertyTypeDescriptor::PropertyStorage> kanzi::PropertyObject::PropertyStoragePtr |
typedef vector<PropertyStoragePtr> kanzi::PropertyObject::PropertyStorageContainer |
typedef PropertyStorageContainer::iterator kanzi::PropertyObject::PropertyStorageIterator |
typedef PropertyStorageContainer::const_iterator kanzi::PropertyObject::PropertyStorageConstIterator |
typedef PropertyStorageContainer::reverse_iterator kanzi::PropertyObject::PropertyStorageReverseIterator |
|
explicit |
|
virtual |
|
inline |
Sets the local value of a property.
propertyType | The property type identifying the property to set. |
value | The value to set. |
void kanzi::PropertyObject::removeKzbProperties | ( | ) |
|
inline |
Returns the current value of a property.
The value returned by this function is the result of the property system evaluating the inputs that can affect the values of properties. The final value is calculated by determining the base value of the property and applying existing modifiers to it.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
When the base value is determined the system applies modifiers to the value that can change the value or replace it completely. The following is the list of possible modifiers, where the order of evaluation is determined by the order the modifiers were added or applied.
If no inputs to the property value can be established the system returns the value registered in the property type metadata.
propertyType | The property type identifying the property to retrieve. |
|
inline |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value.
propertyType | The property type identifying the property to retrieve. |
value | The reference that receives the value the function evaluates. The reference is not modified if there are no inputs to the property value. |
|
inline |
Returns the current value of a property disregarding modifiers.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
Modifiers are not applied, the highest-priority base value is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
propertyType | The property type identifying the property to retrieve. |
|
inline |
|
inline |
|
inline |
|
inline |
void kanzi::PropertyObject::setPropertyFlag | ( | AbstractPropertyType | propertyType, |
uint32_t | flag | ||
) |
bool kanzi::PropertyObject::isPropertyFlagSet | ( | AbstractPropertyType | propertyType, |
uint32_t | flag | ||
) | const |
void kanzi::PropertyObject::clearPropertyFlag | ( | AbstractPropertyType | propertyType, |
uint32_t | flag | ||
) |
bool kanzi::PropertyObject::hasValue | ( | AbstractPropertyType | propertyType | ) | const |
Evaluates whether there are any inputs into the property value.
Both value sources and modifiers are taken into account.
propertyType | The property type identifying the property to evaluate. |
bool kanzi::PropertyObject::hasBaseValue | ( | AbstractPropertyType | propertyType | ) | const |
Evaluates whether there are any inputs into the property value, disregarding modifiers.
Does not take modifiers into account.
propertyType | The property type identifying the property to evaluate. |
bool kanzi::PropertyObject::hasLocalValue | ( | AbstractPropertyType | propertyType | ) | const |
Evaluates whether there is a local value set for the property.
Local values are set with setProperty or loaded from kzb.
propertyType | The property type identifying the property to evaluate. |
bool kanzi::PropertyObject::hasNonClassValue | ( | AbstractPropertyType | propertyType | ) | const |
Evaluates whether there is a value of any precedence higher than class default value set for the property.
propertyType | The property type identifying the property to evaluate. |
void kanzi::PropertyObject::removeLocalValue | ( | AbstractPropertyType | propertyType | ) |
Removes the local value associated with the property.
propertyType | The property type identifying the property to evaluate. |
void kanzi::PropertyObject::copyLocalValue | ( | const PropertyObject & | other, |
AbstractPropertyType | propertyType | ||
) |
Copies local value of single property from another object.
other | The object from which to copy the value. |
propertyType | Property type to copy. |
void kanzi::PropertyObject::copyLocalValues | ( | const PropertyObject & | other | ) |
Copies all local values from another object.
other | The object from which to copy the values. |
|
virtual |
Virtual function to handle property change notifications.
Classes deriving from Object can override this function to monitor changes of properties.
propertyType | The property type identifying the property that has changed. |
reason | The reason that caused the property notification to be invoked. |
Reimplemented in kanzi::Brush, kanzi::PropertyDrivenAnimationPlayer, kanzi::BlitRenderPass, kanzi::TextureBrush, kanzi::Material, kanzi::ColorBrush, kanzi::MaterialBrush, kanzi::DrawObjectsWithMaterialRenderPass, kanzi::ResourceDictionarySelector, and kanzi::MaterialSetupRenderPass.
|
inline |
|
inline |
|
inline |
|
inline |
void kanzi::PropertyObject::validatePropertyModifiers | ( | AbstractPropertyType | propertyType | ) |
|
inline |
|
inline |
|
inline |
Gets number of current notification handlers for given property type.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Gets property storage intrusive pointer that can be used to hold a reference until end of operation.
descriptor | Descriptor to look with. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Copy local value from property storage.
propertyStorage | Property storage to copy from. |
|
inlineprotected |
|
inlineprotected |
|
protectedvirtual |
Reimplemented in kanzi::Node.
|
protected |