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