nx_server_plugin_sdk 1.0 Server Plugin 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/analytics/i_event_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 EventMetadataPacket: public RefCountable<IEventMetadataPacket>
14 {
15 public:
16 virtual Flags flags() const override;
17 virtual int64_t timestampUs() const override;
18 virtual int64_t durationUs() const override;
19
20 virtual int count() const override;
21
22 void setFlags(Flags flags);
23 void setTimestampUs(int64_t timestampUs);
24 void setDurationUs(int64_t durationUs);
25 void addItem(Ptr<const IEventMetadata> event);
26 void clear();
27
28 protected:
29 virtual const IEventMetadata* getAt(int index) const override;
30
31 private:
32 Flags m_flags = Flags::none;
33 int64_t m_timestampUs = 0;
34 int64_t m_durationUs = 0;
35
36 std::vector<Ptr<const IEventMetadata>> m_events;
37 };
38
39 } // namespace nx::sdk::analytics
nx::sdk::Ptr
Definition: ptr.h:18
nx::sdk::analytics::EventMetadataPacket
Definition: event_metadata_packet.h:13
nx::sdk::analytics
Definition: consuming_device_agent.cpp:25
nx::sdk::analytics::IEventMetadata
Definition: i_event_metadata.h:65
nx::sdk::RefCountable
Definition: ref_countable.h:83