nx_metadata_sdk 1.0 Metadata SDK

engine.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/analytics/helpers/engine.h>
6 #include <nx/sdk/analytics/helpers/plugin.h>
7
8 #include "active_settings_builder.h"
9
10 namespace nx {
11 namespace vms_server_plugins {
12 namespace analytics {
13 namespace stub {
14 namespace settings {
15
16 class Engine: public nx::sdk::analytics::Engine
17 {
18 public:
19 Engine(nx::sdk::analytics::Plugin* plugin);
20 virtual ~Engine() override;
21
22 nx::sdk::analytics::Plugin* const plugin() const { return m_plugin; }
23
24 protected:
25 virtual std::string manifestString() const override;
26
27 virtual nx::sdk::Result<const nx::sdk::ISettingsResponse*> settingsReceived() override;
28
29 protected:
30 virtual void doObtainDeviceAgent(
31 nx::sdk::Result<nx::sdk::analytics::IDeviceAgent*>* outResult,
32 const nx::sdk::IDeviceInfo* deviceInfo) override;
33
34 virtual void getPluginSideSettings(
35 nx::sdk::Result<const nx::sdk::ISettingsResponse*>* outResult) const override;
36
37 virtual void doGetSettingsOnActiveSettingChange(
38 nx::sdk::Result<const nx::sdk::IActiveSettingChangedResponse*>* outResult,
39 const nx::sdk::IActiveSettingChangedAction* activeSettingChangedAction) override;
40
41 private:
42 bool processActiveSettings(
43 nx::kit::Json::object* model,
44 std::map<std::string, std::string>* values,
45 const std::vector<std::string>& settingIdsToUpdate = {}) const;
46
47 private:
48 nx::sdk::analytics::Plugin* const m_plugin;
49 ActiveSettingsBuilder m_activeSettingsBuilder;
50 };
51
52 } // namespace settings
53 } // namespace stub
54 } // namespace analytics
55 } // namespace vms_server_plugins
56 } // namespace nx
nx::sdk::IActiveSettingChangedAction
Definition: i_active_setting_changed_action.h:14
nx::vms_server_plugins::analytics::stub::settings::Engine::settingsReceived
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > settingsReceived() override
Definition: engine.cpp:135
nx::sdk::IDeviceInfo
Definition: i_device_info.h:13
nx::sdk::Result
Definition: result.h:48
nx
Definition: apple_utils.h:6
nx::sdk::analytics::Engine
Definition: engine.h:31
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::sdk::analytics::Plugin
Definition: plugin.h:21