iceoryx_doc  1.0.1
port_pool_memory_block.hpp
1 // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // SPDX-License-Identifier: Apache-2.0
16 #ifndef IOX_POSH_ROUDI_MEMORY_PORT_POOL_MEMORY_BLOCK_HPP
17 #define IOX_POSH_ROUDI_MEMORY_PORT_POOL_MEMORY_BLOCK_HPP
18 
19 #include "iceoryx_posh/internal/roudi/port_pool_data.hpp"
20 #include "iceoryx_posh/mepoo/mepoo_config.hpp"
21 #include "iceoryx_posh/roudi/memory/memory_block.hpp"
22 #include "iceoryx_utils/cxx/optional.hpp"
23 
24 #include <cstdint>
25 
26 namespace iox
27 {
28 namespace roudi
29 {
31 {
32  public:
35  PortPoolMemoryBlock() noexcept = default;
36  ~PortPoolMemoryBlock() noexcept;
37 
40  PortPoolMemoryBlock& operator=(const PortPoolMemoryBlock&) = delete;
41  PortPoolMemoryBlock& operator=(PortPoolMemoryBlock&&) = delete;
42 
45  uint64_t size() const noexcept override;
46 
49  uint64_t alignment() const noexcept override;
50 
54  void memoryAvailable(void* memory) noexcept override;
55 
58  void destroy() noexcept override;
59 
62  cxx::optional<PortPoolData*> portPool() const noexcept;
63 
64  private:
65  PortPoolData* m_portPoolData{nullptr};
66 };
67 
68 } // namespace roudi
69 } // namespace iox
70 
71 #endif // IOX_POSH_ROUDI_MEMORY_PORT_POOL_MEMORY_BLOCK_HPP
The MemoryBlock is a container for general purpose memory. It is used to request some memory from a M...
Definition: memory_block.hpp:32
cxx::optional< void * > memory() const noexcept
This function provides the pointer to the requested memory.
Definition: port_pool_memory_block.hpp:31
uint64_t size() const noexcept override
Implementation of MemoryBlock::size.
void destroy() noexcept override
Implementation of MemoryBlock::destroy This will clean up the ports.
void memoryAvailable(void *memory) noexcept override
Implementation of MemoryBlock::memoryAvailable This will create the ports.
cxx::optional< PortPoolData * > portPool() const noexcept
This function enables the access to the PortPool.
uint64_t alignment() const noexcept override
Implementation of MemoryBlock::alignment.
PortPoolMemoryBlock() noexcept=default
Definition: service_description.hpp:29
Definition: port_pool_data.hpp:55