|
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 no byte swapping.
The classes LittleEndian and BigEndian either map to NativeEndian or SwapEndian. If the machine's endian matches the class, then it maps to this class.
This class does nothing for most functions by design. It is meant to vanish when the program is asking for no endian swapping since the data being read is the same endian as the machine.
The only functions that do not disappear are the load_unaligned(T*) or store_unaligned(T*, T) group of calls since they have the ability to fetch a 16, 32 or 64 bit value regardless of the alignment of the data pointer. These are useful in grabbing data from a byte stream and won't trigger an alignment access fault.
Under most circumstances, you will not call this class directly.
- See also
- SwapEndian, LittleEndian and BigEndian
template<typename T >
static constexpr remove_pointer< T >::type Burger::NativeEndian::load |
( |
T | Input | ) |
|
|
inlinestaticconstexprnoexcept |
Load an arithmetic value.
Given either an arithmetic type, or a pointer to an arithmetic type, load the value and return it without modification.
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 as is. |
- Returns
- The input value or the loaded value from pointer.
- See also
- SwapEndian::load(T)