Loads a 16, 32 or 64 bit value with byte swapping if needed. More...
Additional Inherited Members | |
Static Public Member Functions inherited from Burger::NativeEndian | |
template<typename T > | |
static constexpr remove_pointer< T >::type | load (T Input) noexcept |
Load an arithmetic value. | |
template<typename T > | |
static void | store (T *pOutput, T Input) noexcept |
Store an arithmetic value. | |
template<typename T > | |
static void | store (volatile T *pOutput, T Input) noexcept |
Store an arithmetic value to a volatile variable. | |
template<typename T > | |
static T | load_unaligned (T *pInput) noexcept |
Fetch a value from memory with byte alignment. | |
template<typename T > | |
static void | store_unaligned (T *pOutput, T Input) noexcept |
Store a 16 bit unsigned value to memory with byte alignment. | |
template<typename T > | |
static void | fixup (T *) noexcept |
Does nothing. | |
template<typename T > | |
static void | fixup_unaligned (T *) noexcept |
Does nothing. | |
Loads a 16, 32 or 64 bit value with byte swapping if needed.
This class will map to either to NativeEndian or SwapEndian depending on if this is a big endian machine or not. Use of this class will allow the programmer to write code that is endian neutral since the compiler will perform the proper mapping depending on the target's settings..
Big endian is considered true if the uint32_t value 0x12345678 is stored in memory as 0x12, 0x34, 0x56, 0x78.
Examples of use: