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
28 void setTypeId(std::string typeId);
29 void setConfidence(float confidence);
30 void setCaption(const std::string& caption);
31 void setDescription(const std::string& description);
32 void setIsActive(bool isActive);
33 void addAttribute(nx::sdk::Ptr<Attribute> attribute);
34 void addAttributes(const std::vector<nx::sdk::Ptr<Attribute>>& value);
35
36 protected:
37 virtual const IAttribute* getAttribute(int index) const override;
38
39 private:
40 std::string m_typeId;
41 float m_confidence = 1.0;
42 std::string m_caption;
43 std::string m_description;
44 bool m_isActive = false;
45 std::vector<nx::sdk::Ptr<Attribute>> m_attributes;
46 };
47
48 } // namespace nx
49 } // namespace sdk
50 } // namespace nx
nx::sdk::Ptr
Definition: ptr.h:18
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