ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
property_value< T >
Inheritance diagram for property_value< T >:
[legend]

Public Member Functions

 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.
 
tResult GetType (IString &&strType) const
 Retrieves the string for the property value type.
 
tResult ToRaw (IRawMemory &&oToMem) const
 Implement to create a fast value copy in memory.
 
tResult FromRaw (const IRawMemory &oFromMem)
 Implement to create a fast value copy in memory.
 
tResult ToString (IString &&oStringValue) const
 Implement to serialize the value to a textfile and/or to show it on a display.
 
tResult FromString (const IString &oStringValue)
 Implement to deserialize the value from a textfile and/or to set by string.
 

Protected Attributes

m_oValue
 

Additional Inherited Members

- Protected Member Functions inherited from IRawValue
virtual ~IRawValue ()=default
 protected DTOR
 

Detailed Description

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

Definition at line 21 of file property.h.

Constructor & Destructor Documentation

◆ property_value() [1/4]

template<typename T>
property_value ( )
inline

Definition at line 26 of file property.h.

◆ property_value() [2/4]

template<typename T>
property_value ( const property_value< T > & oValue)
inline

Definition at line 29 of file property.h.

◆ property_value() [3/4]

template<typename T>
property_value ( property_value< T > && oValue)
inline

Definition at line 33 of file property.h.

◆ ~property_value()

template<typename T>
virtual ~property_value ( )
inlinevirtual

Definition at line 47 of file property.h.

◆ property_value() [4/4]

template<typename T>
property_value ( const T & oValue)
inline

Definition at line 50 of file property.h.

Member Function Documentation

◆ FromRaw()

template<typename T>
tResult FromRaw ( const IRawMemory & oRawValue)
inlinevirtual

Implement to create a fast value copy in memory.

Usually this method is called if types are equal implementation is within the same binary!

Parameters
oRawValue[in] Memory representation of the value
Return values
ERR_NOERRORSuccessfully copied.
ERR_MEMORYYou have to return ERR_MEMORY if size of oRawValue does not fit !!
any_errorDepends on the implementation.

Implements IRawValue.

Definition at line 148 of file property.h.

Referenced by Set().

◆ FromString()

template<typename T>
tResult FromString ( const IString & strValueAsString)
inlinevirtual

Implement to deserialize the value from a textfile and/or to set by string.

Parameters
strValueAsString[in] String to deserialize from
Return values
ERR_NOERRORSuccessfully set to strType.
any_errorDepends on the implementation.

Implements IPropertyValue.

Definition at line 160 of file property.h.

References IString::Get().

Referenced by Set().

◆ GetType()

template<typename T>
tResult GetType ( IString && strType) const
inlinevirtual

Retrieves the string for the property value type.

Usually this is defined by the property_type_definition::TYPE_NAME.

Parameters
strType[out] The type name.
See also
property_type_definition
Return values
ERR_NOERRORSuccessfully set to strType.

Implements IPropertyValue.

Reimplemented in property_variable< T >.

Definition at line 139 of file property.h.

Referenced by property_variable< T >::GetType(), and Set().

◆ GetValue()

template<typename T>
const T & GetValue ( ) const
inline

Definition at line 71 of file property.h.

◆ operator=() [1/3]

template<typename T>
property_value & operator= ( const property_value< T > & oValue)
inline

Definition at line 37 of file property.h.

◆ operator=() [2/3]

template<typename T>
const property_value & operator= ( const T & oValue)
inline

Definition at line 58 of file property.h.

◆ operator=() [3/3]

template<typename T>
property_value & operator= ( property_value< T > && oValue)
inline

Definition at line 42 of file property.h.

◆ operator==() [1/2]

template<typename T>
bool operator== ( const property_value< T > & oValue) const
inline

Definition at line 67 of file property.h.

◆ operator==() [2/2]

template<typename T>
bool operator== ( const T & oValue) const
inline

Definition at line 63 of file property.h.

◆ Release()

template<typename T>
void Release ( )
inline

Definition at line 54 of file property.h.

◆ Set()

template<typename T>
tResult Set ( const IPropertyValue & oValue)
inlinevirtual

Sets the value by a deep copy.

Parameters
oValue[in] Value to set.
Return values
ERR_NOERRORSuccessfully set to strType.
any_errorDepends on the implementation. I.e. ERR_INVALID_TYPE if IPropertyValue::GetType is different and no conversion implemented.

Implements IPropertyValue.

Definition at line 76 of file property.h.

References A_UTILS_ASSERT, adtf_string_intf, FromRaw(), FromString(), IRawMemory::GetSize(), IPropertyValue::GetType(), GetType(), IS_FAILED, IS_OK, RETURN_ERROR, RETURN_IF_FAILED, RETURN_NOERROR, IRawValue::ToRaw(), and IPropertyValue::ToString().

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

◆ ToRaw()

template<typename T>
tResult ToRaw ( IRawMemory && oRawValue) const
inlinevirtual

Implement to create a fast value copy in memory.

Usually this method is called if types are equal implementation is within the same binary!

Parameters
oRawValue[oRawValue] copy of the memory representation of the value
Return values
ERR_NOERRORSuccessfully copied.
any_errorDepends on the implementation. You are adviced to return the return value of IRawMemory::Set.

Implements IRawValue.

Definition at line 144 of file property.h.

◆ ToString()

template<typename T>
tResult ToString ( IString && strIToString) const
inlinevirtual

Implement to serialize the value to a textfile and/or to show it on a display.

Parameters
strIToString[out] serialized string value (should be human readable for displays!!)
Return values
ERR_NOERRORSuccessfully set to strType.
any_errorDepends on the implementation.

Implements IPropertyValue.

Definition at line 153 of file property.h.

References RETURN_IF_FAILED, and RETURN_NOERROR.

Member Data Documentation

◆ m_oValue

template<typename T>
T m_oValue
protected

Definition at line 24 of file property.h.