nx_server_plugin_sdk 1.0 Server Plugin SDK

timestamped_object_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 <vector>
6
7 #include <nx/sdk/analytics/helpers/object_metadata.h>
8 #include <nx/sdk/analytics/i_timestamped_object_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 TimestampedObjectMetadata: public RefCountable<ITimestampedObjectMetadata>
16 {
17 public:
18 TimestampedObjectMetadata();
19
20 virtual const char* subtype() const override;
21 virtual int attributeCount() const override;
22 virtual int64_t timestampUs() const override;
23 virtual const char* typeId() const override;
24 virtual float confidence() const override;
25
26 void setTypeId(std::string typeId);
27 void setConfidence(float confidence);
28 void setTrackId(const Uuid& value);
29 void setSubtype(const std::string& value);
30 void addAttribute(nx::sdk::Ptr<Attribute> attribute);
31 void addAttributes(const std::vector<nx::sdk::Ptr<Attribute>>& value);
32 void setBoundingBox(const Rect& rect);
33 void setTimestampUs(int64_t timestampUs);
34
35 protected:
36 virtual const IAttribute* getAttribute(int index) const override;
37 virtual void getTrackId(Uuid* outValue) const override;
38 virtual void getBoundingBox(Rect* outValue) const override;
39
40 private:
41 const nx::sdk::Ptr<nx::sdk::analytics::ObjectMetadata> m_objectMetadata;
42 int64_t m_timestampUs = 0;
43 };
44
45 } // 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::analytics::TimestampedObjectMetadata
Definition: timestamped_object_metadata.h:15
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::sdk::analytics::Rect
Definition: rect.h:9