ADTF
Loading...
Searching...
No Matches
adtf::base::giant::property_variable< T > Class Template Reference

Property Variable template for the given T. A Property Variable will store a copy of a property value of the specified type T. More...

#include <configuration.h>

Inherits adtf::base::giant::cPropertyVariable.

Inherited by adtf::base::hollow::property_variable< T >.

Public Member Functions

 property_variable ()=default
 
 property_variable (const T &xValue)
 
property_variableoperator= (const T &xValue)
 
void Notify (const IProperty &oProperty) override
 
tResult GetType (IString &&strType) const override
 
const IPropertyValueGetValue () const override
 
const T & operator* () const
 
 operator const T & () const
 
bool operator== (const T &oVal)
 
bool operator!= (const T &oVal)
 
const T * operator-> ()
 
const T * operator-> () const
 
void SetValueList (const std::vector< std::pair< T, std::string > > &oValueList, bool bRestrictToValues=true)
 
void SetValidRange (const T &xMin, const T &xMax)
 
- Public Member Functions inherited from adtf::base::giant::cPropertyVariable
 cPropertyVariable ()
 
 cPropertyVariable (const cPropertyVariable &oOther)
 
 cPropertyVariable (cPropertyVariable &&oOther)
 
cPropertyVariableoperator= (const cPropertyVariable &oOther)
 
cPropertyVariableoperator= (cPropertyVariable &&oOther)
 
 ~cPropertyVariable () override
 
const ant::IPropertiesGetSubProperties () const
 
void SetDisplayName (const char *strDisplayName)
 
void SetDescription (const char *strDescription)
 
void SetFilenameExtensionFilter (const char *strFilenameExtensionFilter)
 
void SetFilenameOpenForWriting (bool bWriteMode)
 
tVoid SetResolveMacros (tBool bResolveMacros)
 
- Public Member Functions inherited from adtf::base::ant::cPropertyVariable
void SetUnregister (IMemberPropertyUnregister &oUnregister)
 

Protected Attributes

ant::property_value< property_type > m_oValue
 
- Protected Attributes inherited from adtf::base::giant::cPropertyVariable
std::unique_ptr< cImplementation > m_pImplementation
 

Additional Inherited Members

- Protected Member Functions inherited from adtf::base::giant::cPropertyVariable
ant::IPropertiesGetSubProperties ()
 
- Protected Member Functions inherited from adtf::base::ant::IPropertyObserver
 ~IPropertyObserver ()=default
 Protected destructor.
 

Detailed Description

template<typename T>
class adtf::base::giant::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!

Constructor & Destructor Documentation

◆ property_variable() [1/2]

template<typename T>
adtf::base::giant::property_variable< T >::property_variable ( )
default

Initializes the property variable with the default value of T.

◆ property_variable() [2/2]

template<typename T>
adtf::base::giant::property_variable< T >::property_variable ( const T & xValue)
inline

Initializes the property variable with the given value.

Parameters
[in]xValueThe initial value.

Member Function Documentation

◆ GetType()

template<typename T>
tResult adtf::base::giant::property_variable< T >::GetType ( IString && strType) const
inlineoverridevirtual

Returns the identifier of the type.

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

Implements adtf::base::ant::cPropertyVariable.

◆ GetValue()

template<typename T>
const IPropertyValue * adtf::base::giant::property_variable< T >::GetValue ( ) const
inlineoverridevirtual
Returns
The inital value.

Implements adtf::base::ant::cPropertyVariable.

◆ Notify()

template<typename T>
void adtf::base::giant::property_variable< T >::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 adtf::base::ant::IPropertyObserver.

Reimplemented in adtf::base::hollow::property_variable< T >, and adtf::base::property_variable< T >.

◆ SetValidRange()

template<typename T>
void adtf::base::giant::property_variable< T >::SetValidRange ( const T & xMin,
const T & xMax )
inline

Sets the valid range of values.

Parameters
[in]xMinThe minimum value.
[in]xMaxThe maximum value.

◆ SetValueList()

template<typename T>
void adtf::base::giant::property_variable< T >::SetValueList ( const std::vector< std::pair< T, std::string > > & oValueList,
bool bRestrictToValues = true )
inline

Sets a value list, that the user can choose from.

Parameters
[in]oValueListThe value list.
[in]bRestrictToValuesIf true, only values from the list are allowed to be set.

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