vitrio 0.3.1
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
vitrio::memory_range Class Reference

A stretch of memory: where it starts and how many bytes it covers. More...

#include <vitrio/memory_range.hpp>

Public Member Functions

 memory_range (void *address, std::size_t size) noexcept
 Construct a stretch from its first byte and its size.
 memory_range (const memory_range &other)=default
 memory_range (memory_range &&other) noexcept=default
memory_range & operator= (const memory_range &other)=default
memory_range & operator= (memory_range &&other) noexcept=default
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.

Detailed Description

A stretch of memory: where it starts and how many bytes it covers.

It names where something lies in the address space, not elements to be accessed, which is what a span is for.

Constructor & Destructor Documentation

◆ memory_range()

vitrio::memory_range::memory_range ( void * address,
std::size_t size )
noexcept

Construct a stretch from its first byte and its size.

Parameters
addressFirst byte of the stretch.
sizeHow many bytes it covers.

Member Function Documentation

◆ get_address()

void * vitrio::memory_range::get_address ( ) const
noexcept

Get the first byte of the stretch.

Returns
void* Its address.

◆ get_size()

std::size_t vitrio::memory_range::get_size ( ) const
noexcept

Get how many bytes the stretch covers.

Returns
std::size_t The size in bytes.

The documentation for this class was generated from the following file: