ADTF  3.18.2
cPropertyValue
Inheritance diagram for cPropertyValue:
[legend]

Classes

struct  tUserDefined
 

Public Member Functions

template<typename T >
 cPropertyValue (const T &xValue)
 
 cPropertyValue (const char *strValue)
 
 cPropertyValue (std::string_view strValue)
 
 cPropertyValue (cPropertyValue &&)=default
 
 cPropertyValue (const cPropertyValue &)=default
 
cPropertyValueoperator= (cPropertyValue &&)=default
 
cPropertyValueoperator= (const cPropertyValue &)=default
 
tResult GetType (IString &&strType) const override
 Retrieves the string for the property value type. More...
 
tResult Set (const IPropertyValue &oValue) override
 Sets the value by a deep copy. More...
 
template<typename T >
tResult Set (const T &xValue)
 
tResult FromString (const IString &strValueAsString) override
 Implement to deserialize the value from a textfile and/or to set by string. More...
 
tResult ToString (IString &&strIToString) const override
 Implement to serialize the value to a textfile and/or to show it on a display. More...
 
tResult FromRaw (const IRawMemory &oRawValue) override
 Implement to create a fast value copy in memory. More...
 
tResult ToRaw (IRawMemory &&oRawValue) const override
 Implement to create a fast value copy in memory. More...
 
template<typename T >
T & Get ()
 
template<typename T >
const T & Get () const
 

Private Member Functions

tResult AssignRaw (const IPropertyValue &oValue)
 
tResult AssignString (const IPropertyValue &oValue)
 

Private Attributes

std::variant< bool, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float, double, std::string, tUserDefinedm_xValue
 

Additional Inherited Members

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

Detailed Description

Definition at line 25 of file properties_v2.h.

Member Function Documentation

◆ FromRaw()

tResult FromRaw ( const IRawMemory oRawValue)
overridevirtual

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.

◆ FromString()

tResult FromString ( const IString strValueAsString)
overridevirtual

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.

◆ GetType()

tResult GetType ( IString &&  strType) const
overridevirtual

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.

◆ Set()

tResult Set ( const IPropertyValue oValue)
overridevirtual

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.

◆ ToRaw()

tResult ToRaw ( IRawMemory &&  oRawValue) const
overridevirtual

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.

◆ ToString()

tResult ToString ( IString &&  strIToString) const
overridevirtual

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.