MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
PosixEventFlowReader.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Contributors to the Media eXchange Layer project.
2// SPDX-License-Identifier: Apache-2.0
3
7
8#pragma once
9#include <vector>
12
13namespace mxl::lib
14{
15 class FlowManager;
16
19 {
20 public:
27 PosixEventFlowReader(FlowManager const& manager, uuids::uuid const& flowId, std::unique_ptr<EventFlowData>&& data);
29 virtual ~PosixEventFlowReader() override;
31 virtual FlowData const& getFlowData() const override;
33 virtual mxlFlowInfo getFlowInfo() const override;
35 virtual mxlFlowConfigInfo getFlowConfigInfo() const override;
37 virtual mxlFlowRuntimeInfo getFlowRuntimeInfo() const override;
39 virtual mxlStatus getEvent(Timepoint deadline, mxlEventInfo* info, std::uint8_t** payload) override;
40
41 protected:
43 virtual bool isFlowValid() const override;
44
45 private:
47 bool isFlowValidImpl() const;
48
49 private:
50 std::unique_ptr<EventFlowData> _flowData;
52 std::uint64_t _nextIndex;
53 std::vector<std::uint8_t> _snapshot;
54 };
55}
Owned mappings and runtime access for event flows.
Backend contract for event queue consumers.
Backend contract for reading complete event entries or fragments in queue order. Each reader has one ...
virtual mxlFlowInfo getFlowInfo() const override
virtual FlowData const & getFlowData() const override
std::vector< std::uint8_t > _snapshot
Payload storage reused on the next read attempt.
virtual ~PosixEventFlowReader() override
Close the access descriptor and release the snapshot and shared mappings.
int _accessFileFd
Access notification descriptor, or -1 if unavailable.
std::unique_ptr< EventFlowData > _flowData
Owned common metadata and read-only event mappings.
PosixEventFlowReader(FlowManager const &manager, uuids::uuid const &flowId, std::unique_ptr< EventFlowData > &&data)
Attach a reader at the oldest retained entry.
virtual mxlFlowConfigInfo getFlowConfigInfo() const override
virtual mxlStatus getEvent(Timepoint deadline, mxlEventInfo *info, std::uint8_t **payload) override
Copy the next available entry and advance this reader's cursor.
virtual bool isFlowValid() const override
virtual mxlFlowRuntimeInfo getFlowRuntimeInfo() const override
std::uint64_t _nextIndex
Next queue entry for this reader's owning thread.
struct mxlEventInfo_t mxlEventInfo
Metadata for one event queue entry, either a complete event or a fragment.
struct mxlFlowRuntimeInfo_t mxlFlowRuntimeInfo
struct mxlFlowConfigInfo_t mxlFlowConfigInfo
struct mxlFlowInfo_t mxlFlowInfo
mxlStatus
MXL SDK Status codes.
Definition mxl.h:22
auto const flowId