Honeycomb
0.1
Component-Model Framework
|
Bit util common to any endian type. Use through class BitOp. More...
#include <BitOp.h>
Static Public Member Functions | |
template<class T > | |
static T | rotLeft (const T v, const int n) |
Rotate integer bits cyclically to the left. More... | |
template<class T > | |
static T | rotRight (const T v, const int n) |
Rotate integer bits cyclically to the right. More... | |
static uint8 | swap (const uint8 v) |
Reverse order of bytes in an unsigned integer. More... | |
static uint16 | swap (const uint16 v) |
static uint32 | swap (const uint32 v) |
static uint64 | swap (const uint64 v) |
template<class T > | |
static T | swap (const T v) |
Reverse order of bytes in a signed integer. More... | |
static uint8 | high (const uint16 v) |
Retrieve high bytes from integer. More... | |
static uint16 | high (const uint32 v) |
static uint32 | high (const uint64 v) |
static uint8 | low (const uint16 v) |
Retrieve low bytes from integer. More... | |
static uint16 | low (const uint32 v) |
static uint32 | low (const uint64 v) |
static uint32 | fromParts (const uint16 hi, const uint16 lo) |
Convert smaller integer parts into a full integer. More... | |
static uint64 | fromParts (const uint32 hi, const uint32 lo) |
template<class UInt > | |
static UInt | fromPartsLittle (const uint8 *p) |
template<class UInt > | |
static UInt | fromPartsBig (const uint8 *p) |
template<class UInt > | |
static void | toPartsLittle (const UInt v, uint8 *p) |
template<class UInt > | |
static void | toPartsBig (const UInt v, uint8 *p) |
static int | popCount (uint32 x) |
Get number of non-zero bits in unsigned integer. More... | |
static int | popCount (uint64 x) |
template<class UInt > | |
static bool | isPow2 (UInt x) |
Check if unsigned integer is a power of two. More... | |
template<class UInt > | |
static UInt | pow2Floor (UInt x) |
Calc nearest power of two <= unsigned integer. More... | |
static uint32 | pow2Ceil (uint32 x) |
Calc nearest power of two >= unsigned integer. More... | |
static uint64 | pow2Ceil (uint64 x) |
static int | log2Floor (uint32 x) |
Calc log base 2 of unsigned integer, rounded down to nearest integer. Returns -1 if x is zero. More... | |
static int | log2Floor (uint64 x) |
static int | log2Ceil (uint32 x) |
Calc log base 2 of unsigned integer, rounded up to nearest integer. Returns -1 if x is zero. More... | |
static int | log2Ceil (uint64 x) |
static uint8 | reverse (uint8 v) |
Reverse order of bits in an unsigned integer. More... | |
static uint16 | reverse (uint16 v) |
static uint32 | reverse (uint32 v) |
static uint64 | reverse (uint64 v) |
Bit util common to any endian type. Use through class BitOp.
Convert smaller integer parts into a full integer.
|
inlinestatic |
|
inlinestatic |
Retrieve high bytes from integer.
|
inlinestatic |
Check if unsigned integer is a power of two.
|
inlinestatic |
Calc log base 2 of unsigned integer, rounded up to nearest integer. Returns -1 if x is zero.
|
inlinestatic |
|
inlinestatic |
Calc log base 2 of unsigned integer, rounded down to nearest integer. Returns -1 if x is zero.
|
inlinestatic |
Retrieve low bytes from integer.
|
inlinestatic |
Get number of non-zero bits in unsigned integer.
|
inlinestatic |
Calc nearest power of two >= unsigned integer.
|
inlinestatic |
Calc nearest power of two <= unsigned integer.
Reverse order of bits in an unsigned integer.
|
inlinestatic |
Rotate integer bits cyclically to the left.
|
inlinestatic |
Rotate integer bits cyclically to the right.
Reverse order of bytes in an unsigned integer.
|
inlinestatic |
Reverse order of bytes in a signed integer.
|
inlinestatic |
|
inlinestatic |