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;
21  Ptr<StringMap> errors = nullptr,
22  Ptr<String> model = nullptr);
23 
24  void setValue(std::string key, std::string value);
25  void setError(std::string key, std::string value);
26 
27  void setValues(Ptr<StringMap> values);
28  void setErrors(Ptr<StringMap> errors);
29 
30  void setModel(Ptr<String> model);
31  void setModel(std::string model);
32 
33 protected:
34  virtual IStringMap* getValues() const override;
35  virtual IStringMap* getErrors() const override;
36  virtual IString* getModel() const override;
37 
38 private:
39  Ptr<StringMap> m_values;
40  Ptr<StringMap> m_errors;
41  Ptr<String> m_model;
42 };
43 
44 } // namespace sdk
45 } // namespace nx
Definition: settings_response.h:15
Definition: i_string_map.h:10
Ptr< IString > model() const
Definition: i_settings_response.h:48
virtual IString * getModel() const override
Definition: settings_response.cpp:35
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:27
Definition: ref_countable.h:84
Ptr< IStringMap > errors() const
Definition: i_settings_response.h:33