ADTF  3.15.3
property_variable< T >

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

Inheritance diagram for property_variable< T >:
[legend]

Public Member Functions

 property_variable ()
 CTOR.
 
 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
 
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 >
m_oValue
 

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.

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

Definition at line 99 of file configuration.h.

Constructor & Destructor Documentation

◆ property_variable()

property_variable ( const T &  oValue)
inline

type initializing CTOR

Parameters
oValue[in] initializes the property value immediately

Definition at line 112 of file configuration.h.

Member Function Documentation

◆ GetType()

tResult GetType ( IString &&  strType) const
inlineoverridevirtual

Returns the identifier of the type.

Parameters
[out]strTypeThe type identifier.
Returns
Standard result.

Implements cPropertyVariable.

Definition at line 121 of file configuration.h.

References property_value< T >::GetType().

◆ GetValue()

const IPropertyValue* GetValue ( ) const
inlineoverridevirtual
Returns
The inital value.

Implements cPropertyVariable.

Definition at line 126 of file configuration.h.

◆ Notify()

void Notify ( const IProperty oProperty)
inlineoverridevirtual

Implements the observer pattern.

Parameters
[in]oPropertyThe changed property.
Note
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 116 of file configuration.h.

References property_value< T >::Set().