ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::detail::UIntConv< T > Union Template Reference

Helpers for converting between uintptr_t and a pointer or integer. More...

#include <UIntConv.h>

Collaboration diagram for CxxUtils::detail::UIntConv< T >:

Public Types

using uint_t = typename SizedUInt<sizeof(T)>::type

Static Public Member Functions

static uintptr_t valToUInt (T x)
 Convert a T to a uintptr_t.
static T uintToVal (uintptr_t ui)
 Convert a uintptr_t to a T.

Public Attributes

uint_t ui
x

Detailed Description

template<class T>
union CxxUtils::detail::UIntConv< T >

Helpers for converting between uintptr_t and a pointer or integer.

Definition at line 36 of file UIntConv.h.

Member Typedef Documentation

◆ uint_t

template<class T>
using CxxUtils::detail::UIntConv< T >::uint_t = typename SizedUInt<sizeof(T)>::type

Definition at line 39 of file UIntConv.h.

Member Function Documentation

◆ uintToVal()

template<class T>
T CxxUtils::detail::UIntConv< T >::uintToVal ( uintptr_t ui)
inlinestatic

Convert a uintptr_t to a T.

Definition at line 59 of file UIntConv.h.

59 {
60 UIntConv u;
61 u.ui = static_cast<uint_t>(ui);
62 return u.x;
63 };
Helpers for converting between uintptr_t and a pointer or integer.
Definition UIntConv.h:37
typename SizedUInt< sizeof(T)>::type uint_t
Definition UIntConv.h:39

◆ valToUInt()

template<class T>
uintptr_t CxxUtils::detail::UIntConv< T >::valToUInt ( T x)
inlinestatic

Convert a T to a uintptr_t.

Definition at line 49 of file UIntConv.h.

49 {
50 UIntConv u;
51 u.x = x;
52 return static_cast<uintptr_t> (u.ui);
53 };

Member Data Documentation

◆ ui

template<class T>
uint_t CxxUtils::detail::UIntConv< T >::ui

Definition at line 42 of file UIntConv.h.

◆ x

template<class T>
T CxxUtils::detail::UIntConv< T >::x

Definition at line 43 of file UIntConv.h.


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