ADTF  3.18.1
property_variable< T >

Property Variable template for the given T. More...

Inheritance diagram for property_variable< T >:

Public Member Functions

 property_variable ()
 property_variable (const T &oValue)
 type initializing CTOR More...
void Notify (const IProperty &oProperty) override
 Implements the observer pattern. More...
tResult GetType (IString &&strType) const override
 Returns the identifier of the type. More...
const IPropertyValueGetValue () const override
const T & operator* () const
 operator const T & () const
bool operator== (const T &oVal)
bool operator!= (const T &oVal)
- Public Member Functions inherited from cPropertyVariable
void SetUnregister (IMemberPropertyUnregister &oUnregister)

Private Types

using base_type = property_value< T >
 internal base type

Additional Inherited Members

- Protected Member Functions inherited from IPropertyObserver
 ~IPropertyObserver ()=default
 Protected destructor.
- Private Member Functions inherited from property_value< T >
 property_value (const property_value &oValue)
 property_value (property_value &&oValue)
property_valueoperator= (const property_value &oValue)
property_valueoperator= (property_value &&oValue)
 property_value (const T &oValue)
void Release ()
const property_valueoperator= (const T &oValue)
bool operator== (const T &oValue) const
bool operator== (const property_value &oValue) const
const T & GetValue () const
tResult Set (const IPropertyValue &oValue)
 Sets the value by a deep copy. More...
tResult GetType (IString &&strType) const
 Retrieves the string for the property value type. More...
tResult ToRaw (IRawMemory &&oToMem) const
 Implement to create a fast value copy in memory. More...
tResult FromRaw (const IRawMemory &oFromMem)
 Implement to create a fast value copy in memory. More...
tResult ToString (IString &&oStringValue) const
 Implement to serialize the value to a textfile and/or to show it on a display. More...
tResult FromString (const IString &oStringValue)
 Implement to deserialize the value from a textfile and/or to set by string. More...
virtual ~IRawValue ()=default
 protected DTOR
- Private Attributes inherited from property_value< T >

Detailed Description

template<typename T>
class adtf::base::ant::property_variable< T >

Property Variable template for the given T.

A Property Variable will store a copy of a property value of the specified type T.

If it was registered to a property set adtf::base::ant::IProperties by IProperties::RegisterPropertyObserver the copy is automatically updated on property changes.

TThe type of the property
The notify call is not yet threadsafe!

Definition at line 100 of file configuration.h.

Constructor & Destructor Documentation

◆ property_variable()

property_variable ( const T &  oValue)

type initializing CTOR

oValue[in] initializes the property value immediately

Definition at line 113 of file configuration.h.

Member Function Documentation

◆ GetType()

tResult GetType ( IString &&  strType) const

Returns the identifier of the type.

[out]strTypeThe type identifier.
Standard result.

Implements cPropertyVariable.

Definition at line 122 of file configuration.h.

References property_value< T >::GetType().

◆ GetValue()

const IPropertyValue* GetValue ( ) const
The inital value.

Implements cPropertyVariable.

Definition at line 127 of file configuration.h.

◆ Notify()

void Notify ( const IProperty oProperty)

Implements the observer pattern.

[in]oPropertyThe changed property.
If oProperty is a subproperty, you will only receive the name of the subproperty without path or parent. Instead of implementing a adtf::base::ant::IPropertyObserver for each required property, you can also use adtf::base::hollow::property_variable::SetPropertyChangedCallback().

Implements IPropertyObserver.

Definition at line 117 of file configuration.h.

References property_value< T >::Set().