nx_metadata_sdk 1.0 Metadata SDK

i_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/interface.h>
6 #include <nx/sdk/result.h>
7
8 #include <nx/sdk/i_string_map.h>
9 #include <nx/sdk/i_string.h>
10 #include <nx/sdk/i_plugin_diagnostic_event.h>
11 #include <nx/sdk/i_settings_response.h>
12
13 #include <nx/sdk/analytics/i_metadata_types.h>
14 #include <nx/sdk/analytics/i_metadata_packet.h>
15
16 namespace nx {
17 namespace sdk {
18 namespace analytics {
19
20 class IEngine; //< Forward declaration for the parent object.
21
33 class IDeviceAgent: public Interface<IDeviceAgent>
34 {
35 public:
36 static auto interfaceId() { return makeId("nx::sdk::analytics::IDeviceAgent"); }
37
38 class IHandler0: public Interface<IHandler0>
39 {
40 public:
41 static auto interfaceId() { return makeId("nx::sdk::analytics::IDeviceAgent::IHandler"); }
42
43 virtual ~IHandler0() = default;
44
53 virtual void handleMetadata(IMetadataPacket* metadataPacket) = 0;
54
55 virtual void handlePluginDiagnosticEvent(IPluginDiagnosticEvent* event) = 0;
56 };
57
62 class IHandler: public Interface<IHandler, IHandler0>
63 {
64 public:
65 static auto interfaceId() { return makeId("nx::sdk::analytics::IDeviceAgent::IHandler1"); }
66
68 virtual void pushManifest(const IString* manifest) = 0;
69 };
70
72 protected: virtual void doSetSettings(
73 Result<const ISettingsResponse*>* outResult, const IStringMap* settings) = 0;
95 public: Result<const ISettingsResponse*> setSettings(const IStringMap* settings)
96 {
97 Result<const ISettingsResponse*> result;
98 doSetSettings(&result, settings);
99 return result;
100 }
101
103 protected: virtual void getPluginSideSettings(
104 Result<const ISettingsResponse*>* outResult) const = 0;
116 public: Result<const ISettingsResponse*> pluginSideSettings() const
117 {
118 Result<const ISettingsResponse*> result;
119 getPluginSideSettings(&result);
120 return result;
121 }
122
124 protected: virtual void getManifest(Result<const IString*>* outResult) const = 0;
132 public: Result<const IString*> manifest() const
133 {
134 Result<const IString*> result;
135 getManifest(&result);
136 return result;
137 }
138
145 virtual void setHandler(IHandler* handler) = 0;
146
148 protected: virtual void doSetNeededMetadataTypes(
149 Result<void>* outResult, const IMetadataTypes* neededMetadataTypes) = 0;
156 public: Result<void> setNeededMetadataTypes(const IMetadataTypes* neededMetadataTypes)
157 {
158 Result<void> result;
159 doSetNeededMetadataTypes(&result, neededMetadataTypes);
160 return result;
161 }
162 };
163 using IDeviceAgent0 = IDeviceAgent;
164
165 } // namespace analytics
166 } // namespace sdk
167 } // namespace nx
nx::sdk::IPluginDiagnosticEvent
Definition: i_plugin_diagnostic_event.h:14
nx::sdk::analytics::IDeviceAgent::IHandler0::handleMetadata
virtual void handleMetadata(IMetadataPacket *metadataPacket)=0
nx::sdk::IStringMap
Definition: i_string_map.h:10
nx::sdk::analytics::IMetadataPacket
Definition: i_metadata_packet.h:16
nx::sdk::analytics::IDeviceAgent::IHandler0
Definition: i_device_agent.h:38
nx::sdk::Interface
Definition: interface.h:49
nx::sdk::analytics::IDeviceAgent::IHandler
Definition: i_device_agent.h:62
nx::sdk::analytics::IDeviceAgent::setHandler
virtual void setHandler(IHandler *handler)=0
nx::sdk::analytics::IDeviceAgent::pluginSideSettings
Result< const ISettingsResponse * > pluginSideSettings() const
Definition: i_device_agent.h:116
nx::sdk::analytics::IMetadataTypes
Definition: i_metadata_types.h:13
nx::sdk::Result< void >
Definition: result.h:81
nx::sdk::analytics::IDeviceAgent::doSetNeededMetadataTypes
virtual void doSetNeededMetadataTypes(Result< void > *outResult, const IMetadataTypes *neededMetadataTypes)=0
nx::sdk::IString
Definition: i_string.h:10
nx::sdk::analytics::IDeviceAgent::manifest
Result< const IString * > manifest() const
Definition: i_device_agent.h:132
nx::sdk::analytics::IDeviceAgent::IHandler::pushManifest
virtual void pushManifest(const IString *manifest)=0
nx::sdk::analytics::IDeviceAgent::setNeededMetadataTypes
Result< void > setNeededMetadataTypes(const IMetadataTypes *neededMetadataTypes)
Definition: i_device_agent.h:156
nx::sdk::Result
Definition: result.h:47
nx::sdk::analytics::IDeviceAgent::getManifest
virtual void getManifest(Result< const IString *> *outResult) const =0
nx
Definition: apple_utils.h:6
nx::sdk::analytics::IDeviceAgent
Definition: i_device_agent.h:33
nx::sdk::analytics::IDeviceAgent::doSetSettings
virtual void doSetSettings(Result< const ISettingsResponse *> *outResult, const IStringMap *settings)=0
nx::sdk::analytics::IDeviceAgent::getPluginSideSettings
virtual void getPluginSideSettings(Result< const ISettingsResponse *> *outResult) const =0
nx::sdk::analytics::IDeviceAgent::setSettings
Result< const ISettingsResponse * > setSettings(const IStringMap *settings)
Definition: i_device_agent.h:95
nx::sdk::IRefCountable::makeId
static constexpr const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:77