tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
pointer_int_pair_info< PointerT, IntBits, PtrTraits > Struct Template Reference

#include <pointer_int_pair_info.hpp>

Public Types

using pointer_traits = PtrTraits
 
using pointer_type = PointerT
 

Static Public Member Functions

static auto get_int (etl::intptr_t value) -> etl::intptr_t
 
static auto get_pointer (etl::intptr_t value) -> pointer_type
 
static auto update_int (etl::intptr_t value, etl::intptr_t integer) -> etl::intptr_t
 
static auto update_ptr (etl::intptr_t value, pointer_type ptr) -> etl::intptr_t
 

Static Public Attributes

static constexpr auto free_bits = pointer_traits::free_bits
 
static constexpr auto int_bits = IntBits
 
static constexpr auto int_mask = static_cast<etl::uintptr_t>((static_cast<etl::intptr_t>(1) << int_bits) - 1)
 This is the unshifted mask for valid bits of the int type.
 
static constexpr auto int_shift = static_cast<etl::uintptr_t>(pointer_traits::free_bits - int_bits)
 The number of low bits that we reserve for other uses; and keep zero.
 
static constexpr auto ptr_mask = ~static_cast<etl::uintptr_t>((static_cast<etl::intptr_t>(1) << free_bits) - 1)
 The bits that come from the pointer.
 
static constexpr auto shifted_int_mask = static_cast<etl::uintptr_t>(int_mask << int_shift)
 This is the bits for the integer shifted in place.
 

Member Typedef Documentation

◆ pointer_traits

template<typename PointerT, unsigned IntBits, typename PtrTraits>
using pointer_traits = PtrTraits

◆ pointer_type

template<typename PointerT, unsigned IntBits, typename PtrTraits>
using pointer_type = PointerT

Member Function Documentation

◆ get_int()

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto get_int ( etl::intptr_t value) -> etl::intptr_t
inlinestaticnodiscard

◆ get_pointer()

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto get_pointer ( etl::intptr_t value) -> pointer_type
inlinestaticnodiscard

◆ update_int()

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto update_int ( etl::intptr_t value,
etl::intptr_t integer ) -> etl::intptr_t
inlinestaticnodiscard

◆ update_ptr()

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto update_ptr ( etl::intptr_t value,
pointer_type ptr ) -> etl::intptr_t
inlinestaticnodiscard

Member Data Documentation

◆ free_bits

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto free_bits = pointer_traits::free_bits
staticconstexpr

◆ int_bits

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto int_bits = IntBits
staticconstexpr

◆ int_mask

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto int_mask = static_cast<etl::uintptr_t>((static_cast<etl::intptr_t>(1) << int_bits) - 1)
staticconstexpr

This is the unshifted mask for valid bits of the int type.

◆ int_shift

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto int_shift = static_cast<etl::uintptr_t>(pointer_traits::free_bits - int_bits)
staticconstexpr

The number of low bits that we reserve for other uses; and keep zero.

◆ ptr_mask

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto ptr_mask = ~static_cast<etl::uintptr_t>((static_cast<etl::intptr_t>(1) << free_bits) - 1)
staticconstexpr

The bits that come from the pointer.

◆ shifted_int_mask

template<typename PointerT, unsigned IntBits, typename PtrTraits>
auto shifted_int_mask = static_cast<etl::uintptr_t>(int_mask << int_shift)
staticconstexpr

This is the bits for the integer shifted in place.


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