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

#include <FlowWriter.hpp>

Inheritance diagram for mxl::lib::FlowWriter:

Public Member Functions

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

bool checkPermissions () const
 FlowWriter (uuids::uuid &&flowId, std::filesystem::path const &domain)
 FlowWriter (uuids::uuid const &flowId, std::filesystem::path const &domain)

Private Attributes

std::filesystem::path _domain
uuids::uuid _flowId

Detailed Description

Definition at line 15 of file FlowWriter.hpp.

Constructor & Destructor Documentation

◆ ~FlowWriter()

virtual mxl::lib::FlowWriter::~FlowWriter ( )
virtual

Destructor.

◆ FlowWriter() [1/2]

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

Definition at line 9 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

Definition at line 14 of file FlowWriter.cpp.

16 , _domain{domain}
17 {}

Member Function Documentation

◆ checkPermissions()

bool mxl::lib::FlowWriter::checkPermissions ( ) const
nodiscardprotected

Verifies that we can traverse and write into the domain directory.

Returns
true if the flow domain is writable, false otherwise.

Definition at line 26 of file FlowWriter.cpp.

27 {
28 // Verify that the domain exists, is a directory and that we can traverse and write into it.
29 return std::filesystem::is_directory(_domain) && (::access(_domain.c_str(), X_OK | W_OK) == 0);
30 }

◆ getFlowConfigInfo()

virtual mxlFlowConfigInfo mxl::lib::FlowWriter::getFlowConfigInfo ( ) const
nodiscardpure virtual

Accessor for the immutable metadata that describes the currently opened flow. The reader must be properly attached to the flow before invoking this method.

Returns
A copy of the mxlFlowConfigInfo of the currently opened flow.

Implemented in MockWriter, mxl::lib::PosixContinuousFlowWriter, mxl::lib::PosixDiscreteFlowWriter, and mxl::lib::PosixEventFlowWriter.

◆ getFlowData() [1/2]

virtual FlowData const & mxl::lib::FlowWriter::getFlowData ( ) const
nodiscardpure virtual

Accessor for the underlying flow data. The flow writer must first open the flow before invoking this method.

Implemented in MockWriter, mxl::lib::PosixContinuousFlowWriter, mxl::lib::PosixDiscreteFlowWriter, and mxl::lib::PosixEventFlowWriter.

◆ getFlowData() [2/2]

virtual FlowData & mxl::lib::FlowWriter::getFlowData ( )
nodiscardpure virtual

Accessor for the underlying flow data. The flow writer must first open the flow before invoking this method.

Implemented in MockWriter, mxl::lib::PosixContinuousFlowWriter, mxl::lib::PosixDiscreteFlowWriter, and mxl::lib::PosixEventFlowWriter.

◆ getFlowInfo()

virtual mxlFlowInfo mxl::lib::FlowWriter::getFlowInfo ( ) const
nodiscardpure virtual

Accessor for the current mxlFlowInfo. A copy of the current structure is returned. The flow writer must first open the flow before invoking this method.

Returns
A copy of the mxlFlowInfo

Implemented in MockWriter, mxl::lib::PosixContinuousFlowWriter, mxl::lib::PosixDiscreteFlowWriter, and mxl::lib::PosixEventFlowWriter.

◆ getFlowRuntimeInfo()

virtual mxlFlowRuntimeInfo mxl::lib::FlowWriter::getFlowRuntimeInfo ( ) const
nodiscardpure virtual

Accessor for the current metadata that describes the current runtime state of the currently opened flow. The reader must be properly attached to the flow before invoking this method.

Returns
A copy of the current mxlFlowRuntimeInfo of the currently opened flow.

Implemented in MockWriter, mxl::lib::PosixContinuousFlowWriter, mxl::lib::PosixDiscreteFlowWriter, and mxl::lib::PosixEventFlowWriter.

◆ getId()

uuids::uuid const & mxl::lib::FlowWriter::getId ( ) const
nodiscard

Accessor for the flow id;

Returns
The flow id

Definition at line 21 of file FlowWriter.cpp.

22 {
23 return _flowId;
24 }

◆ isExclusive()

virtual bool mxl::lib::FlowWriter::isExclusive ( ) const
pure virtual

Check if this is the only writer for this flow.

Implemented in MockWriter, mxl::lib::PosixContinuousFlowWriter, mxl::lib::PosixDiscreteFlowWriter, and mxl::lib::PosixEventFlowWriter.

◆ makeExclusive()

virtual bool mxl::lib::FlowWriter::makeExclusive ( )
pure virtual

Try to turn this into a exclusive writer.

Returns
true if the operation was successful and this is the only writer, false if the operation was not successful because there are other active writers for this flow.

Implemented in MockWriter, mxl::lib::PosixContinuousFlowWriter, mxl::lib::PosixDiscreteFlowWriter, and mxl::lib::PosixEventFlowWriter.

Member Data Documentation

◆ _domain

std::filesystem::path mxl::lib::FlowWriter::_domain
private

Definition at line 92 of file FlowWriter.hpp.

◆ _flowId

uuids::uuid mxl::lib::FlowWriter::_flowId
private

Definition at line 91 of file FlowWriter.hpp.


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