nx_metadata_sdk 1.0 Metadata SDK

event_metadata.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 <string>
6 #include <vector>
7
8 #include <nx/sdk/analytics/i_event_metadata.h>
9
10 #include <nx/sdk/ptr.h>
11 #include <nx/sdk/helpers/ref_countable.h>
12 #include <nx/sdk/helpers/attribute.h>
13
14 namespace nx {
15 namespace sdk {
16 namespace analytics {
17
18 class EventMetadata: public RefCountable<IEventMetadata>
19 {
20 public:
21 virtual const char* typeId() const override;
22 virtual float confidence() const override;
23 virtual int attributeCount() const override;
24 virtual const char* caption() const override;
25 virtual const char* description() const override;
26 virtual bool isActive() const override;
27 virtual const char* key() const override;
28
29 void setTypeId(std::string typeId);
30 void setConfidence(float confidence);
31 void setCaption(const std::string& caption);
32 void setDescription(const std::string& description);
33 void setIsActive(bool isActive);
34 void addAttribute(nx::sdk::Ptr<Attribute> attribute);
35 void addAttributes(const std::vector<nx::sdk::Ptr<Attribute>>& value);
36 void setTrackId(Uuid trackId);
37 void setKey(std::string key);
38
39 protected:
40 virtual const IAttribute* getAttribute(int index) const override;
41 virtual void getTrackId(Uuid* outValue) const override;
42
43 private:
44 std::string m_typeId;
45 float m_confidence = 1.0;
46 std::string m_caption;
47 std::string m_description;
48 bool m_isActive = false;
49 std::vector<nx::sdk::Ptr<Attribute>> m_attributes;
50 Uuid m_trackId;
51 std::string m_key;
52 };
53
54 } // namespace nx
55 } // namespace sdk
56 } // namespace nx
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::Uuid
Definition: uuid.h:22
nx::sdk::IAttribute
Definition: i_attribute.h:10
nx
Definition: apple_utils.h:6
nx::sdk::RefCountable
Definition: ref_countable.h:84
nx::sdk::analytics::EventMetadata
Definition: event_metadata.h:18