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 IConsumingDeviceAgent: public Interface<IConsumingDeviceAgent, IDeviceAgent>
18 {
19 public:
20 static auto interfaceId() { return makeId("nx::sdk::analytics::IConsumingDeviceAgent"); }
21
27 protected: virtual void doPushDataPacket(Result<void>* outResult, IDataPacket* dataPacket) = 0;
28 public: Result<void> pushDataPacket(IDataPacket* dataPacket)
29 {
30 Result<void> result;
31 doPushDataPacket(&result, dataPacket);
32 return result;
33 }
34 };
35
36 } // namespace analytics
37 } // namespace sdk
38 } // namespace nx
nx::sdk::Interface
Definition: interface.h:28
nx::sdk::analytics::IConsumingDeviceAgent::doPushDataPacket
virtual void doPushDataPacket(Result< void > *outResult, IDataPacket *dataPacket)=0
nx::sdk::Result< void >
Definition: result.h:81
nx
Definition: apple_utils.h:6
nx::sdk::analytics::IConsumingDeviceAgent
Definition: i_consuming_device_agent.h:17
nx::sdk::analytics::IDataPacket
Definition: i_data_packet.h:16