iceoryx_doc  1.0.1
port_config_info.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_RUNTIME_PORT_CONFIG_INFO_HPP
17 #define IOX_POSH_RUNTIME_PORT_CONFIG_INFO_HPP
18 
19 #include "iceoryx_posh/mepoo/memory_info.hpp"
20 #include "iceoryx_utils/cxx/serialization.hpp"
21 
22 #include <cstdint>
23 
24 namespace iox
25 {
26 namespace runtime
27 {
32 {
33  static constexpr uint32_t DEFAULT_PORT_TYPE{0u};
34  static constexpr uint32_t DEFAULT_DEVICE_ID{0u};
35  static constexpr uint32_t DEFAULT_MEMORY_TYPE{0u};
36 
37  // these are intentionally not defined as enum classes for flexibility and extendibility
38  // with specific user defined codes used by custom ports
39  // values will be resolved at lower level, (i.e. in the port creation factory)
40 
41  uint32_t portType{DEFAULT_PORT_TYPE};
42  iox::mepoo::MemoryInfo memoryInfo;
43 
44  PortConfigInfo(const PortConfigInfo&) = default;
45  PortConfigInfo(PortConfigInfo&&) = default;
46  PortConfigInfo& operator=(const PortConfigInfo&) = default;
47  PortConfigInfo& operator=(PortConfigInfo&&) = default;
48 
53  PortConfigInfo(uint32_t portType = DEFAULT_PORT_TYPE,
54  uint32_t deviceId = DEFAULT_DEVICE_ID,
55  uint32_t memoryType = DEFAULT_MEMORY_TYPE) noexcept;
56 
59  PortConfigInfo(const cxx::Serialization& serialization);
60 
62  operator cxx::Serialization() const noexcept;
63 };
64 
65 } // namespace runtime
66 } // namespace iox
67 
68 #endif // IOX_POSH_RUNTIME_PORT_CONFIG_INFO_HPP
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
Stores information necessary to create the right type of port on RouDi side. Different types of ports...
Definition: port_config_info.hpp:32
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)
creates a PortConfigInfo object from its serialization