Bit coding and byte order
More...
|
| using | uint8_t = std::uint8_t |
| | 8 bit unsigned word
|
| |
| using | uint16_t = std::uint16_t |
| | 16 bit unsigned word
|
| |
| using | uint32_t = std::uint32_t |
| | 32 bit unsigned word
|
| |
| using | uint64_t = std::uint64_t |
| | 64 bit unsigned word
|
| |
| using | int8_t = std::int8_t |
| | 8 bit signed word
|
| |
| using | int16_t = std::int16_t |
| | 16 bit signed word
|
| |
| using | int32_t = std::int32_t |
| | 32 bit signed word
|
| |
| using | int64_t = std::int64_t |
| | 64 bit signed word
|
| |
|
| template<class B , class A > |
| B | union_cast (A a) |
| | Optimization safe raw type casting.
|
| |
| ByteOrder | localEndian () |
| | Return the current system byte order
|
| |
| template<class T > |
| T | byteSwap (T x) |
| | Swap endianess of x.
|
| |
| template<class T > |
| T | endianGate (T x, const ByteOrder channelByteOrder=ByteOrder::BigEndian) |
| | Swap endianess of x from channelByteOrder to system byte order.
|
| |
| template<unsigned j, unsigned i = j, class T , class V > |
| void | bitAssign (T &word, V newValue) |
| | Access bits i to j in word.
|
| |
| template<class T > |
| T | bitmask (unsigned n) |
| | Get bitmask of n bits.
|
| |
| template<class T > |
| T | bit (unsigned j, unsigned i, const T &word) |
| | Get bits i to j in word.
|
| |
| template<unsigned j, unsigned i = j, class T > |
| T | bit (const T &word) |
| | Get bits i to j in word.
|
| |
Bit coding and byte order
◆ uint8_t
◆ uint16_t
◆ uint32_t
◆ uint64_t
◆ int8_t
◆ int16_t
◆ int32_t
◆ int64_t
◆ ByteOrder
Byte order.
| Enumerator |
|---|
| LittleEndian | Low order byte precedes the high order byte.
|
| BigEndian | High order byte precedes the low order byte.
|
◆ union_cast()
template<class B , class A >
Optimization safe raw type casting.
◆ localEndian()
Return the current system byte order
◆ byteSwap()
◆ endianGate()
Swap endianess of x from channelByteOrder to system byte order.
- Template Parameters
-
◆ bitAssign()
template<unsigned j, unsigned i = j, class T , class V >
| void bitAssign |
( |
T & | word, |
|
|
V | newValue ) |
Access bits i to j in word.
◆ bitmask()
◆ bit() [1/2]
template<class T >
| T bit |
( |
unsigned | j, |
|
|
unsigned | i, |
|
|
const T & | word ) |
◆ bit() [2/2]
template<unsigned j, unsigned i = j, class T >