Own the common flow mapping, single event ring mapping and ring view.
More...
#include <EventFlowData.hpp>
Own the common flow mapping, single event ring mapping and ring view.
Definition at line 17 of file EventFlowData.hpp.
◆ EventFlowData() [1/2]
Take ownership of an existing common flow mapping.
- Parameters
-
| flowSegment | Mapping to move into the base FlowData object. |
Definition at line 24 of file EventFlowData.hpp.
26 {}
constexpr FlowData(SharedMemoryInstance< Flow > &&flowSegement) noexcept
◆ EventFlowData() [2/2]
| mxl::lib::EventFlowData::EventFlowData |
( |
char const * | flowFilePath, |
|
|
AccessMode | mode, |
|
|
LockMode | lockMode ) |
|
inline |
Open or create the common flow mapping before attaching the event ring.
- Parameters
-
| flowFilePath | Path to the flow's data file. |
| mode | Shared-memory access mode. |
| lockMode | Advisory lock mode for the common flow file. |
- Exceptions
-
| std::exception | The file cannot be mapped or locked. |
Definition at line 35 of file EventFlowData.hpp.
36 :
FlowData{flowFilePath, mode, lockMode}
37 {}
◆ eventCount()
| std::size_t mxl::lib::EventFlowData::eventCount |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Configured number of slots, or zero before the ring file is open.
Definition at line 40 of file EventFlowData.hpp.
41 {
43 }
SharedMemorySegment _events
Owner of the single events mapping.
constexpr mxlFlowInfo * flowInfo() noexcept
mxlEventFlowConfigInfo event
Event queue geometry when common.format is MXL_DATA_FORMAT_EVENT.
◆ oldestIndex()
| std::uint64_t mxl::lib::EventFlowData::oldestIndex |
( |
| ) |
const |
|
inlinenoexcept |
Compute the retained window from the last committed index and capacity.
- Returns
- Oldest nominally retained index, or zero before the first commit.
- Note
- A producer overwriting a slot can make it unavailable before the head advances.
Definition at line 69 of file EventFlowData.hpp.
70 {
73 }
std::size_t eventCount() const noexcept
static std::uint64_t load(std::uint64_t const &value) noexcept
Load a shared 64-bit word with acquire ordering, including from a read-only mapping.
#define MXL_UNDEFINED_INDEX
◆ openEventBuffer()
| void mxl::lib::EventFlowData::openEventBuffer |
( |
char const * | eventFilePath | ) |
|
|
inline |
Map the complete ring file and initialize it if newly created.
- Parameters
-
| eventFilePath | Path to the events file for this flow. |
- Precondition
- The common flow configuration contains valid event geometry.
- Exceptions
-
| std::exception | Mapping fails or stored ring geometry is invalid. |
Definition at line 51 of file EventFlowData.hpp.
52 {
58 {
60 }
61 _ring = std::make_unique<EventRingBuffer>(
_events.data(), config.eventCount, config.eventPayloadSize);
62 }
std::unique_ptr< EventRingBuffer > _ring
Non-owning ring view whose lifetime is bounded by _events.
static void initialize(void *memory, std::uint32_t count, std::uint32_t payloadSize)
Construct headers, empty sequence tags and payload words in a fresh mapping.
static std::size_t bufferSize(std::uint32_t count, std::uint32_t payloadSize)
Validate geometry and compute the complete mapping length.
constexpr AccessMode accessMode() const noexcept
constexpr bool created() const noexcept
std::size_t size() const noexcept
Returns the total number of writers that are registered in the DomainWatcher.
◆ ring() [1/2]
- Returns
- Read-only ring view; openEventBuffer must have succeeded.
Definition at line 82 of file EventFlowData.hpp.
◆ ring() [2/2]
- Returns
- Mutable ring view; openEventBuffer must have succeeded.
Definition at line 76 of file EventFlowData.hpp.
◆ _events
◆ _ring
Non-owning ring view whose lifetime is bounded by _events.
Definition at line 89 of file EventFlowData.hpp.
The documentation for this class was generated from the following file: