Classes |
| class | common::Singleton< T > |
| | Wzorzec projektowy Singleton - klasa bazowa. More...
|
Defines |
| #define | _countof(_Array) sizeof(*__countof_helper(_Array)) |
| | Makro do pobierania w czasie kompilacji liczby elementów statycznej tablicy.
|
Enumerations |
| enum | common::ORIENTATION { common::O_NONE,
common::O_VERT,
common::O_HORIZ
} |
| | Orientacja, czyli ułożenie - pionowa lub pozioma.
More...
|
Functions |
| template<typename _CountofType , size_t _SizeOfArray> |
| char(* | common::__countof_helper (_CountofType(&_Array)[_SizeOfArray]))[_SizeOfArray] |
| template<typename T > |
| T ** | common::new_2d (size_t cx, size_t cy) |
| | Alokuje nową tablicę dynamiczną 2D.
|
| template<typename T > |
| void | common::delete_2d (T **a, size_t cx) |
| | Zwalnia tablicę dynamiczną 2D.
|
| void | common::strcpy0 (tchar *dest, const tstring &src) |
| | Kopiuje string do char* łącznie ze znakami '\0' (czego nie zapewnia strcpy).
|
| template<class Iterator > |
| void | common::InsertionSort (Iterator b, Iterator e) |
| | Algorytm jak te z STL - sortowanie przez wstawianie.
|
| template<class Iterator , typename Compare > |
| void | common::InsertionSort (Iterator b, Iterator e, Compare Comp) |
| | Algorytm jak te z STL - sortowanie przez wstawianie, z własnym komparatorem.
|
| template<typename IterT , typename KeyT , typename CmpT > |
| IterT | common::FirstNotLessIndex (IterT beg, IterT end, const KeyT &key, CmpT cmp) |
| template<typename IterT , typename KeyT , typename CmpT > |
| IterT | common::BinarySearch (IterT beg, IterT end, const KeyT &key, CmpT cmp) |
| | An STL-compatible algorithm that performs binary search in sorted container using random-access iterators and return iterator to found element.
|
| void | common::SwapEndian16 (void *p) |
| | Swaps endianess of a 2-byte value.
|
| void | common::SwapEndian32 (void *p) |
| | Swaps endianess of a 4-byte value.
|
| void | common::SwapEndian64 (void *p) |
| | Swaps endianess of a 8-byte value.
|
| void | common::SwapEndian16_Array (void *p, uint count) |
| void | common::SwapEndian32_Array (void *p, uint count) |
| void | common::SwapEndian64_Array (void *p, uint count) |
| void | common::SwapEndian16_Data (void *p, uint count, int stepBytes) |
| void | common::SwapEndian32_Data (void *p, uint count, int stepBytes) |
| void | common::SwapEndian64_Data (void *p, uint count, int stepBytes) |
| void | common::SwapEndian (bool &v) |
| void | common::SwapEndian (uint1 &v) |
| void | common::SwapEndian (int1 &v) |
| void | common::SwapEndian (uint2 &v) |
| void | common::SwapEndian (int2 &v) |
| void | common::SwapEndian (uint4 &v) |
| void | common::SwapEndian (int4 &v) |
| void | common::SwapEndian (uint8 &v) |
| void | common::SwapEndian (int8 &v) |
| void | common::SwapEndian (float &v) |
| void | common::SwapEndian (double &v) |
| void | common::Wait (uint4 Miliseconds) |
| | Zatrzymuje bieżący wątek na podaną liczbę milisekund.
|
| template<typename T > |
| int | common::UniversalCmp (const T &a, const T &b) |
template<typename IterT , typename KeyT , typename CmpT >
| IterT common::BinarySearch |
( |
IterT |
beg, |
|
|
IterT |
end, |
|
|
const KeyT & |
key, |
|
|
CmpT |
cmp | |
|
) |
| | [inline] |
An STL-compatible algorithm that performs binary search in sorted container using random-access iterators and return iterator to found element.
If key element not found, returns end.
This function is useful because standard std::binary_search returns bool and not iterator (what a nonsense!).
cmp must be a functor in for of: int cmp(const KeyT &key, const ValT &val), where ValT i the type of *beg and *end.