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_map.h>
10
11 namespace nx {
12 namespace sdk {
13
14 class SettingsResponse: public RefCountable<ISettingsResponse>
15 {
16 public:
17 SettingsResponse() = default;
18 SettingsResponse(Ptr<StringMap> values, Ptr<StringMap> errors = nullptr);
19
20 void setValue(std::string key, std::string value);
21 void setError(std::string key, std::string value);
22
23 void setValues(Ptr<StringMap> values);
24 void setErrors(Ptr<StringMap> errors);
25
26 protected:
27 virtual IStringMap* getValues() const override;
28 virtual IStringMap* getErrors() const override;
29
30 private:
31 Ptr<StringMap> m_values;
32 Ptr<StringMap> m_errors;
33 };
34
35 } // namespace sdk
36 } // namespace nx
nx::sdk::SettingsResponse
Definition: settings_response.h:14
nx::sdk::IStringMap
Definition: i_string_map.h:10
nx::sdk::SettingsResponse::getValues
virtual IStringMap * getValues() const override
Definition: settings_response.cpp:14
nx::sdk::Ptr
Definition: ptr.h:18
nx
Definition: apple_utils.h:6
nx::sdk::SettingsResponse::getErrors
virtual IStringMap * getErrors() const override
Definition: settings_response.cpp:22
nx::sdk::RefCountable
Definition: ref_countable.h:84