MXL : Media eXchange Layer
MXL
Loading...
Searching...
No Matches
FlowData.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project.
2// SPDX-License-Identifier: Apache-2.0
3
5
6namespace mxl::lib
7{
8 FlowData::FlowData(char const* flowFilePath, AccessMode mode, LockMode lockMode)
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 }
49
50 FlowData::~FlowData() = default;
51
53 {
54 return _flow.isExclusive();
55 }
56
58 {
59 return _flow.makeExclusive();
60 }
61}
constexpr FlowData(SharedMemoryInstance< Flow > &&flowSegement) noexcept
Definition FlowData.hpp:53
bool isExclusive() const
Definition FlowData.cpp:52
SharedMemoryInstance< Flow > _flow
Definition FlowData.hpp:46
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...