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 ()=default
 Initializes the property variable with the default value of T.
 
 property_variable (const T &xValue)
 Initializes the property variable with the given value. More...
 
property_variableoperator= (const T &xValue)
 
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)
 
const T * operator-> ()
 
void SetValueList (const std::vector< std::pair< T, std::string >> &oValueList, bool bRestrictToValues=true)
 Sets a value list, that the user can choose from. More...
 
void SetValidRange (const T &xMin, const T &xMax)
 Sets the valid range of values. More...
 
- Public Member Functions inherited from cPropertyVariable
 cPropertyVariable ()
 The default constructor.
 
 cPropertyVariable (const cPropertyVariable &oOther)
 Copy constructor. More...
 
 cPropertyVariable (cPropertyVariable &&oOther)
 Move constructor. More...
 
cPropertyVariableoperator= (const cPropertyVariable &oOther)
 Assignment operator. More...
 
cPropertyVariableoperator= (cPropertyVariable &&oOther)
 Move assignment operator. More...
 
 ~cPropertyVariable () override
 Destructor.
 
const ant::IPropertiesGetSubProperties () const
 
void SetDisplayName (const char *strDisplayName)
 Sets the name that tools should display. More...
 
void SetDescription (const char *strDescription)
 Sets the description text associated with the Property. More...
 
void SetFilenameExtensionFilter (const char *strFilenameExtensionFilter)
 Sets optional file filters for Configuration Editor FileDialogs of cFilename and cFilenameList properties e.g. More...
 
void SetFilenameOpenForWriting (bool bWriteMode)
 Sets the write mode for the file property. More...
 
tVoid SetResolveMacros (tBool bResolveMacros)
 Sets whether or not macros should be resolved by the session manager or not. More...
 
- Public Member Functions inherited from cPropertyVariable
void SetUnregister (IMemberPropertyUnregister &oUnregister)
 

Protected Attributes

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

Private Types

typedef giant::detail::storage_type< T >::type property_type
 

Private Member Functions

const T & GetReference () const
 

Additional Inherited Members

- Protected Member Functions inherited from cPropertyVariable
ant::IPropertiesGetSubProperties ()
 
- Protected Member Functions inherited from 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!

Definition at line 600 of file configuration.h.

Constructor & Destructor Documentation

◆ property_variable()

property_variable ( const T &  xValue)
inline

Initializes the property variable with the given value.

Parameters
[in]xValueThe initial value.

Definition at line 615 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 631 of file configuration.h.

References property_value< T >::GetType().

◆ GetValue()

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

Implements cPropertyVariable.

Definition at line 636 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.

Reimplemented in property_variable< T >, and property_variable< adtf::util::cString >.

Definition at line 626 of file configuration.h.

References property_value< T >::Set().

Referenced by property_variable< T >::Notify().

◆ SetValidRange()

void SetValidRange ( const T &  xMin,
const T &  xMax 
)
inline

Sets the valid range of values.

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

Definition at line 682 of file configuration.h.

References cPropertyVariable::GetSubProperties().

◆ SetValueList()

void 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.

Definition at line 671 of file configuration.h.

References cPropertyVariable::GetSubProperties().