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