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/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;
31 public: Uuid objectTrackId() const { Uuid value; getObjectTrackId(&value); return value; }
32
34 protected: virtual void getDeviceId(Uuid* outValue) const = 0;
36 public: Uuid deviceId() const { Uuid value; getDeviceId(&value); return value; }
37
39 protected: virtual IObjectTrackInfo* getObjectTrackInfo() const = 0;
41 public: Ptr<IObjectTrackInfo> objectTrackInfo() const { return toPtr(getObjectTrackInfo()); }
42
44 virtual int64_t timestampUs() const = 0;
45
47 protected: virtual const IStringMap* getParams() const = 0;
52 public: Ptr<const IStringMap> params() const { return toPtr(getParams()); }
53
58 struct Result
59 {
61 Ptr<IString> actionUrl;
62
64 Ptr<IString> messageToUser;
65 };
66 };
67 using IAction0 = IAction;
68
69 } // namespace analytics
70 } // namespace sdk
71 } // 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::analytics::IAction::objectTrackId
Uuid objectTrackId() const
Definition: i_action.h:31
nx::sdk::Interface
Definition: interface.h:49
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:53
nx::sdk::analytics::IAction::Result
Definition: i_action.h:58
nx::sdk::Uuid
Definition: uuid.h:22
nx
Definition: apple_utils.h:6
nx::sdk::analytics::IAction::Result::actionUrl
Ptr< IString > actionUrl
Definition: i_action.h:61
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:52
nx::sdk::analytics::IAction::objectTrackInfo
Ptr< IObjectTrackInfo > objectTrackInfo() const
Definition: i_action.h:41
nx::sdk::analytics::IAction::Result::messageToUser
Ptr< IString > messageToUser
Definition: i_action.h:64
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:77
nx::sdk::analytics::IAction::deviceId
Uuid deviceId() const
Definition: i_action.h:36