libcosmos
Linux C++ System Programming Library
|
An endianness aware unsigned integer. More...
#include <byte_order.hxx>
Public Types | |
using | RawInt = typename RawIntTraits<T, endianness>::Int |
Public Member Functions | |
constexpr | EndianNumber () |
Construct a zero-initialized integer. | |
constexpr | EndianNumber (const no_init_t) |
Leave member undefined e.g. for use with placement new or for performance reasons. | |
constexpr | EndianNumber (const RawInt rint) |
Construct the number from a raw integer in the correct byte order. | |
constexpr | EndianNumber (const T egg) |
Constructs the number from a native integer that will possibly be converted into the correct byte order. | |
constexpr | EndianNumber (const EndianNumber< T, EndianTraits< endianness >::other > other) |
Constructs the number from an EndianNumber of differing Endian type. | |
void | setFromHost (const T egg) |
constexpr T | toHost () const |
operator T () const | |
RawInt | raw () const |
Static Protected Member Functions | |
static constexpr T | toTargetEndianness (const T egg) |
Protected Attributes | |
T | m_egg |
An endianness aware unsigned integer.
This type stores an unsigned primitive integer in the given byte order endianness. The interface takes host byte order on input and returns host byte order on output. Only the raw() function returns the unmodified value, possibly in a foreign byte order, as a strong enum type obtained from RawIntTraits.
Definition at line 159 of file byte_order.hxx.
using cosmos::net::EndianNumber< T, endianness >::RawInt = typename RawIntTraits<T, endianness>::Int |
Definition at line 162 of file byte_order.hxx.
|
inlineconstexpr |
Construct a zero-initialized integer.
Definition at line 167 of file byte_order.hxx.
|
inlineconstexpr |
Leave member undefined e.g. for use with placement new or for performance reasons.
Definition at line 170 of file byte_order.hxx.
|
inlineconstexpr |
Construct the number from a raw integer in the correct byte order.
Definition at line 173 of file byte_order.hxx.
|
inlineconstexpr |
Constructs the number from a native integer that will possibly be converted into the correct byte order.
Definition at line 178 of file byte_order.hxx.
|
inlineconstexpr |
Constructs the number from an EndianNumber of differing Endian type.
Definition at line 183 of file byte_order.hxx.
|
inline |
Definition at line 199 of file byte_order.hxx.
|
inline |
Definition at line 203 of file byte_order.hxx.
|
inline |
Definition at line 187 of file byte_order.hxx.
|
inlineconstexpr |
Definition at line 191 of file byte_order.hxx.
|
inlinestaticconstexprprotected |
Definition at line 209 of file byte_order.hxx.
|
protected |
Definition at line 219 of file byte_order.hxx.