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 SettingsResponse(
20 Ptr<StringMap> values,
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
nx::sdk::SettingsResponse
Definition: settings_response.h:15
nx::sdk::IStringMap
Definition: i_string_map.h:10
nx::sdk::ISettingsResponse::model
Ptr< IString > model() const
Definition: i_settings_response.h:48
nx::sdk::SettingsResponse::getModel
virtual IString * getModel() const override
Definition: settings_response.cpp:29
nx::sdk::SettingsResponse::getValues
virtual IStringMap * getValues() const override
Definition: settings_response.cpp:19
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::IString
Definition: i_string.h:10
nx
Definition: apple_utils.h:6
nx::sdk::ISettingsResponse0::values
Ptr< IStringMap > values() const
Definition: i_settings_response.h:24
nx::sdk::SettingsResponse::getErrors
virtual IStringMap * getErrors() const override
Definition: settings_response.cpp:24
nx::sdk::RefCountable
Definition: ref_countable.h:84
nx::sdk::ISettingsResponse0::errors
Ptr< IStringMap > errors() const
Definition: i_settings_response.h:33