nx_server_plugin_sdk 1.0 Server Plugin 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 virtual void getBoundingBox(Rect* outValue) const override;
26
27 void setTypeId(std::string typeId);
28 void setConfidence(float confidence);
29 void setCaption(const std::string& caption);
30 void setDescription(const std::string& description);
31 void setIsActive(bool isActive);
32 void addAttribute(nx::sdk::Ptr<Attribute> attribute);
33 void addAttributes(const std::vector<nx::sdk::Ptr<Attribute>>& value);
34 void setTrackId(Uuid trackId);
35 void setKey(std::string key);
36 void setBoundingBox(const Rect& boundingBox);
37
38 protected:
39 virtual const IAttribute* getAttribute(int index) const override;
40 virtual void getTrackId(Uuid* outValue) const override;
41
42 private:
43 std::string m_typeId;
44 float m_confidence = 1.0;
45 std::string m_caption;
46 std::string m_description;
47 bool m_isActive = false;
48 std::vector<nx::sdk::Ptr<Attribute>> m_attributes;
49 Uuid m_trackId;
50 std::string m_key;
51 Rect m_boundingBox;
52 };
53
54 } // namespace nx::sdk::analytics
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics
Definition: consuming_device_agent.cpp:25
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
nx::sdk::analytics::Rect
Definition: rect.h:9