iceoryx_posh  2.0.2
port_config_info.hpp
1 // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2022 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_RUNTIME_PORT_CONFIG_INFO_HPP
18 #define IOX_POSH_RUNTIME_PORT_CONFIG_INFO_HPP
19 
20 #include "iceoryx_hoofs/cxx/serialization.hpp"
21 #include "iceoryx_posh/mepoo/memory_info.hpp"
22 
23 #include <cstdint>
24 
25 namespace iox
26 {
27 namespace runtime
28 {
33 {
34  static constexpr uint32_t DEFAULT_PORT_TYPE{0U};
35  static constexpr uint32_t DEFAULT_DEVICE_ID{0U};
36  static constexpr uint32_t DEFAULT_MEMORY_TYPE{0U};
37 
38  // these are intentionally not defined as enum classes for flexibility and extendibility
39  // with specific user defined codes used by custom ports
40  // values will be resolved at lower level, (i.e. in the port creation factory)
41 
42  uint32_t portType{DEFAULT_PORT_TYPE};
43  iox::mepoo::MemoryInfo memoryInfo;
44 
45  PortConfigInfo(const PortConfigInfo&) noexcept = default;
46  PortConfigInfo(PortConfigInfo&&) noexcept = default;
47  PortConfigInfo& operator=(const PortConfigInfo&) noexcept = default;
48  PortConfigInfo& operator=(PortConfigInfo&&) noexcept = default;
49 
54  PortConfigInfo(uint32_t portType = DEFAULT_PORT_TYPE,
55  uint32_t deviceId = DEFAULT_DEVICE_ID,
56  uint32_t memoryType = DEFAULT_MEMORY_TYPE) noexcept;
57 
60  PortConfigInfo(const cxx::Serialization& serialization) noexcept;
61 
63  operator cxx::Serialization() const noexcept;
64 
67  bool operator==(const PortConfigInfo& rhs) const noexcept;
68 };
69 
70 } // namespace runtime
71 } // namespace iox
72 
73 #endif // IOX_POSH_RUNTIME_PORT_CONFIG_INFO_HPP
Stores properties of the memory to be used when we distinguish between different types of memory on e...
Definition: memory_info.hpp:29
Stores information necessary to create the right type of port on RouDi side. Different types of ports...
Definition: port_config_info.hpp:33
PortConfigInfo(uint32_t portType=DEFAULT_PORT_TYPE, uint32_t deviceId=DEFAULT_DEVICE_ID, uint32_t memoryType=DEFAULT_MEMORY_TYPE) noexcept
creates a PortConfigInfo object
PortConfigInfo(const cxx::Serialization &serialization) noexcept
creates a PortConfigInfo object from its serialization