nx_metadata_sdk 1.0 Metadata 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 getPluginSideSettings(
29 nx::sdk::Result<const nx::sdk::ISettingsResponse*>* outResult) const override;
30
31 virtual void doSetNeededMetadataTypes(
32 nx::sdk::Result<void>* outValue,
33 const nx::sdk::analytics::IMetadataTypes* neededMetadataTypes) override;
34
35 virtual std::string manifestString() const override;
36
37 virtual nx::sdk::Result<const nx::sdk::ISettingsResponse*> settingsReceived() override;
38
39 virtual void doGetSettingsOnActiveSettingChange(
40 nx::sdk::Result<const nx::sdk::IActiveSettingChangedResponse*>* outResult,
41 const nx::sdk::IActiveSettingChangedAction* activeSettingChangedAction) override;
42
43 private:
44 void dumpStringMap(
45 const char* prefix, const char* appendix, const nx::sdk::IStringMap* stringMap) const;
46
47 void dumpActiveSettingChangedAction(
48 const nx::sdk::IActiveSettingChangedAction* activeSettingChangedAction) const;
49
50 private:
51 void processActiveSettings(
52 nx::kit::Json* inOutSettingModel,
53 std::map<std::string, std::string>* inOutSettingValue);
54
55 private:
56 Engine* const m_engine;
57 ActiveSettingsBuilder m_activeSettingsBuilder;
58 };
59
60 } // namespace settings
61 } // namespace stub
62 } // namespace analytics
63 } // namespace vms_server_plugins
64 } // 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::analytics::IMetadataTypes
Definition: i_metadata_types.h:10
nx::sdk::Result< void >
Definition: result.h:82
nx::sdk::IDeviceInfo
Definition: i_device_info.h:13
nx::sdk::Result
Definition: result.h:48
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