nx_server_plugin_sdk 1.0 Server Plugin SDK

object_metadata_packet.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/i_object_metadata_packet.h>
8 #include <nx/sdk/helpers/ref_countable.h>
9 #include <nx/sdk/ptr.h>
10
11 namespace nx::sdk::analytics {
12
13 class ObjectMetadataPacket: public RefCountable<IObjectMetadataPacket>
14 {
15 public:
16 virtual Flags flags() const override;
17 virtual int64_t timestampUs() const override;
18 virtual int64_t durationUs() const override;
19 virtual int count() const override;
20
21 void setFlags(Flags flags);
22 void setTimestampUs(int64_t timestampUs);
23 void setDurationUs(int64_t durationUs);
24 void addItem(Ptr<const IObjectMetadata> object);
25 void clear();
26
27 protected:
28 virtual const IObjectMetadata* getAt(int index) const override;
29
30 private:
31 Flags m_flags = Flags::none;
32 int64_t m_timestampUs = 0;
33 int64_t m_durationUs = 0;
34
35 std::vector<Ptr<const IObjectMetadata>> m_objects;
36 };
37
38 } // namespace nx::sdk::analytics
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics
Definition: consuming_device_agent.cpp:25
nx::sdk::analytics::IObjectMetadata
Definition: i_object_metadata.h:16
nx::sdk::RefCountable
Definition: ref_countable.h:83
nx::sdk::analytics::ObjectMetadataPacket
Definition: object_metadata_packet.h:13