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/helpers/ref_countable.h>
6 #include <nx/sdk/helpers/string.h>
7 #include <nx/sdk/helpers/string_map.h>
8 #include <nx/sdk/i_settings_response.h>
9 #include <nx/sdk/ptr.h>
10
11 namespace nx::sdk {
12
13 class SettingsResponse: public RefCountable<ISettingsResponse>
14 {
15 public:
16 SettingsResponse() = default;
17
18 SettingsResponse(
19 Ptr<StringMap> values,
20 Ptr<StringMap> errors = nullptr,
21 Ptr<String> model = nullptr);
22
23 void setValue(std::string key, std::string value);
24 void setError(std::string key, std::string value);
25
26 void setValues(Ptr<StringMap> values);
27 void setErrors(Ptr<StringMap> errors);
28
29 void setModel(Ptr<String> model);
30 void setModel(std::string model);
31
32 protected:
33 virtual IStringMap* getValues() const override;
34 virtual IStringMap* getErrors() const override;
35 virtual IString* getModel() const override;
36
37 private:
38 Ptr<StringMap> m_values;
39 Ptr<StringMap> m_errors;
40 Ptr<String> m_model;
41 };
42
43 } // namespace nx::sdk
nx::sdk::SettingsResponse
Definition: settings_response.h:13
nx::sdk::IStringMap
Definition: i_string_map.h:9
nx::sdk::ISettingsResponse::model
Ptr< IString > model() const
Definition: i_settings_response.h:52
nx::sdk::SettingsResponse::getModel
virtual IString * getModel() const override
Definition: settings_response.cpp:28
nx::sdk::SettingsResponse::getValues
virtual IStringMap * getValues() const override
Definition: settings_response.cpp:18
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::IString
Definition: i_string.h:9
nx::sdk
Definition: device_agent.h:12
nx::sdk::ISettingsResponse0::values
Ptr< IStringMap > values() const
Definition: i_settings_response.h:22
nx::sdk::SettingsResponse::getErrors
virtual IStringMap * getErrors() const override
Definition: settings_response.cpp:23
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::sdk::ISettingsResponse0::errors
Ptr< IStringMap > errors() const
Definition: i_settings_response.h:31