Phoenix
Object-oriented orthogonally persistent operating system
Classes | Functions
anonymous_namespace{utils.h} Namespace Reference

Classes

struct  UnalignedData
 Helper structure for accessing unaligned data fields. More...

Functions

template<typename T >
Min (T x, T y)
 Minimal value.
template<typename T >
Max (T x, T y)
 Maximal value.
template<typename T , typename Tal >
RoundUp (T size, Tal align)
 Round up the value with specified alignment.
template<typename T , typename Tal >
RoundDown (T size, Tal align)
 Round down the value with specified alignment.
template<typename T >
bool IsPowerOf2 (T value)
 Check if specified value is an integer power of two.
template<typename T , typename Tal >
RoundUp2 (T size, Tal align)
 Round up the value with specified alignment.
template<typename T , typename Tal >
RoundDown2 (T size, Tal align)
 Round down the value with specified alignment.
template<typename T >
RotL (const T value, const size_t numBits)
 Bit-rotate value left by specified number of bits.
template<typename T >
RotR (const T value, const size_t numBits)
 Bit-rotate value right by specified number of bits.
template<typename T >
GetUnaligned (const void *p)
 Get unaligned data at specified location.
template<typename T >
void PutUnaligned (T value, void *p)
 Put unaligned data at specified location.

Function Documentation

template<typename T >
T anonymous_namespace{utils.h}::GetUnaligned ( const void *  p) [inline]

Get unaligned data at specified location.

Data type indicated by template argument T.

Parameters:
pLocation of unaligned data to retrieve.
Returns:
Retrieved data from specified location.
template<typename T >
bool anonymous_namespace{utils.h}::IsPowerOf2 ( value) [inline]

Check if specified value is an integer power of two.

template<typename T >
T anonymous_namespace{utils.h}::Max ( x,
y 
) [inline]

Maximal value.

template<typename T >
T anonymous_namespace{utils.h}::Min ( x,
y 
) [inline]

Minimal value.

template<typename T >
void anonymous_namespace{utils.h}::PutUnaligned ( value,
void *  p 
) [inline]

Put unaligned data at specified location.

Data type indicated by template argument T.

Parameters:
pLocation of unaligned data to put.
valueValue to put.
Returns:
Put data to specified location.
template<typename T >
T anonymous_namespace{utils.h}::RotL ( const T  value,
const size_t  numBits 
) [inline]

Bit-rotate value left by specified number of bits.

Parameters:
valueValue to rotate.
numBitsNumber of bits to rotate.
Returns:
Rotation result.
template<typename T >
T anonymous_namespace{utils.h}::RotR ( const T  value,
const size_t  numBits 
) [inline]

Bit-rotate value right by specified number of bits.

Parameters:
valueValue to rotate.
numBitsNumber of bits to rotate.
Returns:
Rotation result.
template<typename T , typename Tal >
T anonymous_namespace{utils.h}::RoundDown ( size,
Tal  align 
) [inline]

Round down the value with specified alignment.

template<typename T , typename Tal >
T anonymous_namespace{utils.h}::RoundDown2 ( size,
Tal  align 
) [inline]

Round down the value with specified alignment.

Alignment must be an integer power of two.

template<typename T , typename Tal >
T anonymous_namespace{utils.h}::RoundUp ( size,
Tal  align 
) [inline]

Round up the value with specified alignment.

template<typename T , typename Tal >
T anonymous_namespace{utils.h}::RoundUp2 ( size,
Tal  align 
) [inline]

Round up the value with specified alignment.

Alignment must be an integer power of two.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines