nx_metadata_sdk 1.0 Metadata SDK

i_action.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 <stdint.h>
6
7 #include <nx/sdk/analytics/i_object_track_info.h>
8 #include <nx/sdk/i_string_map.h>
9 #include <nx/sdk/interface.h>
10 #include <nx/sdk/uuid.h>
11
12 namespace nx::sdk::analytics {
13
17 class IAction: public Interface<IAction>
18 {
19 public:
20 static auto interfaceId() { return makeId("nx::sdk::analytics::IAction"); }
21
23 virtual const char* actionId() const = 0;
24
26 protected: virtual void getObjectTrackId(Uuid* outValue) const = 0;
28 public: Uuid objectTrackId() const { Uuid value; getObjectTrackId(&value); return value; }
29
31 protected: virtual void getDeviceId(Uuid* outValue) const = 0;
33 public: Uuid deviceId() const { Uuid value; getDeviceId(&value); return value; }
34
36 protected: virtual IObjectTrackInfo* getObjectTrackInfo() const = 0;
38 public: Ptr<IObjectTrackInfo> objectTrackInfo() const { return Ptr(getObjectTrackInfo()); }
39
41 virtual int64_t timestampUs() const = 0;
42
44 protected: virtual const IStringMap* getParams() const = 0;
49 public: Ptr<const IStringMap> params() const { return Ptr(getParams()); }
50
54 struct Result
55 {
60 Ptr<IString> actionUrl;
61
66 Ptr<IString> messageToUser;
67
71 bool useProxy = false;
72
76 bool useDeviceCredentials = false;
77 };
78 };
79 using IAction0 = IAction;
80
81 } // namespace nx::sdk::analytics
nx::sdk::analytics::IAction::getObjectTrackId
virtual void getObjectTrackId(Uuid *outValue) const =0
nx::sdk::IStringMap
Definition: i_string_map.h:9
nx::sdk::analytics::IAction::timestampUs
virtual int64_t timestampUs() const =0
nx::sdk::analytics::IAction::getParams
virtual const IStringMap * getParams() const =0
nx::sdk::analytics::IAction::objectTrackId
Uuid objectTrackId() const
Definition: i_action.h:28
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::analytics::IAction
Definition: i_action.h:17
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::IObjectTrackInfo
Definition: i_object_track_info.h:50
nx::sdk::analytics::IAction::Result::useProxy
bool useProxy
Definition: i_action.h:71
nx::sdk::analytics::IAction::Result
Definition: i_action.h:54
nx::sdk::analytics
Definition: consuming_device_agent.cpp:24
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::analytics::IAction::Result::useDeviceCredentials
bool useDeviceCredentials
Definition: i_action.h:76
nx::sdk::analytics::IAction::Result::actionUrl
Ptr< IString > actionUrl
Definition: i_action.h:60
nx::sdk::analytics::IAction::getDeviceId
virtual void getDeviceId(Uuid *outValue) const =0
nx::sdk::analytics::IAction::params
Ptr< const IStringMap > params() const
Definition: i_action.h:49
nx::sdk::analytics::IAction::objectTrackInfo
Ptr< IObjectTrackInfo > objectTrackInfo() const
Definition: i_action.h:38
nx::sdk::analytics::IAction::Result::messageToUser
Ptr< IString > messageToUser
Definition: i_action.h:66
nx::sdk::analytics::IAction::actionId
virtual const char * actionId() const =0
nx::sdk::analytics::IAction::getObjectTrackInfo
virtual IObjectTrackInfo * getObjectTrackInfo() const =0
nx::sdk::analytics::IAction::deviceId
Uuid deviceId() const
Definition: i_action.h:33
nx::sdk::IRefCountable::makeId
static const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:77