31 m_oValue = oValue.m_oValue;
35 m_oValue = oValue.m_oValue;
39 m_oValue = oValue.m_oValue;
44 m_oValue = oValue.m_oValue;
63 bool operator==(
const T& oValue)
const
65 return (m_oValue == oValue);
69 return (m_oValue == oValue.GetValue());
71 const T& GetValue()
const
78 std::string strTypeOfValue;
79 std::string strTypeOfMe;
82 bool bTryStringConversion =
false;
85 if (strTypeOfValue == strTypeOfMe)
96 RETURN_IF_FAILED(FromRaw(oMem));
100 bTryStringConversion = true;
108 bTryStringConversion =
true;
115 bTryStringConversion =
true;
122 if (bTryStringConversion)
181 bool HasProperties()
const override;
182 bool HasAttachedProperties()
const override;
190 tResult DetachProperties()
override;
210 template <
typename T>
234 m_strName = oProperty.m_strName;
235 m_poSubProperties = oProperty.m_poSubProperties;
236 oProperty.m_poSubProperties =
nullptr;
237 m_poAttachedProperties = oProperty.m_poAttachedProperties;
238 oProperty.m_poAttachedProperties =
nullptr;
251 m_strName = oProperty.m_strName;
252 m_poSubProperties = oProperty.m_poSubProperties;
253 oProperty.m_poSubProperties =
nullptr;
254 m_poAttachedProperties = oProperty.m_poAttachedProperties;
255 oProperty.m_poAttachedProperties =
nullptr;
277 m_strName.Set(strName.data(), strName.size());
339 m_strName = oProperty.m_strName;
345 if (oProperty.HasAttachedProperties())
347 oProperty.GetAttachedProperties(*
this);
351 m_poSubProperties->Set(*pSubProperties.
Get());
366 virtual tResult SetValue(
const IPropertyValue& oValue)
375 "Unable to set value of property '%s'", m_strName.GetPtr());
377 if (oProp.HasProperties())
381 if (oProp.HasAttachedProperties())
383 oProp.GetAttachedProperties(*
this);
388 oProp.GetProperties(pSubProperties);
401 using ant::property_type_definition;
402 using ant::property_value;
403 using elasto::tree_node_property_type;
#define A_UTILS_ASSERT
This macro is used for platform independent assertion expressions.
#define IS_FAILED(s)
Check if result is failed.
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
#define IS_OK(s)
Check if result is OK.
A common result class usable as return value throughout.
Defintion of a property set container interface.
The IProperty interface provides methods for getting and setting property values, name of the propert...
The IPropertyValue interface provides methods for getting and setting property values.
virtual tResult ToString(IString &&strIToString) const =0
Implement to serialize the value to a textfile and/or to show it on a display.
virtual tResult GetType(IString &&strType) const =0
Retrieves the string for the property value type.
The IRawMemory interface provides methods for getting and setting memory values through abstract inte...
virtual size_t GetSize() const =0
Returns the size in bytes of the memory.
virtual tResult ToRaw(IRawMemory &&oRawValue) const =0
Implement to create a fast value copy in memory.
The IString interface provides methods for getting and setting strings through abstract interfaces.
virtual const char * Get() const =0
Gets the pointer to the current associated nullterminated-string.
tResult AttachProperties(const ucom::ant::iobject_ptr< IProperties > &pAttachedProperties) override
will set given properties to be attached
tResult SetProperties(const IProperties &oProperties) override
will copy given properties
tResult GetProperties(ucom::ant::iobject_ptr< IProperties > &pSubProperties) override
get subproperties for writing access
tResult GetProperties(ucom::ant::iobject_ptr< const IProperties > &pSubProperties) const override
get subproperties for readonly access
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 ToString(IString &&oStringValue) const
Implement to serialize the value to a textfile and/or to show it on a display.
tResult ToRaw(IRawMemory &&oToMem) const
Implement to create a fast value copy in memory.
tResult FromString(const IString &oStringValue)
Implement to deserialize the value from a textfile and/or to set by string.
tResult FromRaw(const IRawMemory &oFromMem)
Implement to create a fast value copy in memory.
Property property implementation template.
const property & operator=(const T &oValue)
value assignment
property(const T &oValue)
CTOR with value.
property & operator=(property &&oProperty)
move assignment (its not moving yet)
tResult Set(const property &oProperty)
Sets the property value and name as COPY of oProperty.
property(std_string_helper, std::string_view strName)
CTOR with name an value.
T GetValueT() const
Get the containing value.
bool operator==(const property &oProperty) const
compare operator
property_value< T > m_oValue
value type container
property(const adtf_util::cString &strName, const T &oValue)
CTOR with name an value.
property(const property &oProperty)
Copy CTOR.
bool operator==(const T &oValue) const
compare operator
property & operator=(const property &oValue)
copy assignment
property(property &&oProperty)
implementation of the move CTOR (but it is not moving yet)
Base object pointer to realize binary compatible reference counting in interface methods.
Object pointer implementation used for reference counting on objects of type IObject.
virtual T * Get() const
Get pointer to shared object.
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
#define adtf_string_intf(__string__)
The adtf_string_intf Macro helps to easily create a rvalue reference of a adtf::util::cString.
Concept template to define the Name and the conversion type for the given type TYPE.
#define RETURN_IF_FAILED_DESC(s,...)
returns if the expression returns a failed tResult and ammends the error message.