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

#include <FlowReader.hpp>

Inheritance diagram for mxl::lib::FlowReader:

Public Member Functions

std::filesystem::path const & getDomain () const
virtual mxlFlowConfigInfo getFlowConfigInfo () const =0
virtual FlowData const & getFlowData () const =0
virtual mxlFlowInfo getFlowInfo () const =0
virtual mxlFlowRuntimeInfo getFlowRuntimeInfo () const =0
uuids::uuid const & getId () const
virtual ~FlowReader ()

Protected Member Functions

bool checkPermissions () const
 FlowReader (uuids::uuid &&flowId, std::filesystem::path const &domain)
 FlowReader (uuids::uuid const &flowId, std::filesystem::path const &domain)
virtual bool isFlowValid () const =0

Private Attributes

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

Detailed Description

Definition at line 15 of file FlowReader.hpp.

Constructor & Destructor Documentation

◆ ~FlowReader()

virtual mxl::lib::FlowReader::~FlowReader ( )
virtual

Destructor.

◆ FlowReader() [1/2]

mxl::lib::FlowReader::FlowReader ( uuids::uuid && flowId,
std::filesystem::path const & domain )
explicitprotected

Definition at line 11 of file FlowReader.cpp.

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

◆ FlowReader() [2/2]

mxl::lib::FlowReader::FlowReader ( uuids::uuid const & flowId,
std::filesystem::path const & domain )
explicitprotected

Definition at line 16 of file FlowReader.cpp.

18 , _domain{domain}
19 {}

Member Function Documentation

◆ checkPermissions()

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

Verifies that we can access the flow_def.json file

Returns
true if the flow is accessible, false otherwise.

Definition at line 33 of file FlowReader.cpp.

34 {
35 auto const flowDefPath = makeFlowDescriptorFilePath(_domain, uuids::to_string(_flowId));
36 return std::filesystem::is_regular_file(flowDefPath) && (::access(flowDefPath.c_str(), R_OK) == 0);
37 }
std::filesystem::path makeFlowDescriptorFilePath(std::filesystem::path const &flowDirectory)
Definition PathUtils.cpp:23

◆ getDomain()

std::filesystem::path const & mxl::lib::FlowReader::getDomain ( ) const
nodiscard

Accessor for the flow domain;

Returns
The flow domain

Definition at line 28 of file FlowReader.cpp.

29 {
30 return _domain;
31 }

◆ getFlowConfigInfo()

virtual mxlFlowConfigInfo mxl::lib::FlowReader::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 mxl::lib::PosixContinuousFlowReader, mxl::lib::PosixDiscreteFlowReader, and mxl::lib::PosixEventFlowReader.

◆ getFlowData()

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

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

Implemented in mxl::lib::PosixContinuousFlowReader, mxl::lib::PosixDiscreteFlowReader, and mxl::lib::PosixEventFlowReader.

◆ getFlowInfo()

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

Accessor for the current mxlFlowInfo. A copy of the current structure is returned. The reader must be properly attached to the flow before invoking this method.

Returns
A copy of the mxlFlowInfo

Implemented in mxl::lib::PosixContinuousFlowReader, mxl::lib::PosixDiscreteFlowReader, and mxl::lib::PosixEventFlowReader.

◆ getFlowRuntimeInfo()

virtual mxlFlowRuntimeInfo mxl::lib::FlowReader::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 mxl::lib::PosixContinuousFlowReader, mxl::lib::PosixDiscreteFlowReader, and mxl::lib::PosixEventFlowReader.

◆ getId()

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

Accessor for the flow id;

Returns
The flow id

Definition at line 23 of file FlowReader.cpp.

24 {
25 return _flowId;
26 }

◆ isFlowValid()

virtual bool mxl::lib::FlowReader::isFlowValid ( ) const
nodiscardprotectedpure virtual

A flow is considered valid if its flow data file exists, is accessible and its inode is the same as the one recorded in the flow info structure.

Returns
true if the flow is valid, false otherwise.

Implemented in mxl::lib::PosixContinuousFlowReader, mxl::lib::PosixDiscreteFlowReader, and mxl::lib::PosixEventFlowReader.

Member Data Documentation

◆ _domain

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

Definition at line 89 of file FlowReader.hpp.

◆ _flowId

uuids::uuid mxl::lib::FlowReader::_flowId
private

Definition at line 88 of file FlowReader.hpp.


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