|
PIP
0.5.0_prealpha
Platform-Independent Primitives
|
Global includes of PIP. More...
Macros | |
| #define | PIP_VERSION ((PIP_VERSION_MAJOR << 16) | (PIP_VERSION_MINOR < 8) | PIP_VERSION_REVISION) |
| Version of PIP in hex - 0x##(Major)##(Minor)##(Revision) | |
| #define | PIP_VERSION_MAJOR |
| Major value of PIP version. | |
| #define | PIP_VERSION_MINOR |
| Minor value of PIP version. | |
| #define | PIP_VERSION_REVISION |
| Revision value of PIP version. | |
| #define | PIP_VERSION_SUFFIX |
| Suffix of PIP version. | |
| #define | PIP_DEBUG |
| Macro is defined when compile-time debug is enabled. | |
| #define | WINDOWS |
| Macro is defined when host is any Windows. | |
| #define | QNX |
| Macro is defined when host is QNX. | |
| #define | FREE_BSD |
| Macro is defined when host is FreeBSD. | |
| #define | MAC_OS |
| Macro is defined when host is Mac OS. | |
| #define | ANDROID |
| Macro is defined when host is Android. | |
| #define | LINUX |
| Macro is defined when host is any Linux. | |
| #define | CC_GCC |
| Macro is defined when compiler is GCC or MinGW. | |
| #define | HAS_LOCALE |
| Macro is defined when PIP is decided that host is support language. | |
| #define | CC_VC |
| Macro is defined when compiler is Visual Studio. | |
| #define | CC_OTHER |
| Macro is defined when compiler is unknown. | |
| #define | PIP_TIMER_RT |
| Macro is defined when PIP use "rt" library for timers implementation. | |
| #define | PIP_CONTAINERS_STL |
| Define this macro to use STL implementation of containers, else PIP implementation will be used. | |
| #define | FOREVER for (;;) |
| Macro used for infinite loop. | |
| #define | FOREVER_WAIT FOREVER msleep(1); |
| Macro used for infinite wait. | |
| #define | WAIT_FOREVER FOREVER msleep(1); |
| Macro used for infinite wait. | |
Functions | |
| template<typename T > | |
| void | piSwap (T &f, T &s) |
| Templated function for swap two values. More... | |
| template<typename T > | |
| void | piSwapBinary (T &f, T &s) |
| Templated function for swap two values without "=". More... | |
| template<typename T > | |
| int | piRound (const T &v) |
| Templated function return round of float falue. More... | |
| template<typename T > | |
| int | piFloor (const T &v) |
| Templated function return floor of float falue. More... | |
| template<typename T > | |
| int | piCeil (const T &v) |
| Templated function return ceil of float falue. More... | |
| template<typename T > | |
| T | piAbs (const T &v) |
| Templated function return absolute of numeric falue. More... | |
| template<typename T > | |
| T | piMin (const T &f, const T &s) |
| Templated function return minimum of two values. More... | |
| template<typename T > | |
| T | piMin (const T &f, const T &s, const T &t) |
| Templated function return minimum of tree values. More... | |
| template<typename T > | |
| T | piMax (const T &f, const T &s) |
| Templated function return maximum of two values. More... | |
| template<typename T > | |
| T | piMax (const T &f, const T &s, const T &t) |
| Templated function return maximum of tree values. More... | |
| template<typename T > | |
| T | piClamp (const T &v, const T &min, const T &max) |
| Templated function return clamped value. More... | |
| void | piLetobe (void *data, int size) |
| Function inverse byte order in memory block. | |
| template<typename T > | |
| void | piLetobe (T *v) |
| Templated function that inverse byte order of value "v". | |
| template<typename T > | |
| T | piLetobe (const T &v) |
| Templated function that returns "v" with inversed byte order. More... | |
| ushort | letobe_s (ushort v) |
| Use piLetobe() instead of this function. More... | |
| uint | letobe_i (uint v) |
| Use piLetobe() instead of this function. More... | |
| PIString | errorString () |
| Return readable error description in format "code <number> - <description>". | |
| PIString | PIPVersion () |
| Return readable version of PIP. | |
Variables | |
| bool | piDebug |
| global variable enabling output to piCout, default is true | |
| double | piMountInfoRefreshIntervalMs |
Global includes of PIP.
This file include all needed system headers, STL and declare many useful macros and functions
|
inline |
|
inline |
Templated function for swap two values without "=".
Example:
|
inline |
|
inline |
|
inline |
|
inline |
Templated function return absolute of numeric falue.
Absolute is the positive or equal 0 value
There are some macros:
piAbss for "short"piAbsi for "int"piAbsl for "long"piAbsll for "llong"piAbsf for "float"piAbsd for "double"Example:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Templated function return clamped value.
Clamped is the not greater than "max" and not lesser than "min" value
There are some macros:
piClamps for "short"piClampi for "int"piClampl for "long"piClampll for "llong"piClampf for "float"piClampd for "double"Example:
|
inline |
Templated function that returns "v" with inversed byte order.
This function used to convert values between little and big endian
There are some macros:
piLetobes for "ushort"piLetobei for "uint"piLetobel for "ulong"piLetobell for "ullong"Example:
| ushort letobe_s | ( | ushort | v | ) |
Use piLetobe() instead of this function.
| uint letobe_i | ( | uint | v | ) |
Use piLetobe() instead of this function.
| double piMountInfoRefreshIntervalMs |
global variable that set minimum real update interval for function PIInit::mountInfo(), default is 10000 ms