nx_metadata_sdk 1.0 Metadata 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/interface.h>
6
7 #include "i_data_packet.h"
8 #include "i_device_agent.h"
9
10 namespace nx {
11 namespace sdk {
12 namespace analytics {
13
17 class IConsumingDeviceAgent0: public Interface<IConsumingDeviceAgent0, IDeviceAgent0>
18 {
19 public:
20 static auto interfaceId() { return makeId("nx::sdk::analytics::IConsumingDeviceAgent"); }
21
23 protected: virtual void doPushDataPacket(Result<void>* outResult, IDataPacket* dataPacket) = 0;
29 public: Result<void> pushDataPacket(IDataPacket* dataPacket)
30 {
31 Result<void> result;
32 doPushDataPacket(&result, dataPacket);
33 return result;
34 }
35 };
36
37 class IConsumingDeviceAgent: public Interface<IConsumingDeviceAgent, IConsumingDeviceAgent0>
38 {
39 public:
40 static auto interfaceId() { return makeId("nx::sdk::analytics::IConsumingDeviceAgent1"); }
41
45 virtual void finalize() = 0;
46 };
47 using IConsumingDeviceAgent1 = IConsumingDeviceAgent;
48
49 } // namespace analytics
50 } // namespace sdk
51 } // namespace nx
nx::sdk::Interface
Definition: interface.h:49
nx::sdk::analytics::IConsumingDeviceAgent::finalize
virtual void finalize()=0
nx::sdk::analytics::IConsumingDeviceAgent0
Definition: i_consuming_device_agent.h:17
nx::sdk::Result< void >
Definition: result.h:81
nx
Definition: apple_utils.h:6
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:29
nx::sdk::analytics::IConsumingDeviceAgent
Definition: i_consuming_device_agent.h:37
nx::sdk::analytics::IDataPacket
Definition: i_data_packet.h:17