ADTF  3.14.3
property_intf.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "rawmemory_intf.h"
9 #include "string_intf.h"
10 #include <adtfucom3/adtf_ucom3.h>
11 
12 namespace adtf
13 {
14 namespace base
15 {
16 namespace ant
17 {
18 
24  class IRawValue
25  {
26  protected:
28  virtual ~IRawValue() = default;
29 
30  public:
41  virtual tResult FromRaw(const IRawMemory& oRawValue) = 0;
51  virtual tResult ToRaw(IRawMemory&& oRawValue) const = 0;
52  };
59  class IPropertyValue : public IRawValue
60  {
61  public:
62  ~IPropertyValue() = default;
63 
64  public:
76  virtual tResult GetType(IString&& strType) const = 0;
85  virtual tResult Set(const IPropertyValue& oValue) = 0;
94  virtual tResult FromString(const IString& strValueAsString) = 0;
95 
104  virtual tResult ToString(IString&& strIToString) const = 0;
105  };
106 
107  class IProperties;
108 
117  class IProperty
118  {
119  public:
120  virtual ~IProperty() = default;
121 
122  public:
123  virtual const IPropertyValue* GetValue() const = 0;
124  virtual IPropertyValue* GetValue() = 0;
125  virtual tResult SetValue(const IPropertyValue& oValue) = 0;
126 
127  virtual tResult GetName(IString&& strName) const = 0;
128  virtual tResult SetName(const IString& strName) = 0;
129 
130  virtual tResult Set(const IProperty& oProp) = 0;
131 
132  virtual bool HasProperties() const = 0;
133  virtual bool HasAttachedProperties() const = 0;
134 
136  virtual tResult SetProperties(const IProperties& pProperties) = 0;
137  virtual tResult AttachProperties(const ucom::ant::iobject_ptr<IProperties>& pProperties) = 0;
138  virtual tResult GetAttachedProperties(IProperty& pProperty) const = 0;
139  virtual tResult DetachProperties() = 0;
140 
142  virtual tResult GetProperties(ucom::ant::iobject_ptr<IProperties>& pSubProperties) = 0;
144  virtual tResult GetProperties(ucom::ant::iobject_ptr<const IProperties>& pProperties) const = 0;
145  };
146 
152  {
153  protected:
155  ~IPropertyObserver() = default;
156  public:
161  virtual void Notify(const IProperty& oProperty) = 0;
162  };
163 
173  {
174  public:
176  ADTF_IID(IProperties, "properties.ant.base.adtf.iid");
177 
178  protected:
180  ~IProperties() = default;
181 
182  public:
187  virtual bool Exists(const char* strName) const = 0;
188 
195  virtual tResult Get(IProperties& pProperties) const = 0;
196 
203  virtual tResult Set(const IProperties& pProperties) = 0;
204 
212  virtual size_t GetSize() const = 0;
213 
224  virtual tResult GetProperty(const char* strName, IProperty& pProperty) const = 0;
225  virtual tResult SetProperty(const IProperty& pProperty) = 0;
226  virtual tResult SetPropertyByPath(const char* strParentPath, const IProperty& pProperty) = 0;
227 
228  virtual tResult RemoveProperty(const char* strName) = 0;
229 
230  virtual tResult RegisterPropertyObserver(const char* strPropertyName,
231  IPropertyObserver& oObserver) = 0;
232  virtual tResult UnregisterPropertyObserver(IPropertyObserver& oObserver) = 0;
233  };
234 
235 } //namespace ant
236 
238 using ant::IPropertyValue;
239 using ant::IProperties;
240 using ant::IProperty;
241 
242 } //namespace base
243 } //namespace adtf
Copyright © Audi Electronics Venture GmbH.
Defintion of a property set container interface.
virtual bool Exists(const char *strName) const =0
Checks if property exists by name.
ADTF_IID(IProperties, "properties.ant.base.adtf.iid")
iid defintion for IProperties
virtual tResult GetProperty(const char *strName, IProperty &pProperty) const =0
Find a property and set the content to the pProperty.
virtual tResult Set(const IProperties &pProperties)=0
The Set method should copy the the content of pProperties to the property store of this.
~IProperties()=default
Protected destructor.
virtual size_t GetSize() const =0
Return the current size (count of properties) within the store.
virtual tResult Get(IProperties &pProperties) const =0
The Get method will copy the the content of current property store to the given pProperties.
The IProperty interface provides methods for getting and setting property values, name of the propert...
virtual tResult SetProperties(const IProperties &pProperties)=0
will copy given properties
virtual tResult GetProperties(ucom::ant::iobject_ptr< const IProperties > &pProperties) const =0
get subproperties for readonly access
virtual tResult GetProperties(ucom::ant::iobject_ptr< IProperties > &pSubProperties)=0
get subproperties for writing access
Observer Interface to react on property changes.
virtual void Notify(const IProperty &oProperty)=0
Implements the observer pattern.
~IPropertyObserver()=default
Protected destructor.
The IPropertyValue interface provides methods for getting and setting property values.
Definition: property_intf.h:60
virtual tResult FromString(const IString &strValueAsString)=0
Implement to deserialize the value from a textfile and/or to set by string.
virtual tResult Set(const IPropertyValue &oValue)=0
Sets the value by a deep copy.
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...
The IRawValue interface provides methods for getting and setting raw values.
Definition: property_intf.h:25
virtual tResult ToRaw(IRawMemory &&oRawValue) const =0
Implement to create a fast value copy in memory.
virtual ~IRawValue()=default
protected DTOR
virtual tResult FromRaw(const IRawMemory &oRawValue)=0
Implement to create a fast value copy in memory.
The IString interface provides methods for getting and setting strings through abstract interfaces.
Definition: string_intf.h:24
Base class for every interface type within the uCOM.
Definition: object_intf.h:31
Base object pointer to realize binary compatible reference counting in interface methods.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Thu Jun 9 2022 by doxygen 1.9.1)