8#ifndef HPP_ALIB_BOXING_PLACEHOLDER
9#define HPP_ALIB_BOXING_PLACEHOLDER 1
11#if !defined(HPP_ALIB_BOXING_BOXING)
12# error "ALib sources with ending '.inl' must not be included from outside."
17namespace alib {
namespace boxing {
namespace detail {
47 #elif ALIB_SIZEOF_INTEGER != 4
50 #elif ALIB_SIZEOF_INTEGER != 8
65 #elif ALIB_SIZEOF_INTEGER != 4
67 #elif ALIB_SIZEOF_INTEGER != 8
80 constexpr UnionIntegrals ( int16_t value ) :
Int16 { value } {}
81 constexpr UnionIntegrals ( uint16_t value ) :
UInt16 { value } {}
82 #if ALIB_SIZEOF_INTEGER != 4
83 constexpr UnionIntegrals ( int32_t value ) :
Int32 { value } {}
84 constexpr UnionIntegrals ( uint32_t value ) :
UInt32 { value } {}
85 #elif ALIB_SIZEOF_INTEGER != 8
86 constexpr UnionIntegrals ( int64_t value ) :
Int64 { value } {}
87 constexpr UnionIntegrals ( uint64_t value ) :
UInt64 { value } {}
89 constexpr UnionIntegrals (
integer value ) :
Int { value } {}
90 constexpr UnionIntegrals (
uinteger value ) :
UInt { value } {}
94 #if ALIB_SIZEOF_INTGAP == 2
95 constexpr UnionIntegrals (
intGap_t value ) :
Int16 { value } {}
97 #elif ALIB_SIZEOF_INTGAP == 4
98 #if ALIB_SIZEOF_INTEGER != 4
99 constexpr UnionIntegrals (
intGap_t value ) :
Int32 { value } {}
102 constexpr UnionIntegrals (
intGap_t value ) :
Int { value } {}
103 constexpr UnionIntegrals (
uintGap_t value ) :
UInt { value } {}
105 #elif ALIB_SIZEOF_INTGAP == 8
106 #if ALIB_SIZEOF_INTEGER != 8
107 constexpr UnionIntegrals (
intGap_t value ) :
Int64 { value } {}
110 constexpr UnionIntegrals (
intGap_t value ) :
Int { value } {}
111 constexpr UnionIntegrals (
uintGap_t value ) :
UInt { value } {}
114 #error "ALIB_SIZEOF_INTGAP not matched. Supported sizes are 2, 4 and 8."
169 constexpr UnionPointers(
const char* value ) :
CChar { value } {}
170 constexpr UnionPointers(
wchar* value ) :
WChar { value } {}
171 constexpr UnionPointers(
const wchar* value ) :
CWChar { value } {}
173 constexpr UnionPointers(
const void* v1,
const void* v2 ) :
CVoidArray { v1, v2 } {}
174 constexpr UnionPointers(
const char* v1,
const char* v2 ) :
CCharArray { v1, v2 } {}
292 template<
typename TMapped>
313 template<
typename TArray>
321 template<
typename TReturn>
389 template<
unsigned int UsageLength>
392 static_assert( UsageLength > 0 && ( UsageLength <= 2 *
sizeof(
uinteger) ),
393 "Invalid usage length given" );
397 if constexpr( UsageLength >
sizeof(
integer) )
419 template<
typename TMapped>
420 inline void Write(
const TMapped& value);
423 template<
typename TMapped>
426 && (
sizeof(TMapped) <= 2 *
sizeof(
uinteger)) )
427 Write(
const TMapped& value)
429 *
reinterpret_cast<TMapped*
>( &
Pointers ) = value;
447 template<
typename TMapped>
448 inline void Write(
const TMapped& value);
451 template<
typename TMapped>
454 && (
sizeof(TMapped) <= 2 *
sizeof(
uinteger)) )
455 Write(
const TMapped& value)
477 template<
typename TArray>
482 template<
typename TArray>
503 template<
typename TMapped>
513static_assert(
sizeof(Placeholder) == 2 *
sizeof(std::size_t),
514 "Size of boxing::Placeholder is not two times the size of 'size_t'. "
515 "Compilation platform not supported." );
#define ATMP_VOID_IF(Cond)
#define ALIB_WARNINGS_RESTORE
#define ALIB_FORCE_INLINE
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
lang::uinteger uinteger
Type alias in namespace alib.
characters::wchar wchar
Type alias in namespace alib.
lang::intGap_t intGap_t
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.
lang::uintGap_t uintGap_t
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
integer Length
The length of the array.
const void * Pointer
The pointer to the array.
constexpr TReturn * Pointer() const
constexpr void Pointer(const char *value)
character * Debugger_String
This union field was inserted only for debug display.
ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE constexpr integer GetInteger(int idx) const
constexpr uinteger ULength() const
detail::UnionIntegrals Integrals
Collection of integrals of different sizes.
Placeholder()
Default constructor, leaves everything uninitialized.
constexpr void SetUInteger(int idx, uinteger value)
integer Debugger_Integral
This union field was inserted only for debug display.
constexpr integer Length() const
constexpr void SetInteger(int idx, integer value)
constexpr void VoidPointer(const void *value)
detail::UnionFloatingPoints FloatingPoints
Collection of floating points of different sizes.
constexpr uinteger GetUInteger(int idx) const
detail::UnionPointers Pointers
Collection of void, char and character pointers.
constexpr void Write(const TArray *pointer, integer length)
constexpr void * VoidPointer() const
ALIB_WARNINGS_RESTORE constexpr void Clear()
ALIB_FORCE_INLINE constexpr TMapped Read() const
detail::StructArray Array
Used when storing C++ arrays.
void Write(const TMapped &value)
float Float
A float value.
float FloatArray[2 *sizeof(uinteger)/sizeof(float)]
Array of float. The Length is usually 4 on 64-bit platform, 2 on a 32-bit platform.
double Double
A double value.
double DoubleArray[2 *sizeof(uinteger)/sizeof(double)]
Array of double. The Length is usually 2 on 64-bit platform, 1 on a 32-bit platform.
int64_t Int64
64-bit signed integral. Available only if platform is not of 64-bit.
integer Int
Signed integral of platform-dependent size.
uint8_t UInt8
8-bit unsigned integral.
int8_t Int8
8-bit signed integral.
uinteger UInt
Unsigned integral of platform-dependent size.
int64_t Array64[2 *sizeof(uinteger)/sizeof(int64_t)]
Array of 64-bit signed integrals of length 1 on a 32-bit platform. Not available on 64-bit platforms.
int8_t Array8[2 *sizeof(uinteger)/sizeof(int8_t)]
Array of 8-bit signed integrals of length 16 on 64-bit platform, 8 on a 32-bit platform.
int32_t Int32
32-bit signed integral. Available only if platform is not of 32-bit.
uint16_t UInt16
16-bit unsigned integral.
integer Array[2]
Array of 64-bit signed integrals of length 2 on 64-bit platform, 1 on a 32-bit platform.
uinteger UArray[2]
Array of 64-bit unsigned integrals of length 2 on 64-bit platform, 1 on a 32-bit platform.
int16_t Int16
16-bit signed integral.
int32_t Array32[2 *sizeof(uinteger)/sizeof(int32_t)]
Array of 32-bit signed integrals of length 4 on a 64-bit platform. Not available on 32-bit platforms.
int16_t Array16[2 *sizeof(uinteger)/sizeof(int16_t)]
Array of 16-bit signed integrals of length 8 on 64-bit platform, 4 on a 32-bit platform.
uint32_t UInt32
32-bit unsigned integral. Available only if platform is not of 32-bit.
uint64_t UInt64
64-bit unsigned integral. Available only if platform is not of 64-bit.
wchar * WChar
A wchar pointer.
const char * CChar
A constant void pointer.
void * VoidArray[2]
Array of void* of length 2.
wchar * WCharArray[2]
Array of wchar* of length 2.
void * Void
A void pointer.
char Memory
Not a pointer but becomes one with applying operator&.
const char * CCharArray[2]
Array of const char* of length 2.
const void * CVoid
A constant void pointer.
const wchar * CWCharArray[2]
Array of const wchar* of length 2.
const wchar * CWChar
A constant wchar pointer.
char * Char
A void pointer.
const void * CVoidArray[2]
Array of const void* of length 2.
char * CharArray[2]
Array of char* of length 2.