ADTF
properties_v1.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include "property.h"
9 
10 #include <adtfbase/property_intf.h>
11 #include <adtfucom3/adtf_ucom3.h>
12 
13 #include <string_view>
14 
15 namespace adtf
16 {
17 namespace base
18 {
19 namespace ant
20 {
26  class cPropertiesBase : public ucom::catwo::object<IProperties>
27  {
30  public:
34  virtual ~cPropertiesBase();
43  cPropertiesBase(const IProperties& oIPropy);
47 
48  private:
50  cPropertiesBase(cPropertiesBase&& oPropy) = delete;
53 
54  public: //implement IProperties
55  bool Exists(const char* strName) const override;
56  tResult Get(IProperties& pProperties) const override;
57  tResult Set(const IProperties& pProperties) override;
58 
59  size_t GetSize() const override;
60 
61  tResult GetProperty(const char* strName, IProperty& pProperty) const override;
62  tResult SetProperty(const IProperty& pProperty) override;
63  tResult SetPropertyByPath(const char* strParentPath, const IProperty& pProperty) override;
64 
65  tResult RemoveProperty(const char* strName) override;
66 
67  public: //Simple Access
73  bool IsEqual(const IProperties& oProperties) const;
74 
75  public:
76  tResult RegisterPropertyObserver(const char* strPropertyName, IPropertyObserver& oObserver);
77  tResult UnregisterPropertyObserver(IPropertyObserver& oObserver);
78 
79  public:
88  cPropertiesBase& CreateProperty(const char* strName, const ant::IPropertyValue& oValue);
89  };
90 
95  {
96  public:
100  virtual ~cProperties();
103  cProperties(const cProperties& oPropy);
109  cProperties(const IProperties& oIPropy);
113 
114  private:
116  cProperties(cProperties&& oPropy) = delete;
118  cProperties& operator=(cProperties&& oPropy) = delete;
119  };
120 
125  public ucom::catwo::object<IProperties>
126  {
127  public:
128  bool Exists(const char* /* strName */) const override
129  {
130  return false;
131  }
132 
133  tResult GetProperty(const char* /* strName */, IProperty& /* oProperty */) const override
134  {
135  RETURN_ERROR(ERR_NOT_IMPL);
136  }
137 
138  //this needs to overwrite
139  tResult SetProperty(const IProperty& /* oProperty */) = 0;
140 
141  tResult SetPropertyByPath(const char* /* strParentPath */, const IProperty& /* pProperty */) override
142  {
143  RETURN_ERROR(ERR_NOT_IMPL);
144  }
145 
146  tResult Set(const IProperties& /* oProperties */ ) override
147  {
148  RETURN_ERROR(ERR_NOT_IMPL);
149  }
150 
151  tResult Get(IProperties& /* oProperties */ ) const override
152  {
153  RETURN_ERROR(ERR_NOT_IMPL);
154  }
155 
156  size_t GetSize() const override
157  {
158  return 0;
159  }
160 
161  tResult RemoveProperty(const char* /* strName */ ) override
162  {
163  RETURN_ERROR(ERR_NOT_IMPL);
164  }
165 
166  tResult RegisterPropertyObserver(const char* /* strPropertyName */,
167  IPropertyObserver& /* oObserver */) override
168  {
169  RETURN_ERROR(ERR_NOT_IMPL);
170  }
171 
172  tResult UnregisterPropertyObserver(IPropertyObserver& /* oObserver */) override
173  {
174  RETURN_ERROR(ERR_NOT_IMPL);
175  }
176  };
177 
178 
179 } //namespace ant
180 
182 
183 } // namespace base
184 } // namespace adtf
185 
186 #include "properties_v2.h"
187 #include "property_helper.h"
Copyright © Audi Electronics Venture GmbH.
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
Defintion of a property set container interface.
The IProperty interface provides methods for getting and setting property values, name of the propert...
Observer Interface to react on property changes.
The IPropertyValue interface provides methods for getting and setting property values.
Definition: property_intf.h:60
Base class for basic implementation of a IProperties interface.
Definition: properties_v1.h:27
cPropertiesBase(const cPropertiesBase &oPropy)
copy CTOR
cPropertiesBase & operator=(const cPropertiesBase &oPropy)
copy assignment
cPropertiesBase & operator=(cPropertiesBase &&oPropy)=delete
no move
cPropertiesBase(cPropertiesBase &&oPropy)=delete
no move
cPropertiesBase & operator=(const IProperties &oIPropy)
copy asignment
bool IsEqual(const IProperties &oProperties) const
compares the content of the current storage with the given oProperties
cPropertiesBase & CreateProperty(const char *strName, const ant::IPropertyValue &oValue)
Adds a new property and returns a reference to the sub-properties object.
cPropertiesBase(const IProperties &oIPropy)
copy CTOR tfrom interface value
A_UTILS_D(cPropertiesBase)
dptr impl
Helper to create a copy.
Property Store as IObject.
Definition: properties_v1.h:95
cProperties & operator=(const cProperties &oPropy)
assinment operator
cProperties(const IProperties &oIPropy)
copy CTOR
cProperties(cProperties &&oPropy)=delete
no move
cProperties(const cProperties &oPropy)
copy CTOR
cProperties & operator=(cProperties &&oPropy)=delete
no move
cProperties & operator=(const IProperties &oIPropy)
assinment operator
Use this template if you want to implement an ucom::ant::IObject based Interface and/or subclass an e...
Definition: object.h:379
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.