PropertyObject is the base class that supports setting and retrieving of property types. More...
#include <kanzi/core/property/property_object.hpp>
Public Types | |
typedef PropertyStorageContainer::const_iterator | PropertyStorageConstIterator |
typedef vector< PropertyStoragePtr > | PropertyStorageContainer |
typedef PropertyStorageContainer::iterator | PropertyStorageIterator |
typedef intrusive_ptr< AbstractPropertyTypeDescriptor::PropertyStorage > | PropertyStoragePtr |
typedef PropertyStorageContainer::reverse_iterator | PropertyStorageReverseIterator |
Public Member Functions | |
template<typename DataType > | |
void | addPropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
template<typename DataType > | |
void | addPropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
template<typename DataType > | |
void | addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, void *ownerPointer) |
template<typename DataType > | |
void | addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, AbstractPropertyTypeDescriptor::ValueSourceOwner *owner) |
PropertyStorageContainer::iterator | beginPropertyStorage () |
Returns the begin iterator to the internal property storage container. More... | |
PropertyStorageContainer::const_iterator | beginPropertyStorage () const |
Returns the begin iterator to the internal property storage container. More... | |
void | clearPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
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... | |
PropertyStorageContainer::iterator | endPropertyStorage () |
Returns the end iterator to the internal property storage container. More... | |
PropertyStorageContainer::const_iterator | endPropertyStorage () const |
Returns the end iterator to the internal property storage container. More... | |
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 |
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 > | |
optional< typename PropertyType< DataType >::Traits::ReturnType > | getOptionalPropertyBase (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property disregarding modifiers, 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 | getProperty (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property type. 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 > | |
size_t | getPropertyNotificationHandlerCount (const PropertyType< DataType > &propertyType) const |
Gets number of current notification handlers for given property type. 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... | |
bool | hasValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value. More... | |
bool | isPropertyFlagSet (AbstractPropertyType propertyType, uint32_t flag) const |
virtual void | onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) |
Virtual function to handle property change notifications. More... | |
PropertyObject () | |
void | removeKzbProperties (flat_set< AbstractPropertyType > *keepProperties) |
Remove all KZB properties that are not included in a given set. More... | |
void | removeKzbProperties () |
Remove all KZB properties. More... | |
template<typename DataType > | |
void | removeLocalPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *ownerPointer) |
void | removeLocalValue (AbstractPropertyType propertyType) |
Removes the local value associated with the property. More... | |
template<typename DataType > | |
void | removePropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
template<typename DataType > | |
void | removePropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
template<typename DataType > | |
void | removePropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *ownerPointer) |
template<typename DataType > | |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
template<typename DataType > | |
void | setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
Sets the local value of a property type. More... | |
void | setPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
void | validatePropertyModifiers (AbstractPropertyType propertyType) |
virtual | ~PropertyObject () |
PropertyObject is the base class that supports setting and retrieving of property types.
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 type.
propertyType | The property type identifying the property to set. |
value | The value to set. |
void kanzi::PropertyObject::removeKzbProperties | ( | flat_set< AbstractPropertyType > * | keepProperties | ) |
Remove all KZB properties that are not included in a given set.
Property types marked with KZU_PROPERTY_MANAGER_FLAG_KEEP_DURING_PATCHING are not removed.
keepProperties | Set of properties to keep. |
|
inline |
Remove all KZB properties.
Property types marked with KZU_PROPERTY_MANAGER_FLAG_KEEP_DURING_PATCHING are not removed.
|
inline |
Returns the current value of a property type.
This function returns a value that is the result of the property system evaluating the inputs that can affect the values of properties. It calculates the final value 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.
If there is no value sources or modifiers, nullopt is returned.
propertyType | The property type identifying the property to retrieve. |
|
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 |
Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value.
If there is no value sources, nullopt 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::CompositionTargetRenderPass, kanzi::RenderPass, kanzi::GatherLightsRenderPass, kanzi::OutlineEffect2D, kanzi::PropertyTargetEasingInterpolator, kanzi::MaskEffect2D, kanzi::DrawObjectsRenderPass, kanzi::Brush, kanzi::ShadowEffect2D, kanzi::PropertyDrivenAnimationPlayer, kanzi::Material, kanzi::NodeListRenderPass, kanzi::NavigationManipulatorComponent, kanzi::PanManipulatorComponent, kanzi::BlitRenderPass, kanzi::TextureBrush, kanzi::KeyManipulatorComponent, kanzi::OnPropertyChangedTrigger, kanzi::BlurEffect2D, kanzi::MultiClickManipulatorComponent, kanzi::ColorBrush, kanzi::MaterialBrush, kanzi::RenderPassView, kanzi::LongPressManipulatorComponent, kanzi::ResourceDictionarySelector, and kanzi::MaterialSetupRenderPass.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void kanzi::PropertyObject::validatePropertyModifiers | ( | AbstractPropertyType | propertyType | ) |
|
inline |
|
inline |
|
inline |
Gets number of current notification handlers for given property type.
|
inline |
Returns the begin iterator to the internal property storage container.
This function is for internal use.
|
inline |
Returns the begin iterator to the internal property storage container.
This function is for internal use.
|
inline |
Returns the end iterator to the internal property storage container.
This function is for internal use.
|
inline |
Returns the end iterator to the internal property storage container.
This function is for internal use.
|
protected |
Internally adds a property value source.
descriptor | Property type descriptor. |
valueSource | Value source to add. |
precedence | Precedence of the value source. |
ownerPointer | Raw pointer to owner for the value source. Can be 0. |
|
protected |
Internally adds a property value source.
descriptor | Property type descriptor. |
valueSource | Value source to add. |
precedence | Precedence of the value source. |
owner | Value source owner. |
|
protected |
Removes a local value from the given property storage.
Called internally by other functions.
descriptor | Descriptor owning the property storage. |
propertyStorage | Property storage to remove value from. |
|
protected |
Removes a property value source.
descriptor | Descriptor to remove from. |
valueSource | Value source installed. |
owner | Value source owner pointer. |
|
protected |
Gets the top-level value source for a given property descriptor.
The top-level value source is the last value source before property modifiers.
descriptor | Property descriptor. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Acquires a local value source entry that is free for the assignment of a value.
Value source entries with an owner may not allow the value source to be reused for assignment. In this case, an existing value source is deleted. If no applicable local value source entry is available, a new entry is constructed.
descriptor | Property type descriptor. |
propertyStorage | Property storage from which to acquire the entry. |
|
protected |
Gets the property storage for given property type descriptor.
This function is for internal use.
descriptor | Property type descriptor. |
|
protected |
Gets property storage intrusive pointer which you can use to hold a reference until the end of the operation.
descriptor | Descriptor to look with. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Finds a property type descriptor by name and data type.
The property type descriptor must exist in the property object. The name may be either an unqualified name or a full name.
name | Name to match. |
dataType | Data type to match. |
|
protected |
Like findPropertyTypeDescriptorByNameAndDataType, but only searches by matching with qualified names.
qualifiedName | Qualified name to match. |
dataType | Data type to match. |
|
protected |
Like findPropertyTypeDescriptorByNameAndDataType, but only searches by matching with unqualified names.
unqualifiedName | Unqualified name to match. |
dataType | Data type to match. |
|
protected |
|
protected |
Copy local value from property storage.
otherPropertyStorage | Property storage from which to copy. |
|
protectedvirtual |
Reimplemented in kanzi::Node.
|
protected |