MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
mxl::lib::FlowData Class Reference

#include <FlowData.hpp>

Inheritance diagram for mxl::lib::FlowData:
Collaboration diagram for mxl::lib::FlowData:

Public Member Functions

constexpr AccessMode accessMode () const noexcept
constexpr bool created () const noexcept
constexpr Flow const * flow () const noexcept
constexpr Flow * flow () noexcept
constexpr mxlFlowInfo const * flowInfo () const noexcept
constexpr mxlFlowInfo * flowInfo () noexcept
constexpr FlowState const * flowState () const noexcept
constexpr FlowState * flowState () noexcept
bool isExclusive () const
constexpr bool isValid () const noexcept
bool makeExclusive ()
constexpr std::size_t mappedSize () const noexcept
constexpr operator bool () const noexcept
virtual ~FlowData ()

Protected Member Functions

 FlowData (char const *flowFilePath, AccessMode mode, LockMode lockMode)
constexpr FlowData (SharedMemoryInstance< Flow > &&flowSegement) noexcept

Private Attributes

SharedMemoryInstance< Flow > _flow

Detailed Description

Simple structure holding the shared memory resources common to all types of flows.

Definition at line 17 of file FlowData.hpp.

Constructor & Destructor Documentation

◆ ~FlowData()

mxl::lib::FlowData::~FlowData ( )
virtualdefault

◆ FlowData() [1/2]

mxl::lib::FlowData::FlowData ( SharedMemoryInstance< Flow > && flowSegement)
explicitconstexprprotectednoexcept

Definition at line 53 of file FlowData.hpp.

54 : _flow{std::move(flowSegement)}
55 {}
SharedMemoryInstance< Flow > _flow
Definition FlowData.hpp:46

◆ FlowData() [2/2]

mxl::lib::FlowData::FlowData ( char const * flowFilePath,
AccessMode mode,
LockMode lockMode )
protected

Definition at line 8 of file FlowData.cpp.

9 : _flow{flowFilePath, mode, 0U, lockMode}
10 {
11 // see: https://en.cppreference.com/w/cpp/types/has_unique_object_representations.html
12 static_assert(std::has_unique_object_representations_v<::mxlFlowInfo>,
13 "mxlFlowInfo does not have a unique object representation, which means that its layout in memory can be different from how it is "
14 "representetd in code. This was likely introduced by a change to the objects fields that introduced padding, or by adding non-trivial "
15 "members to the object.");
16 static_assert(std::has_unique_object_representations_v<::mxlFlowConfigInfo>,
17 "mxlFlowConfigInfo does not have a unique object representation, which means that its layout in memory can be different from how it is "
18 "representetd in code. This was likely introduced by a change to the objects fields that introduced padding, or by adding non-trivial "
19 "members to the object.");
20 static_assert(std::has_unique_object_representations_v<::mxlDiscreteFlowConfigInfo>,
21 "mxlDiscreteFlowConfigInfo does not have a unique object representation, which means that its layout in memory can be different from how "
22 "it is "
23 "representetd in code. This was likely introduced by a change to the objects fields that introduced padding, or by adding non-trivial "
24 "members to the object.");
25 static_assert(std::has_unique_object_representations_v<::mxlContinuousFlowConfigInfo>,
26 "mxlContinuousFlowConfigInfo does not have a unique object representation, which means that its layout in memory can be different from "
27 "how it "
28 "is representetd in code. This was likely introduced by a change to the objects fields that introduced padding, or by adding non-trivial "
29 "members to the object.");
30 static_assert(std::has_unique_object_representations_v<::mxlFlowRuntimeInfo>,
31 "mxlFlowRuntimeInfo does not have a unique object representation, which means that its layout in memory can be different from how it "
32 "is representetd in code. This was likely introduced by a change to the objects fields that introduced padding, or by adding non-trivial "
33 "members to the object.");
34 static_assert(std::has_unique_object_representations_v<::mxlGrainInfo>,
35 "mxlGrainInfo does not have a unique object representation, which means that its layout in memory can be different from how it "
36 "is representetd in code. This was likely introduced by a change to the objects fields that introduced padding, or by adding non-trivial "
37 "members to the object.");
38
39 static_assert(sizeof(::mxlCommonFlowConfigInfo) == 128, "mxlCommonFlowConfigInfo does not have a size of 128 bytes");
40 static_assert(sizeof(::mxlContinuousFlowConfigInfo) == 64, "mxlContinuousFlowConfigInfo does not have a size of 64 bytes");
41 static_assert(sizeof(::mxlDiscreteFlowConfigInfo) == 64, "mxlDiscreteFlowConfigInfo does not have a size of 64 bytes");
42 static_assert(sizeof(::mxlFlowConfigInfo) == 192, "mxlFlowConfigInfo does not have a size of 192 bytes");
43 static_assert(sizeof(::mxlEventFlowConfigInfo) == 64, "mxlEventFlowConfigInfo does not have a size of 64 bytes");
44 static_assert(sizeof(::mxlFlowRuntimeInfo) == 64, "mxlFlowRuntimeInfo does not have a size of 64 bytes");
45 static_assert(sizeof(::mxlFlowInfo) == 2048, "mxlFlowInfo does not have a size of 2048 bytes");
46 static_assert(sizeof(::mxlGrainInfo) == 4096, "mxlGrainInfo does not have a size of 4096 bytes");
47 static_assert(sizeof(::mxlEventInfo) == 512, "mxlEventInfo does not have a size of 512 bytes");
48 }
struct mxlGrainInfo_t mxlGrainInfo
struct mxlEventInfo_t mxlEventInfo
Metadata for one event queue entry, either a complete event or a fragment.
struct mxlCommonFlowConfigInfo_t mxlCommonFlowConfigInfo
struct mxlFlowRuntimeInfo_t mxlFlowRuntimeInfo
struct mxlFlowConfigInfo_t mxlFlowConfigInfo
struct mxlDiscreteFlowConfigInfo_t mxlDiscreteFlowConfigInfo
struct mxlFlowInfo_t mxlFlowInfo
struct mxlContinuousFlowConfigInfo_t mxlContinuousFlowConfigInfo
struct mxlEventFlowConfigInfo_t mxlEventFlowConfigInfo
Immutable event queue capacity and entry payload geometry (64 bytes). This is the event member of mxl...

Member Function Documentation

◆ accessMode()

AccessMode mxl::lib::FlowData::accessMode ( ) const
constexprnoexcept

Definition at line 67 of file FlowData.hpp.

68 {
69 return _flow.accessMode();
70 }

◆ created()

bool mxl::lib::FlowData::created ( ) const
constexprnoexcept

Definition at line 72 of file FlowData.hpp.

73 {
74 return _flow.created();
75 }

◆ flow() [1/2]

Flow const * mxl::lib::FlowData::flow ( ) const
constexprnoexcept

Definition at line 87 of file FlowData.hpp.

88 {
89 return _flow.get();
90 }

◆ flow() [2/2]

Flow * mxl::lib::FlowData::flow ( )
constexprnoexcept

Definition at line 82 of file FlowData.hpp.

83 {
84 return _flow.get();
85 }

◆ flowInfo() [1/2]

mxlFlowInfo const * mxl::lib::FlowData::flowInfo ( ) const
constexprnoexcept

Definition at line 101 of file FlowData.hpp.

102 {
103 if (auto const flow = _flow.get(); flow != nullptr)
104 {
105 return &flow->info;
106 }
107 return nullptr;
108 }
constexpr Flow * flow() noexcept
Definition FlowData.hpp:82

◆ flowInfo() [2/2]

mxlFlowInfo * mxl::lib::FlowData::flowInfo ( )
constexprnoexcept

Definition at line 92 of file FlowData.hpp.

93 {
94 if (auto const flow = _flow.get(); flow != nullptr)
95 {
96 return &flow->info;
97 }
98 return nullptr;
99 }

◆ flowState() [1/2]

FlowState const * mxl::lib::FlowData::flowState ( ) const
constexprnoexcept

Definition at line 119 of file FlowData.hpp.

120 {
121 if (auto const flow = _flow.get(); flow != nullptr)
122 {
123 return &flow->state;
124 }
125 return nullptr;
126 }

◆ flowState() [2/2]

FlowState * mxl::lib::FlowData::flowState ( )
constexprnoexcept

Definition at line 110 of file FlowData.hpp.

111 {
112 if (auto const flow = _flow.get(); flow != nullptr)
113 {
114 return &flow->state;
115 }
116 return nullptr;
117 }

◆ isExclusive()

bool mxl::lib::FlowData::isExclusive ( ) const

Definition at line 52 of file FlowData.cpp.

53 {
54 return _flow.isExclusive();
55 }

◆ isValid()

bool mxl::lib::FlowData::isValid ( ) const
constexprnoexcept

Definition at line 57 of file FlowData.hpp.

58 {
59 return _flow.isValid();
60 }

◆ makeExclusive()

bool mxl::lib::FlowData::makeExclusive ( )

Definition at line 57 of file FlowData.cpp.

58 {
59 return _flow.makeExclusive();
60 }

◆ mappedSize()

std::size_t mxl::lib::FlowData::mappedSize ( ) const
constexprnoexcept

Definition at line 77 of file FlowData.hpp.

78 {
79 return _flow.mappedSize();
80 }

◆ operator bool()

mxl::lib::FlowData::operator bool ( ) const
explicitconstexprnoexcept

Definition at line 62 of file FlowData.hpp.

63 {
64 return _flow.isValid();
65 }

Member Data Documentation

◆ _flow

SharedMemoryInstance<Flow> mxl::lib::FlowData::_flow
private

Definition at line 46 of file FlowData.hpp.


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