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
21 class DeviceAgent: public nx::sdk::analytics::ConsumingDeviceAgent
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
33 virtual nx::sdk::Result<const nx::sdk::ISettingsResponse*> settingsReceived() override;
34
35 virtual void doGetSettingsOnActiveSettingChange(
36 nx::sdk::Result<const nx::sdk::IActiveSettingChangedResponse*>* outResult,
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
nx::sdk::IStringMap
Definition: i_string_map.h:9
nx::sdk::IActiveSettingChangedAction
Definition: i_active_setting_changed_action.h:14
nx::kit::detail::json11::Json
Definition: json.cpp:80
json.h
nx::sdk::analytics::ConsumingDeviceAgent
Definition: consuming_device_agent.h:36
nx::sdk::IDeviceInfo
Definition: i_device_info.h:13
nx::sdk::Result
Definition: result.h:52
nx
Definition: apple_utils.h:6
nx::vms_server_plugins::analytics::stub::settings::DeviceAgent
Definition: device_agent.h:21
nx::vms_server_plugins::analytics::stub::settings::ActiveSettingsBuilder
Definition: active_settings_builder.h:20
nx::vms_server_plugins::analytics::stub::settings::Engine
Definition: engine.h:16
nx::vms_server_plugins::analytics::stub::settings::DeviceAgent::settingsReceived
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > settingsReceived() override
Definition: device_agent.cpp:66