Go to the source code of this file.
Classes | |
struct | Float2int< power, R > |
Struct for conversion between 0-1 Real and 0-(2^power-1) integer. More... | |
struct | NonConstType< T > |
Type convertor - NonConstType<T>::Result is a non-const variant of T or T itself if N/A. More... | |
struct | SingleDeleter |
Template object for automated deletion of pointers (useful in for_each). More... | |
struct | MultiDeleter |
Template object for automated deletion of field pointers (useful in for_each). More... | |
struct | UpdateInfo |
Structure providing support for progress update and interruption (used for encoding). More... | |
Functions | |
template<typename T > | |
T | sqr (T i) |
Helper template function computing the square of a number. | |
template<typename T > | |
T | cube (T i) |
Helper template function computing the cube of a number. | |
template<typename T > | |
T | lShift (T i, T bits) |
Returns i*2^bits. | |
template<typename T > | |
T | rShift (T i, T bits) |
Returns i/2^bits. | |
template<typename T > | |
T | exp10 (T val) |
This function is missing in earlier GCC versions, here implemented via exp2 and log2. | |
int | log2ceil (int i) |
Returns ceil(log2(i)). | |
template<class T > | |
bool | isNaN (T num) |
A wrapper around isnan() because of compiler support. | |
int | getCountForDensity (int longLength, int density, int shortLength) |
How many short intervals (shifted by density) can fit into a long interval (discrete). | |
int | getCountForDensity2D (int width, int height, int density, int sideSize) |
The same as above, but in 2D for squares fitting into a rectangle. | |
template<class T > | |
T | checkBoundsFunc (T low, T value, T high) |
General bounds-checking template routine - returns max(low,min(value,high)). | |
int | countEOLs (const char *s) |
Counts the number of ' ' characters in a C-string. | |
template<class T > | |
T * | constCast (const T *toCast) |
Automatic version of const_cast for pointers. | |
template<class T > | |
T & | constCast (const T &toCast) |
Automatic version of const_cast for references. | |
void | checkThrow (bool check) |
Checking a condition - throws std::exception if false. | |
template<class C > | |
void | clearContainer (const C &container) |
Deletes all pointers in a container (it has to support begin and end methods). | |
template<class C > | |
void | clearQtContainer (C container) |
Clears a QList of pointers (and deletes the pointers). | |
Variables | |
const int | powers [31] |
Field containing 2^i on i-th position, defined in modules.cpp. |
Definition in file util.h.