iceoryx_doc  1.0.1
chunk_sender_data.hpp
1 // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // SPDX-License-Identifier: Apache-2.0
17 #ifndef IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_SENDER_DATA_HPP
18 #define IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_SENDER_DATA_HPP
19 
20 #include "iceoryx_posh/iceoryx_posh_types.hpp"
21 #include "iceoryx_posh/internal/mepoo/memory_manager.hpp"
22 #include "iceoryx_posh/internal/mepoo/shm_safe_unmanaged_chunk.hpp"
23 #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp"
24 #include "iceoryx_posh/internal/popo/used_chunk_list.hpp"
25 #include "iceoryx_posh/mepoo/memory_info.hpp"
26 #include "iceoryx_utils/cxx/helplets.hpp"
27 
28 namespace iox
29 {
30 namespace popo
31 {
32 template <uint32_t MaxChunksAllocatedSimultaneously, typename ChunkDistributorDataType>
33 struct ChunkSenderData : public ChunkDistributorDataType
34 {
35  explicit ChunkSenderData(cxx::not_null<mepoo::MemoryManager* const> memoryManager,
36  const SubscriberTooSlowPolicy subscriberTooSlowPolicy,
37  const uint64_t historyCapacity = 0U,
38  const mepoo::MemoryInfo& memoryInfo = mepoo::MemoryInfo()) noexcept;
39 
40  using ChunkDistributorData_t = ChunkDistributorDataType;
41 
42  const rp::RelativePointer<mepoo::MemoryManager> m_memoryMgr;
43  mepoo::MemoryInfo m_memoryInfo;
45  mepoo::SequenceNumber_t m_sequenceNumber{0U};
46  mepoo::ShmSafeUnmanagedChunk m_lastChunkUnmanaged;
47 };
48 
49 } // namespace popo
50 } // namespace iox
51 
52 #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.inl"
53 
54 #endif // IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_SENDER_DATA_HPP
This class to safely store a chunk in shared memory. To be able to do so, torn writes/reads need to p...
Definition: shm_safe_unmanaged_chunk.hpp:31
Definition: service_description.hpp:29
Stores properties of the memory to be used when we distinguish between different types of memory on e...
Definition: memory_info.hpp:28
Definition: chunk_sender_data.hpp:34