Honeycomb  0.1
Component-Model Framework
Static Public Member Functions | List of all members
honey::BitOpCommon Struct Reference

Bit util common to any endian type. Use through class BitOp. More...

#include <BitOp.h>

Inheritance diagram for honey::BitOpCommon:
Inheritance graph
[legend]

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)
 

Detailed Description

Bit util common to any endian type. Use through class BitOp.

Member Function Documentation

static uint32 honey::BitOpCommon::fromParts ( const uint16  hi,
const uint16  lo 
)
inlinestatic

Convert smaller integer parts into a full integer.

static uint64 honey::BitOpCommon::fromParts ( const uint32  hi,
const uint32  lo 
)
inlinestatic
template<class UInt >
static UInt honey::BitOpCommon::fromPartsBig ( const uint8 p)
inlinestatic
template<class UInt >
static UInt honey::BitOpCommon::fromPartsLittle ( const uint8 p)
inlinestatic
static uint8 honey::BitOpCommon::high ( const uint16  v)
inlinestatic

Retrieve high bytes from integer.

static uint16 honey::BitOpCommon::high ( const uint32  v)
inlinestatic
static uint32 honey::BitOpCommon::high ( const uint64  v)
inlinestatic
template<class UInt >
static bool honey::BitOpCommon::isPow2 ( UInt  x)
inlinestatic

Check if unsigned integer is a power of two.

static int honey::BitOpCommon::log2Ceil ( uint32  x)
inlinestatic

Calc log base 2 of unsigned integer, rounded up to nearest integer. Returns -1 if x is zero.

static int honey::BitOpCommon::log2Ceil ( uint64  x)
inlinestatic
static int honey::BitOpCommon::log2Floor ( uint32  x)
inlinestatic

Calc log base 2 of unsigned integer, rounded down to nearest integer. Returns -1 if x is zero.

static int honey::BitOpCommon::log2Floor ( uint64  x)
inlinestatic
static uint8 honey::BitOpCommon::low ( const uint16  v)
inlinestatic

Retrieve low bytes from integer.

static uint16 honey::BitOpCommon::low ( const uint32  v)
inlinestatic
static uint32 honey::BitOpCommon::low ( const uint64  v)
inlinestatic
static int honey::BitOpCommon::popCount ( uint32  x)
inlinestatic

Get number of non-zero bits in unsigned integer.

static int honey::BitOpCommon::popCount ( uint64  x)
inlinestatic
static uint32 honey::BitOpCommon::pow2Ceil ( uint32  x)
inlinestatic

Calc nearest power of two >= unsigned integer.

static uint64 honey::BitOpCommon::pow2Ceil ( uint64  x)
inlinestatic
template<class UInt >
static UInt honey::BitOpCommon::pow2Floor ( UInt  x)
inlinestatic

Calc nearest power of two <= unsigned integer.

static uint8 honey::BitOpCommon::reverse ( uint8  v)
inlinestatic

Reverse order of bits in an unsigned integer.

static uint16 honey::BitOpCommon::reverse ( uint16  v)
inlinestatic
static uint32 honey::BitOpCommon::reverse ( uint32  v)
inlinestatic
static uint64 honey::BitOpCommon::reverse ( uint64  v)
inlinestatic
template<class T >
static T honey::BitOpCommon::rotLeft ( const T  v,
const int  n 
)
inlinestatic

Rotate integer bits cyclically to the left.

template<class T >
static T honey::BitOpCommon::rotRight ( const T  v,
const int  n 
)
inlinestatic

Rotate integer bits cyclically to the right.

static uint8 honey::BitOpCommon::swap ( const uint8  v)
inlinestatic

Reverse order of bytes in an unsigned integer.

static uint16 honey::BitOpCommon::swap ( const uint16  v)
inlinestatic
static uint32 honey::BitOpCommon::swap ( const uint32  v)
inlinestatic
static uint64 honey::BitOpCommon::swap ( const uint64  v)
inlinestatic
template<class T >
static T honey::BitOpCommon::swap ( const T  v)
inlinestatic

Reverse order of bytes in a signed integer.

template<class UInt >
static void honey::BitOpCommon::toPartsBig ( const UInt  v,
uint8 p 
)
inlinestatic
template<class UInt >
static void honey::BitOpCommon::toPartsLittle ( const UInt  v,
uint8 p 
)
inlinestatic

The documentation for this struct was generated from the following file: