nx_server_plugin_sdk 1.0 Server Plugin SDK

i_consuming_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/sdk/i_active_setting_changed_action.h>
6 #include <nx/sdk/i_active_setting_changed_response.h>
7 #include <nx/sdk/interface.h>
8
9 #include "i_data_packet.h"
10 #include "i_device_agent.h"
11
12 namespace nx::sdk::analytics {
13
14 class IConsumingDeviceAgent0: public Interface<IConsumingDeviceAgent0, IDeviceAgent0>
15 {
16 public:
17 static auto interfaceId() { return makeId("nx::sdk::analytics::IConsumingDeviceAgent"); }
18
20 protected: virtual void doPushDataPacket(Result<void>* outResult, IDataPacket* dataPacket) = 0;
26 public: Result<void> pushDataPacket(IDataPacket* dataPacket)
27 {
28 Result<void> result;
29 doPushDataPacket(&result, dataPacket);
30 return result;
31 }
32 };
33
34 class IConsumingDeviceAgent1: public Interface<IConsumingDeviceAgent1, IConsumingDeviceAgent0>
35 {
36 public:
37 static auto interfaceId() { return makeId("nx::sdk::analytics::IConsumingDeviceAgent1"); }
38
42 virtual void finalize() = 0;
43 };
44
48 class IConsumingDeviceAgent: public Interface<IConsumingDeviceAgent, IConsumingDeviceAgent1>
49 {
50 public:
51 static auto interfaceId() { return makeId("nx::sdk::analytics::IConsumingDeviceAgent2"); }
52
54 protected: virtual void doGetSettingsOnActiveSettingChange(
55 Result<const IActiveSettingChangedResponse*>* outResult,
56 const IActiveSettingChangedAction* activeSettingChangedAction) = 0;
68 public: Result<const IActiveSettingChangedResponse*> getSettingsOnActiveSettingChange(
69 const IActiveSettingChangedAction* activeSettingChangedAction)
70 {
71 Result<const IActiveSettingChangedResponse*> result;
72 doGetSettingsOnActiveSettingChange(&result, activeSettingChangedAction);
73 return result;
74 }
75 };
76 using IConsumingDeviceAgent2 = IConsumingDeviceAgent;
77
78 } // namespace nx::sdk::analytics
nx::sdk::IActiveSettingChangedAction
Definition: i_active_setting_changed_action.h:14
nx::sdk::analytics::IConsumingDeviceAgent1
Definition: i_consuming_device_agent.h:34
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::analytics::IConsumingDeviceAgent1::finalize
virtual void finalize()=0
nx::sdk::analytics::IConsumingDeviceAgent::getSettingsOnActiveSettingChange
Result< const IActiveSettingChangedResponse * > getSettingsOnActiveSettingChange(const IActiveSettingChangedAction *activeSettingChangedAction)
Definition: i_consuming_device_agent.h:68
nx::sdk::analytics::IConsumingDeviceAgent::doGetSettingsOnActiveSettingChange
virtual void doGetSettingsOnActiveSettingChange(Result< const IActiveSettingChangedResponse *> *outResult, const IActiveSettingChangedAction *activeSettingChangedAction)=0
nx::sdk::analytics
Definition: consuming_device_agent.cpp:25
nx::sdk::analytics::IConsumingDeviceAgent0
Definition: i_consuming_device_agent.h:14
nx::sdk::Result< void >
Definition: result.h:86
nx::sdk::Result
Definition: result.h:52
nx::sdk::analytics::IConsumingDeviceAgent0::doPushDataPacket
virtual void doPushDataPacket(Result< void > *outResult, IDataPacket *dataPacket)=0
nx::sdk::analytics::IConsumingDeviceAgent0::pushDataPacket
Result< void > pushDataPacket(IDataPacket *dataPacket)
Definition: i_consuming_device_agent.h:26
nx::sdk::analytics::IConsumingDeviceAgent
Definition: i_consuming_device_agent.h:48
nx::sdk::analytics::IDataPacket
Definition: i_data_packet.h:15