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 Flags flags() const override;
19 virtual int64_t timestampUs() const override;
20 virtual int64_t durationUs() const override;
21
22 virtual int count() const override;
23
24 void setFlags(Flags flags);
25 void setTimestampUs(int64_t timestampUs);
26 void setDurationUs(int64_t durationUs);
27 void addItem(const IEventMetadata* event);
28 void clear();
29
30 protected:
31 virtual const IEventMetadata* getAt(int index) const override;
32
33 private:
34 Flags m_flags = Flags::none;
35 int64_t m_timestampUs = -1;
36 int64_t m_durationUs = -1;
37
38 std::vector<Ptr<const IEventMetadata>> m_events;
39 };
40
41 } // namespace analytics
42 } // namespace sdk
43 } // namespace nx
nx::sdk::analytics::EventMetadataPacket
Definition: event_metadata_packet.h:15
nx::sdk::analytics::IEventMetadata
Definition: i_event_metadata.h:49
nx
Definition: apple_utils.h:6
nx::sdk::RefCountable
Definition: ref_countable.h:84