ADTF
Loading...
Searching...
No Matches
adtf::base::spider::cPropertyValue Class Reference

#include <properties_v2.h>

Inherits adtf::base::ant::IPropertyValue.

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
 
tResult Set (const IPropertyValue &oValue) override
 
template<typename T>
tResult Set (const T &xValue)
 
tResult FromString (const IString &strValueAsString) override
 
tResult ToString (IString &&strIToString) const override
 
tResult FromRaw (const IRawMemory &oRawValue) override
 
tResult ToRaw (IRawMemory &&oRawValue) const override
 
template<typename T>
T & Get ()
 
template<typename T>
const T & Get () const
 
tResult Validate (const IProperty &oValidationScope) const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from adtf::base::ant::IRawValue
virtual ~IRawValue ()=default
 protected DTOR
 

Detailed Description

Property value implementation for IPropertyValue. The storage type is a std::variant for all fundamental types, std::string and user defined types via tUserDefined struct.

Member Function Documentation

◆ FromRaw()

tResult adtf::base::spider::cPropertyValue::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 adtf::base::ant::IRawValue.

◆ FromString()

tResult adtf::base::spider::cPropertyValue::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 adtf::base::ant::IPropertyValue.

◆ GetType()

tResult adtf::base::spider::cPropertyValue::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 adtf::base::ant::IPropertyValue.

◆ Set()

tResult adtf::base::spider::cPropertyValue::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 adtf::base::ant::IPropertyValue.

◆ ToRaw()

tResult adtf::base::spider::cPropertyValue::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 adtf::base::ant::IRawValue.

◆ ToString()

tResult adtf::base::spider::cPropertyValue::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 adtf::base::ant::IPropertyValue.


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