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 <cstdint>
6
7 #include <nx/sdk/interface.h>
8
9 #include <nx/sdk/uuid.h>
10 #include <nx/sdk/i_string_map.h>
11 #include <nx/sdk/analytics/i_object_track_info.h>
12
13 namespace nx {
14 namespace sdk {
15 namespace analytics {
16
20 class IAction: public Interface<IAction>
21 {
22 public:
23 static auto interfaceId() { return makeId("nx::sdk::analytics::IAction"); }
24
26 virtual const char* actionId() const = 0;
27
29 protected: virtual void getObjectTrackId(Uuid* outValue) const = 0;
30 public: Uuid objectTrackId() const { Uuid value; getObjectTrackId(&value); return value; }
31
33 protected: virtual void getDeviceId(Uuid* outValue) const = 0;
34 public: Uuid deviceId() const { Uuid value; getDeviceId(&value); return value; }
35
37 protected: virtual IObjectTrackInfo* getObjectTrackInfo() const = 0;
38 public: Ptr<IObjectTrackInfo> objectTrackInfo() const { return toPtr(getObjectTrackInfo()); }
39
41 virtual int64_t timestampUs() const = 0;
42
47 protected: virtual const IStringMap* getParams() const = 0;
48 public: Ptr<const IStringMap> params() const { return toPtr(getParams()); }
49
50 struct Result
51 {
53 Ptr<IString> actionUrl;
54
56 Ptr<IString> messageToUser;
57 };
58 };
59
60 } // namespace analytics
61 } // namespace sdk
62 } // namespace nx
nx::sdk::analytics::IAction::getObjectTrackId
virtual void getObjectTrackId(Uuid *outValue) const =0
nx::sdk::IStringMap
Definition: i_string_map.h:10
nx::sdk::analytics::IAction::timestampUs
virtual int64_t timestampUs() const =0
nx::sdk::analytics::IAction::getParams
virtual const IStringMap * getParams() const =0
nx::sdk::Interface
Definition: interface.h:28
nx::sdk::analytics::IAction
Definition: i_action.h:20
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::IObjectTrackInfo
Definition: i_object_track_info.h:16
nx::sdk::analytics::IAction::Result
Definition: i_action.h:50
nx::sdk::Uuid
Definition: uuid.h:21
nx
Definition: apple_utils.h:6
nx::sdk::analytics::IAction::Result::actionUrl
Ptr< IString > actionUrl
Definition: i_action.h:53
nx::sdk::analytics::IAction::getDeviceId
virtual void getDeviceId(Uuid *outValue) const =0
nx::sdk::analytics::IAction::Result::messageToUser
Ptr< IString > messageToUser
Definition: i_action.h:56
nx::sdk::analytics::IAction::actionId
virtual const char * actionId() const =0
nx::sdk::analytics::IAction::getObjectTrackInfo
virtual IObjectTrackInfo * getObjectTrackInfo() const =0
nx::sdk::IRefCountable::makeId
static constexpr const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:78