nx_metadata_sdk 1.0 Metadata SDK

event_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/helpers/ref_countable.h>
8 #include <nx/sdk/ptr.h>
9 #include <nx/sdk/analytics/i_event_metadata_packet.h>
10
11 namespace nx {
12 namespace sdk {
13 namespace analytics {
14
15 class EventMetadataPacket: public RefCountable<IEventMetadataPacket>
16 {
17 public:
18 virtual int64_t timestampUs() const override;
19 virtual int64_t durationUs() const override;
20
21 virtual int count() const override;
22
23 void setTimestampUs(int64_t timestampUs);
24 void setDurationUs(int64_t durationUs);
25 void addItem(const IEventMetadata* event);
26 void clear();
27
28 protected:
29 virtual const IEventMetadata* getAt(int index) const override;
30
31 private:
32 int64_t m_timestampUs = -1;
33 int64_t m_durationUs = -1;
34
35 std::vector<Ptr<const IEventMetadata>> m_events;
36 };
37
38 } // namespace analytics
39 } // namespace sdk
40 } // namespace nx
nx::sdk::analytics::EventMetadataPacket
Definition: event_metadata_packet.h:15
nx::sdk::analytics::IEventMetadata
Definition: i_event_metadata.h:13
nx
Definition: apple_utils.h:6
nx::sdk::RefCountable
Definition: ref_countable.h:84