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

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.

Member Function Documentation

◆ FromRaw()

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.

◆ FromString()

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 property_value< T >::Set().

◆ GetType()

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.

Definition at line 139 of file property.h.

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

◆ Set()

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, property_value< T >::FromString(), IRawMemory::GetSize(), property_value< T >::GetType(), IPropertyValue::GetType(), IS_FAILED, IS_OK, RETURN_ERROR, RETURN_IF_FAILED, RETURN_NOERROR, IRawValue::ToRaw(), and IPropertyValue::ToString().

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

◆ ToRaw()

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()

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.