Base Module

Classes

class  common::DeletePolicy
 Polityka zwalaniania inteligentnych wskaźników, która robi: delete p;. More...
class  common::RandomGenerator
 Generator liczb pseudolosowych. More...
class  common::CmdLineParser
 Parser wiersza poleceń. More...
class  common::CommonGUID
 Reprezentuje 128-bitowy globalnie unikatowy identyfikator, zgodnie z RFC 4122. More...

Modules

 Postawowe typy danych
 Ogólne
 Inteligentne wskaźniki
 Podstawowa matematyka
 Maksymalne i minimalne wartości
 Łańcuchy
 Ścieżki do plików
 Konwersje między łańcuchem a różnymi typami
 Funkcje okresowe
 Generator liczb pseudolosowych

Defines

#define NOMINMAX
 To jest na wypadek włączania gdzieś niżej przez użytkownika <windows.h>.
#define TCHAR_TO_INT(c)   ( (int)(c) )
 Konwertuje znak na liczbę naturalną.
#define INT_TO_TCHAR(i)   ( (wchar_t)(i) )
 Konwertuje liczbę 0..255 na znak.
#define __TFILE__   _T(__FILE__)
 Nazwa bieżącego pliku źródłowego jako łańcuch, zależnie od makra _UNICODE jest w Unikodzie.
#define __TFUNCSIG__   _T(__FUNCSIG__)
 Pełna sygnatura bieżącej funkcji w kodzie, zależnie od makra _UNICODE jest w Unikodzie.
#define __TFUNCTION__   _T(__FUNCTION__)
 Sama nazwa bieżącej funkcji w kodzie, zależnie od makra _UNICODE jest w Unikodzie.
#define common_memzero(buf, bufSize)   { ZeroMemory(buf,bufSize); }
#define common_sprintf(buf, bufSize, fmt,...)   ( sprintf(buf,fmt,##__VA_ARGS__) )
#define common_memcpy(dst, src, count)   { memcpy(dst,src,count); }
#define common_memmove(dst, src, count)   { memmove(dst,src,count); }
#define common_strcat(dst, dstSize, src)   { strcat(dst,src); }
#define common_strncat(dst, dstSize, src, count)   { strncat(dst,src,count); }
#define common_strchr(str, c)   ( strchr(str,c) )
#define common_strrchr(str, c)   ( strrchr(str,c) )
#define common_strcmp(s1, s2)   ( strcmp(s1,s2) )
#define common_strncmp(s1, s2, count)   ( strncmp(s1,s2,count) )
#define common_stricmp(s1, s2)   ( stricmp(s1,s2) )
#define common_strnicmp(s1, s2, count)   ( strnicmp(s1,s2,count) )
#define common_strcoll(s1, s2)   ( strcoll(s) )
#define common_strcpy(dst, dstSize, src)   { strcpy(dst,src); }
#define common_strncpy(dst, dstSize, src, count)   { strncpy(dst,src,count); }
#define common_strlen(str)   ( strlen(str) )
#define common_strspn(str, charset)   ( strspn(str,charset) )
#define common_strcspn(str, charset)   ( strcspn(str,charset) )
#define common_strpbrk(str, charset)   ( strpbrk(str,charset) )
#define common_strstr(str, strSearch)   ( strstr(str,strSearch) )
#define common_strxfrm(dst, str, count)   ( strxfrm(dst,str,count) )
#define SAFE_DELETE(x)   { delete (x); (x) = 0; }
 Jeśli wskaźnik niezerowy, zwalnia go i zeruje.
#define SAFE_DELARR(x)   { delete [] (x); (x) = 0; }
 Jeśli wskaźnik niezerowy, zwalnia go jako tablicę i zeruje.
#define SAFE_RELEASE(x)   { if (x) { (x)->Release(); (x) = 0; } }
 Jeśli wskaźnik niezerowy, wywołuje mu Release() i zeruje.
#define ASSERT_INT3(x)   if ((x) == 0) { __asm { int 3 } }
 Asercja, która ZAWSZE przerywa program kiedy jest niespełniona (w debuggerze - robi breakpoint, bez debuggera - wywala program).
#define ASSERT_INT3_DEBUG(x)   { }
 Asercja, która w kompilacji Debug przerywa program kiedy jest niespełniona (w debuggerze - robi breakpoint, bez debuggera - wywala program).
#define PACKED   __attribute__((packed))
 Do robienia alignacji co do jednego bajtu dla struktur, czyli bez wypełniaczy.
#define DECLARE_NO_COPY_CLASS(ClassName)
 Makro do umieszczania w klasach, żeby klasa nie miała konstruktora kopiującego ani operatora przypisania.
#define STATIC_ASSERT(x)   { const char temp[ (((x) == 0) ? 0 : 1) ] = {'\0'}; }
 Asercja w czasie kompilacji.
#define REF_COUNTED_FIELDS   uint m_RefCount;
#define REF_COUNTED_METHODS
#define REF_COUNTED_CTOR   { m_RefCount = 1; }

Typedefs

typedef TCHAR tchar
 Typ znakowy, zależnie od makra _UNICODE zdefiniowany jako char lub wchar_t.
typedef std::wstring tstring
 Typ łańcuchowy, zależnie od makra _UNICODE zdefiniowany jako std::string lub std::wstring.
typedef std::vector< tstring > STRING_VECTOR
 Wektor łańcuchów.

Functions

template<typename destT , typename srcT >
destT & absolute_cast (srcT &v)
 Uniwersalny, brakujący w C++ operator dosłownego rzutowania (reintepretacji bitowej).
template<typename destT , typename srcT >
const destT & absolute_cast (const srcT &v)

Detailed Description

Dokumentacja: Module_Base
Nagłówek: Base.hpp


Define Documentation

#define __TFILE__   _T(__FILE__)

Nazwa bieżącego pliku źródłowego jako łańcuch, zależnie od makra _UNICODE jest w Unikodzie.

#define __TFUNCSIG__   _T(__FUNCSIG__)

Pełna sygnatura bieżącej funkcji w kodzie, zależnie od makra _UNICODE jest w Unikodzie.

#define __TFUNCTION__   _T(__FUNCTION__)

Sama nazwa bieżącej funkcji w kodzie, zależnie od makra _UNICODE jest w Unikodzie.

#define ASSERT_INT3 ( x   )     if ((x) == 0) { __asm { int 3 } }

Asercja, która ZAWSZE przerywa program kiedy jest niespełniona (w debuggerze - robi breakpoint, bez debuggera - wywala program).

#define ASSERT_INT3_DEBUG ( x   )     { }

Asercja, która w kompilacji Debug przerywa program kiedy jest niespełniona (w debuggerze - robi breakpoint, bez debuggera - wywala program).

#define common_memcpy ( dst,
src,
count   )     { memcpy(dst,src,count); }
#define common_memmove ( dst,
src,
count   )     { memmove(dst,src,count); }
#define common_memzero ( buf,
bufSize   )     { ZeroMemory(buf,bufSize); }
#define common_sprintf ( buf,
bufSize,
fmt,
...   )     ( sprintf(buf,fmt,##__VA_ARGS__) )
#define common_strcat ( dst,
dstSize,
src   )     { strcat(dst,src); }
#define common_strchr ( str,
c   )     ( strchr(str,c) )
#define common_strcmp ( s1,
s2   )     ( strcmp(s1,s2) )
#define common_strcoll ( s1,
s2   )     ( strcoll(s) )
#define common_strcpy ( dst,
dstSize,
src   )     { strcpy(dst,src); }
#define common_strcspn ( str,
charset   )     ( strcspn(str,charset) )
#define common_stricmp ( s1,
s2   )     ( stricmp(s1,s2) )
#define common_strlen ( str   )     ( strlen(str) )
#define common_strncat ( dst,
dstSize,
src,
count   )     { strncat(dst,src,count); }
#define common_strncmp ( s1,
s2,
count   )     ( strncmp(s1,s2,count) )
#define common_strncpy ( dst,
dstSize,
src,
count   )     { strncpy(dst,src,count); }
#define common_strnicmp ( s1,
s2,
count   )     ( strnicmp(s1,s2,count) )
#define common_strpbrk ( str,
charset   )     ( strpbrk(str,charset) )
#define common_strrchr ( str,
c   )     ( strrchr(str,c) )
#define common_strspn ( str,
charset   )     ( strspn(str,charset) )
#define common_strstr ( str,
strSearch   )     ( strstr(str,strSearch) )
#define common_strxfrm ( dst,
str,
count   )     ( strxfrm(dst,str,count) )
#define DECLARE_NO_COPY_CLASS ( ClassName   ) 
Value:
private:                                    \
    ClassName(const ClassName&);            \
    ClassName& operator=(const ClassName&);

Makro do umieszczania w klasach, żeby klasa nie miała konstruktora kopiującego ani operatora przypisania.

#define INT_TO_TCHAR ( i   )     ( (wchar_t)(i) )

Konwertuje liczbę 0..255 na znak.

#define NOMINMAX

To jest na wypadek włączania gdzieś niżej przez użytkownika <windows.h>.

#define PACKED   __attribute__((packed))

Do robienia alignacji co do jednego bajtu dla struktur, czyli bez wypełniaczy.

Autor: agent_J.

#define REF_COUNTED_CTOR   { m_RefCount = 1; }
#define REF_COUNTED_FIELDS   uint m_RefCount;
#define REF_COUNTED_METHODS
Value:
void AddRef() { m_RefCount++; } \
  void Release() { assert(m_RefCount > 0); if (--m_RefCount == 0) delete this; }
#define SAFE_DELARR ( x   )     { delete [] (x); (x) = 0; }

Jeśli wskaźnik niezerowy, zwalnia go jako tablicę i zeruje.

#define SAFE_DELETE ( x   )     { delete (x); (x) = 0; }

Jeśli wskaźnik niezerowy, zwalnia go i zeruje.

#define SAFE_RELEASE ( x   )     { if (x) { (x)->Release(); (x) = 0; } }

Jeśli wskaźnik niezerowy, wywołuje mu Release() i zeruje.

#define STATIC_ASSERT ( x   )     { const char temp[ (((x) == 0) ? 0 : 1) ] = {'\0'}; }

Asercja w czasie kompilacji.

#define TCHAR_TO_INT ( c   )     ( (int)(c) )

Konwertuje znak na liczbę naturalną.


Typedef Documentation

typedef std::vector<tstring> STRING_VECTOR

Wektor łańcuchów.

typedef TCHAR tchar

Typ znakowy, zależnie od makra _UNICODE zdefiniowany jako char lub wchar_t.

typedef std::wstring tstring

Typ łańcuchowy, zależnie od makra _UNICODE zdefiniowany jako std::string lub std::wstring.


Function Documentation

template<typename destT , typename srcT >
const destT& absolute_cast ( const srcT &  v  )  [inline]
template<typename destT , typename srcT >
destT& absolute_cast ( srcT &  v  )  [inline]

Uniwersalny, brakujący w C++ operator dosłownego rzutowania (reintepretacji bitowej).


Generated on Wed Dec 16 20:44:52 2009 for CommonLib by  doxygen 1.6.1