nx_metadata_sdk  1.0
Metadata SDK
settings_response.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2 
3 #pragma once
4 
5 #include <nx/sdk/ptr.h>
6 #include <nx/sdk/i_settings_response.h>
7 
8 #include <nx/sdk/helpers/ref_countable.h>
9 #include <nx/sdk/helpers/string.h>
10 #include <nx/sdk/helpers/string_map.h>
11 
12 namespace nx {
13 namespace sdk {
14 
15 class SettingsResponse: public RefCountable<ISettingsResponse>
16 {
17 public:
18  SettingsResponse() = default;
19 
22  Ptr<StringMap> errors = nullptr,
23  Ptr<String> model = nullptr);
24 
25  void setValue(std::string key, std::string value);
26  void setError(std::string key, std::string value);
27 
28  void setValues(Ptr<StringMap> values);
29  void setErrors(Ptr<StringMap> errors);
30 
31  void setModel(Ptr<String> model);
32  void setModel(std::string model);
33 
34 protected:
35  virtual IStringMap* getValues() const override;
36  virtual IStringMap* getErrors() const override;
37  virtual IString* getModel() const override;
38 
39 private:
40  Ptr<StringMap> m_values;
41  Ptr<StringMap> m_errors;
42  Ptr<String> m_model;
43 };
44 
45 } // namespace sdk
46 } // namespace nx
Definition: settings_response.h:15
Definition: i_string_map.h:10
Ptr< IString > model() const
Definition: i_settings_response.h:54
virtual IString * getModel() const override
Definition: settings_response.cpp:29
virtual IStringMap * getValues() const override
Definition: settings_response.cpp:19
Definition: ptr.h:18
Definition: i_string.h:10
Definition: apple_utils.h:6
Ptr< IStringMap > values() const
Definition: i_settings_response.h:24
virtual IStringMap * getErrors() const override
Definition: settings_response.cpp:24
Definition: ref_countable.h:84
Ptr< IStringMap > errors() const
Definition: i_settings_response.h:33