OGLplus  (0.59.0) a C++ wrapper for rendering APIs

address.hpp File Reference
#include "../assert.hpp"
#include "../types.hpp"
#include "align.hpp"
#include <cstddef>
#include <type_traits>

Go to the source code of this file.

Classes

class  eagine::memory::basic_address< IsConst >
 Class for handling memory addresses as integer values. More...
 

Namespaces

 eagine
 Common code is placed in this namespace.
 

Typedefs

using eagine::memory::const_address = basic_address< true >
 Type alias for const memory address values.
 
using eagine::memory::address = basic_address< false >
 Type alias for non-const memory address values.
 

Functions

template<typename T >
static constexpr auto eagine::memory::as_address (T *addr) noexcept
 Casts a pointer to basic_address.
 
static constexpr auto eagine::memory::misalignment (const_address addr, span_size_t alignment) noexcept
 Returns the misalignment of a memory address to the specified alignment.
 
static constexpr auto eagine::memory::misalignment (const void *ptr, span_size_t alignment) noexcept
 Returns the misalignment of a pointer to the specified alignment.
 
static constexpr auto eagine::memory::is_aligned_to (const_address addr, span_size_t alignment) noexcept
 Indicates if a memory address aligned to the specified alignment.
 
static constexpr auto eagine::memory::is_aligned_to (const void *ptr, span_size_t alignment) noexcept
 Indicates if a pointer is aligned to the specified alignment.
 
template<typename T >
static constexpr auto eagine::memory::is_aligned_as (const_address addr, type_identity< T > tid={}) noexcept
 Indicates if a memory address aligned as the specified type T.
 
template<bool IsConst>
static constexpr auto eagine::memory::align_up (basic_address< IsConst > addr, span_size_t align, span_size_t max) noexcept -> basic_address< IsConst >
 Aligns a memory address up to the specified alignment. More...
 
template<bool IsConst>
static constexpr auto eagine::memory::align_down (basic_address< IsConst > addr, span_size_t align, span_size_t max) noexcept -> basic_address< IsConst >
 Aligns a memory address down to the specified alignment. More...
 
template<bool IsConst>
static constexpr auto eagine::memory::align_down (basic_address< IsConst > addr, span_size_t align) noexcept
 Aligns a memory address down to the specified alignment.
 
static auto eagine::memory::align_down (const byte *ptr, span_size_t align) -> const byte *
 Aligns a byte pointer down to the specified alignment.
 
template<typename T >
static constexpr auto eagine::memory::align_up_to (basic_address< std::is_const_v< T >> addr, type_identity< T >={}, span_size_t align=span_align_of< T >(), span_size_t max=span_size_of< T >()) noexcept
 Aligns a memory address up to the required alignment of type T. More...
 
template<typename T >
static constexpr auto eagine::memory::align_down_to (basic_address< std::is_const_v< T >> addr, type_identity< T >={}, span_size_t align=span_align_of< T >(), span_size_t max=span_size_of< T >()) noexcept
 Aligns a memory address down to the required alignment of type T. More...
 

Detailed Description

Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt


Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).