|
template<typename T > |
static constexpr remove_pointer< T >::type | load (T Input) noexcept |
| Load an arithmetic value endian swapped.
|
|
template<typename T > |
static void | store (T *pOutput, T Input) noexcept |
| Reverse the endian of stored arithmetic value.
|
|
template<typename T > |
static void | store (volatile T *pOutput, T Input) noexcept |
| Reverse the endian of volatile stored arithmetic value.
|
|
template<typename T > |
static T | load_unaligned (T *pInput) noexcept |
| Fetch a byte swapped value from memory with byte alignment.
|
|
template<typename T > |
static void | store_unaligned (T *pOutput, T Input) noexcept |
| Reverse the endian of unaligned stored arithmetic value.
|
|
template<typename T > |
static void | fixup (T *pOutput) noexcept |
| Swap the endian of a variable.
|
|
template<typename T > |
static void | fixup (volatile T *pOutput) noexcept |
| Swap the endian of a volatile variable.
|
|
template<typename T > |
static void | fixup_unaligned (T *pOutput) noexcept |
| Swap the endian of a variable that is byte aligned.
|
|
template<typename T > |
static void | fixup_unaligned (volatile T *pOutput) noexcept |
| Swap the endian of a volatile variable that is byte aligned.
|
|
Swap the byte order of 16, 32 and 64 bit values.
When reading data from machines that are using different microprocessors, the byte order could be reversed. These functions will swap the byte order.
Whenever possible, these functions will use native CPU endian swap instructions for performance.
- Note
- These functions will always swap the bytes, LittleEndian or BigEndian to let the compiler determine whether byte swapping is needed.
- See also
- NativeEndian, LittleEndian and BigEndian
template<typename T >
static constexpr remove_pointer< T >::type Burger::SwapEndian::load |
( |
T | Input | ) |
|
|
inlinestaticconstexprnoexcept |
Load an arithmetic value endian swapped.
Given either an arithmetic type, or a pointer to an arithmetic type, load the value and return it with endian swapped.
If a non-arithmetic or pointer to non-arithmetic type is used, this template will throw a static assert.
- Note
- If a pointer is passed to this template, the pointer is assumed to be aligned to the data type's granularity.
- Template Parameters
-
T | Arithmetic type or pointer to arithmetic type. |
- Parameters
-
Input | The value to load from pointer or return endian swapped |
- Returns
- The input value or the loaded value from pointer.
- See also
- NativeEndian::load(T)