iceoryx_doc  1.0.1
memory_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_MEPOO_MEMORY_INFO_HPP
17 #define IOX_POSH_MEPOO_MEMORY_INFO_HPP
18 
19 #include <cstdint>
20 
21 namespace iox
22 {
23 namespace mepoo
24 {
27 struct MemoryInfo
28 {
29  static constexpr uint32_t DEFAULT_DEVICE_ID{0u};
30  static constexpr uint32_t DEFAULT_MEMORY_TYPE{0u};
31 
32  // These are intentionally not defined as enum classes for flexibility and extendibility.
33  // Currently only the defaults are used.
34  // This will change when we support different devices (CPU, GPUs, ...)
35  // and other properties that influence how memory is accessed.
36 
37  uint32_t deviceId{DEFAULT_DEVICE_ID};
38  uint32_t memoryType{DEFAULT_MEMORY_TYPE};
39 
40  MemoryInfo(const MemoryInfo&) = default;
41  MemoryInfo(MemoryInfo&&) = default;
42  MemoryInfo& operator=(const MemoryInfo&) = default;
43  MemoryInfo& operator=(MemoryInfo&&) = default;
44 
48  MemoryInfo(uint32_t deviceId = DEFAULT_DEVICE_ID, uint32_t memoryType = DEFAULT_MEMORY_TYPE);
49 };
50 } // namespace mepoo
51 } // namespace iox
52 
53 #endif // IOX_POSH_MEPOO_MEMORY_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
MemoryInfo(uint32_t deviceId=DEFAULT_DEVICE_ID, uint32_t memoryType=DEFAULT_MEMORY_TYPE)
creates a MemoryInfo object