vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
memory_range.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/export.hpp>
6
7#include <cstddef>
8
9namespace vitrio
10{
11
18class VITRIO_API memory_range
19{
20public:
27 memory_range(void *address, std::size_t size) noexcept;
28
29 memory_range(const memory_range &other) = default;
30 memory_range(memory_range &&other) noexcept = default;
31 ~memory_range() = default;
32
33 memory_range& operator=(const memory_range &other) = default;
34 memory_range& operator=(memory_range &&other) noexcept = default;
35
41 void* get_address() const noexcept;
42
48 std::size_t get_size() const noexcept;
49
50private:
51 void *m_address;
52 std::size_t m_size;
53};
54
55} // namespace vitrio
void * get_address() const noexcept
Get the first byte of the stretch.
std::size_t get_size() const noexcept
Get how many bytes the stretch covers.
memory_range(void *address, std::size_t size) noexcept
Construct a stretch from its first byte and its size.