MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
mxl::lib::EventFlowWriter Class Referenceabstract

Backend contract for a single event producer with private write staging. Callers guarantee one writer per flow across all instances and processes, and serialize the complete open/edit/commit-or-cancel transaction. More...

#include <EventFlowWriter.hpp>

Inheritance diagram for mxl::lib::EventFlowWriter:
Collaboration diagram for mxl::lib::EventFlowWriter:

Public Member Functions

virtual mxlStatus cancel ()=0
 Discard an open write without advancing the queue or timestamp.
virtual mxlStatus commit (mxlEventInfo const &info)=0
 Publish the staged bytes as one complete event or fragment.
virtual mxlStatus openEvent (mxlEventInfo *info, std::uint8_t **payload)=0
 Begin a write and reset metadata to the event defaults.
Public Member Functions inherited from mxl::lib::FlowWriter
virtual mxlFlowConfigInfo getFlowConfigInfo () const =0
virtual FlowData const & getFlowData () const =0
virtual FlowData & getFlowData ()=0
virtual mxlFlowInfo getFlowInfo () const =0
virtual mxlFlowRuntimeInfo getFlowRuntimeInfo () const =0
uuids::uuid const & getId () const
virtual bool isExclusive () const =0
virtual bool makeExclusive ()=0
virtual ~FlowWriter ()

Protected Member Functions

 FlowWriter (uuids::uuid &&flowId, std::filesystem::path const &domain)
 Initialize flow identity and domain using the base writer constructors.
 FlowWriter (uuids::uuid const &flowId, std::filesystem::path const &domain)
 Initialize flow identity and domain using the base writer constructors.
Protected Member Functions inherited from mxl::lib::FlowWriter
bool checkPermissions () const
 FlowWriter (uuids::uuid &&flowId, std::filesystem::path const &domain)
 FlowWriter (uuids::uuid const &flowId, std::filesystem::path const &domain)

Detailed Description

Backend contract for a single event producer with private write staging. Callers guarantee one writer per flow across all instances and processes, and serialize the complete open/edit/commit-or-cancel transaction.

Definition at line 18 of file EventFlowWriter.hpp.

Member Function Documentation

◆ cancel()

virtual mxlStatus mxl::lib::EventFlowWriter::cancel ( )
pure virtual

Discard an open write without advancing the queue or timestamp.

Returns
MXL_STATUS_OK, or MXL_ERR_INVALID_ARG when no write is open.

Implemented in mxl::lib::PosixEventFlowWriter.

◆ commit()

virtual mxlStatus mxl::lib::EventFlowWriter::commit ( mxlEventInfo const & info)
pure virtual

Publish the staged bytes as one complete event or fragment.

Parameters
infoValid metadata whose timestamp is at least the last committed timestamp.
Returns
MXL_STATUS_OK on publication, INVALID_ARG on invalid metadata or state, FLOW_INVALID on interrupted-tag reuse, or TOO_LATE on index exhaustion.
Note
Failure leaves the transaction open for correction or cancellation.

Implemented in mxl::lib::PosixEventFlowWriter.

◆ FlowWriter() [1/2]

mxl::lib::FlowWriter::FlowWriter ( uuids::uuid && flowId,
std::filesystem::path const & domain )
protected

Initialize flow identity and domain using the base writer constructors.

Parameters
flowIdIdentifier of the event flow.
domainDomain directory containing the flow.

Definition at line 87 of file FlowWriter.cpp.

10 : _flowId{std::move(flowId)}
11 , _domain{domain}
12 {}
std::filesystem::path _domain
auto const flowId

◆ FlowWriter() [2/2]

mxl::lib::FlowWriter::FlowWriter ( uuids::uuid const & flowId,
std::filesystem::path const & domain )
protected

Initialize flow identity and domain using the base writer constructors.

Parameters
flowIdIdentifier of the event flow.
domainDomain directory containing the flow.

Definition at line 88 of file FlowWriter.cpp.

16 , _domain{domain}
17 {}

◆ openEvent()

virtual mxlStatus mxl::lib::EventFlowWriter::openEvent ( mxlEventInfo * info,
std::uint8_t ** payload )
pure virtual

Begin a write and reset metadata to the event defaults.

Parameters
[out]infoReceives initialized metadata; must not be null.
[out]payloadReceives private writable storage; must not be null.
Returns
MXL_STATUS_OK, or MXL_ERR_INVALID_ARG if a write is already open.
See also
mxlFlowWriterOpenEvent for field defaults and payload lifetime.

Implemented in mxl::lib::PosixEventFlowWriter.


The documentation for this class was generated from the following file: