ADTF
Loading...
Searching...
No Matches
property_intf.h
Go to the documentation of this file.
1
7#pragma once
8#include "rawmemory_intf.h"
9#include "string_intf.h"
12
13namespace adtf
14{
15namespace base
16{
17namespace ant
18{
19
26 {
27 protected:
29 virtual ~IRawValue() = default;
30
31 public:
42 virtual tResult FromRaw(const IRawMemory& oRawValue) = 0;
52 virtual tResult ToRaw(IRawMemory&& oRawValue) const = 0;
53 };
54
61 {
62 public:
63 ~IPropertyValue() = default;
64
65 public:
77 virtual tResult GetType(IString&& strType) const = 0;
86 virtual tResult Set(const IPropertyValue& oValue) = 0;
95 virtual tResult FromString(const IString& strValueAsString) = 0;
96
105 virtual tResult ToString(IString&& strIToString) const = 0;
106 };
107
108 class IProperties;
109
119 {
120 public:
121 virtual ~IProperty() = default;
122
123 public:
124 virtual const IPropertyValue* GetValue() const = 0;
125 virtual IPropertyValue* GetValue() = 0;
126 virtual tResult SetValue(const IPropertyValue& oValue) = 0;
127
128 virtual tResult GetName(IString&& strName) const = 0;
129 virtual tResult SetName(const IString& strName) = 0;
130
131 virtual tResult Set(const IProperty& oProp) = 0;
132
133 virtual bool HasProperties() const = 0;
134 virtual bool HasAttachedProperties() const = 0;
135
137 virtual tResult SetProperties(const IProperties& pProperties) = 0;
138
142 ADTF3_DEPRECATED("Attachments are deprecated, they suffer from issues with observers")
143 virtual tResult AttachProperties(const ucom::ant::iobject_ptr<IProperties>& pProperties) = 0;
144
148 ADTF3_DEPRECATED("Attachments are deprecated, they suffer from issues with observers")
149 virtual tResult GetAttachedProperties(IProperty& pProperty) const = 0;
150
154 ADTF3_DEPRECATED("Attachments are deprecated, they suffer from issues with observers")
156
158 virtual tResult GetProperties(ucom::ant::iobject_ptr<IProperties>& pSubProperties) = 0;
160 virtual tResult GetProperties(ucom::ant::iobject_ptr<const IProperties>& pProperties) const = 0;
161 };
162
172 bool operator==(const IProperty& oPropertyLeft, const IProperty& oPropertyRight);
173
183 bool operator!=(const IProperty& oPropertyLeft, const IProperty& oPropertyRight);
184
190 {
191 protected:
194 public:
201 virtual void Notify(const IProperty& oProperty) = 0;
202 };
203
213 {
214 public:
216 ADTF_IID(IProperties, "properties.ant.base.adtf.iid");
217
218 protected:
220 ~IProperties() = default;
221
222 public:
227 virtual bool Exists(const char* strName) const = 0;
228
235 virtual tResult Get(IProperties& pProperties) const = 0;
236
243 virtual tResult Set(const IProperties& pProperties) = 0;
244
252 virtual size_t GetSize() const = 0;
253
264 virtual tResult GetProperty(const char* strName, IProperty& pProperty) const = 0;
265 virtual tResult SetProperty(const IProperty& pProperty) = 0;
266 virtual tResult SetPropertyByPath(const char* strParentPath, const IProperty& pProperty) = 0;
267
268 virtual tResult RemoveProperty(const char* strName) = 0;
269
270 virtual tResult RegisterPropertyObserver(const char* strPropertyName,
271 IPropertyObserver& oObserver) = 0;
272 virtual tResult UnregisterPropertyObserver(IPropertyObserver& oObserver) = 0;
273 };
274
285 bool operator==(const IProperties& oPropertiesLeft, const IProperties& oPropertiesRight);
286
297 bool operator!=(const IProperties& oPropertiesLeft, const IProperties& oPropertiesRight);
298
299} //namespace ant
300
301namespace spider
302{
303
311tResult is_equal(const ant::IProperties& oLeftProperties, const ant::IProperties& oRightProperties);
312
320tResult is_equal(const ant::IProperty& oLeftProperty, const ant::IProperty& oRightProperty);
321
322}
323
326using ant::IProperties;
327using ant::IProperty;
328using spider::is_equal;
329
330} //namespace base
331} //namespace adtf
#define ADTF3_DEPRECATED(_depr_message_)
Definition adtf_base_deprecated.h:27
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
Definition property_intf.h:213
virtual tResult GetProperty(const char *strName, IProperty &pProperty) const =0
virtual tResult Set(const IProperties &pProperties)=0
virtual bool Exists(const char *strName) const =0
virtual tResult Get(IProperties &pProperties) const =0
ADTF_IID(IProperties, "properties.ant.base.adtf.iid")
iid defintion for IProperties
virtual size_t GetSize() const =0
~IProperties()=default
Protected destructor.
Definition property_intf.h:190
virtual void Notify(const IProperty &oProperty)=0
~IPropertyObserver()=default
Protected destructor.
Definition property_intf.h:61
virtual tResult ToString(IString &&strIToString) const =0
virtual tResult FromString(const IString &strValueAsString)=0
virtual tResult Set(const IPropertyValue &oValue)=0
virtual tResult GetType(IString &&strType) const =0
Definition property_intf.h:119
virtual tResult DetachProperties()=0
virtual tResult SetProperties(const IProperties &pProperties)=0
will copy given properties
virtual tResult GetAttachedProperties(IProperty &pProperty) const =0
virtual tResult AttachProperties(const ucom::ant::iobject_ptr< IProperties > &pProperties)=0
virtual tResult GetProperties(ucom::ant::iobject_ptr< IProperties > &pSubProperties)=0
get subproperties for writing access
Definition rawmemory_base.h:23
Definition property_intf.h:26
virtual ~IRawValue()=default
protected DTOR
virtual tResult ToRaw(IRawMemory &&oRawValue) const =0
virtual tResult FromRaw(const IRawMemory &oRawValue)=0
Definition string_intf.h:29
Definition object_intf.h:33
Namespace for all functionality of the ADTF Base SDK provided since v3.0.
Definition adtf_class_version.h:16
bool operator==(const IProperty &oPropertyLeft, const IProperty &oPropertyRight)
The equality operator returns true only if the given oPropertyLeft is the same as oPropertyRight....
bool operator!=(const IProperty &oPropertyLeft, const IProperty &oPropertyRight)
The not-equality operator returns false only if the given oPropertyLeft is exact the same as oPropert...
Namespace for all functionality of the ADTF Base SDK provided since v3.18.
Definition properties_v2.h:24
tResult is_equal(const ant::IProperties &oLeftProperties, const ant::IProperties &oRightProperties)
Namespace for the ADTF Base SDK.
Definition adtf_base_type_traits.h:13
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14