Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner Class Referenceabstract

Value source owner abstracts the owner pointer of a value source. More...

#include <kanzi/core/property/abstract_property_type_descriptor.hpp>

Inheritance diagram for kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner:
[legend]

Public Member Functions

bool isReuseAllowed () const
 Indicates whether reuse of the value source for other property actions is allowed. More...
 
bool isValid () const
 Indicates whether the value source is valid. More...
 
virtual bool matches (void *owner) const =0
 Indicates whether the owner of a value source matches the given owner pointer. More...
 
void setValid (bool valid)
 Sets the validity status of the value source. More...
 
 ValueSourceOwner (bool valid, bool reuseAllowed)
 Constructor. More...
 
virtual ~ValueSourceOwner ()
 Virtual destructor to be implemented by inheriting classes. More...
 

Protected Attributes

bool m_reuseAllowed
 Is reuse of this value source allowed? Should be set to true to allow reuse of the value source. More...
 
bool m_valid
 Validity flag for value source. More...
 

Detailed Description

Value source owner abstracts the owner pointer of a value source.

All value sources except local values must specify an owner pointer that can identify the value source. Inheriting classes can implement specific actions for value source creation or destruction.

Constructor & Destructor Documentation

kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::ValueSourceOwner ( bool  valid,
bool  reuseAllowed 
)
inlineexplicit

Constructor.

Parameters
validValidity flag.
reuseAllowedSet to true to enable reuse by other value source operations such as setProperty.
virtual kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::~ValueSourceOwner ( )
inlinevirtual

Virtual destructor to be implemented by inheriting classes.

Member Function Documentation

virtual bool kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::matches ( void *  owner) const
pure virtual

Indicates whether the owner of a value source matches the given owner pointer.

Parameters
ownerOwner pointer.
Returns
If the owner matches, true, otherwise false.

Implemented in kanzi::AbstractPropertyTypeDescriptor::RawValueSourceOwner, and kanzi::BindingValueSourceOwner.

bool kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::isReuseAllowed ( ) const
inline

Indicates whether reuse of the value source for other property actions is allowed.

Default implementation always returns true.

Returns
True if other actions, such as setting a local property are allowed to reuse the value source.
bool kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::isValid ( ) const
inline

Indicates whether the value source is valid.

Returns
True if the value source is valid, false otherwise.
void kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::setValid ( bool  valid)
inline

Sets the validity status of the value source.

If value source is initialized as invalid, it should be set to true when first written.

Parameters
validNew validity flag.

Member Data Documentation

bool kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::m_valid
protected

Validity flag for value source.

Should be set to true by anyone writing to the value source.

bool kanzi::AbstractPropertyTypeDescriptor::ValueSourceOwner::m_reuseAllowed
protected

Is reuse of this value source allowed? Should be set to true to allow reuse of the value source.


The documentation for this class was generated from the following file: