nx_server_plugin_sdk  1.0
Server Plugin SDK
device_agent.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/kit/json.h>
6 #include <nx/sdk/analytics/helpers/consuming_device_agent.h>
7 
8 #include "active_settings_builder.h"
9 #include "engine.h"
10 #include "stub_analytics_plugin_settings_ini.h"
11 
12 namespace nx { namespace sdk { class IActiveSettingChangedAction; }} //< private
13 namespace nx { namespace sdk { class IStringMap; }} //< private
14 
15 namespace nx {
16 namespace vms_server_plugins {
17 namespace analytics {
18 namespace stub {
19 namespace settings {
20 
22 {
23 public:
24  DeviceAgent(Engine* engine, const nx::sdk::IDeviceInfo* deviceInfo);
25  virtual ~DeviceAgent() override;
26 
27 protected:
28  virtual void getIntegrationSideSettings(
29  nx::sdk::Result<const nx::sdk::ISettingsResponse*>* outResult) const override;
30 
31  virtual std::string manifestString() const override;
32 
34 
35  virtual void doGetSettingsOnActiveSettingChange(
37  const nx::sdk::IActiveSettingChangedAction* activeSettingChangedAction) override;
38 
39 private:
40  void dumpStringMap(
41  const char* prefix, const char* appendix, const nx::sdk::IStringMap* stringMap) const;
42 
43  void dumpActiveSettingChangedAction(
44  const nx::sdk::IActiveSettingChangedAction* activeSettingChangedAction) const;
45 
46 private:
47  void processActiveSettings(
48  nx::kit::Json* inOutSettingModel,
49  std::map<std::string, std::string>* inOutSettingValue);
50 
51 private:
52  Engine* const m_engine;
53  ActiveSettingsBuilder m_activeSettingsBuilder;
54 };
55 
56 } // namespace settings
57 } // namespace stub
58 } // namespace analytics
59 } // namespace vms_server_plugins
60 } // namespace nx
Definition: i_string_map.h:9
Definition: i_active_setting_changed_action.h:14
Definition: json.cpp:80
Definition: consuming_device_agent.h:36
Definition: i_device_info.h:13
Definition: result.h:52
Definition: apple_utils.h:6
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > settingsReceived() override
Definition: device_agent.cpp:66