# HG changeset patch # User llbatlle@taga # Date 1230721744 -3600 # Node ID 3ecde21e0834d67f3b353849c1d4cb891778959d # Parent 77c382ef2850f9370138927990be5c79b1b13017 New commit from the office. diff -r 77c382ef2850 -r 3ecde21e0834 c++.1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/c++.1.txt Wed Dec 31 12:09:04 2008 +0100 @@ -0,0 +1,68 @@ +Memory +============= + +size_t and unsigned long +------- +On windows 64bit, sizeof(unsigned long) == 32 and sizeof(size_t) == 64. +On linux 64bit, sizeof(unsigned long) == sizeof(size_t) == 64 + +intptr_t and uintptr_t (inttypes.h): ints that guarantee to hold a pointer. + +ptrdiff_t: type returned by arithmetic differencing two pointers. + +::operator new and ::operator delete +------- +[Stroustrup3rd, 19.4.5, p576] +Can be redefined, to use posix_memalign and free +The redefinition can be done as class members [Stroustrup3rd, 15.6, p421] +class A +{ + static void* operator new (size_t size); + static void operator delete (void *p); +}; + +int main() +{ + A *p = new A; // calls A::new; + delete p; // calls A::delete; + +} + +The redefinition can't be done on other namespace than the global, if not +done in a class. + +Prototypes for the new/delete Operators +-------------- +void* operator new(size_t); +void operator delete(void* ); +void* operator new[](size_t); +void operator delete[](void* ); +#include // has set_new_handler(), for bad_alloc handling. + + +Exceptions +================= +: +logic_error + domain_error + invalid_argument + length_error + out_of_range +runtime_error + range_error + overflow_error + underflow_error + + +Casting +================= +Explicit type conversion [Stroustrup3rd, 6.2.7, p130] +static_cast - converts between related types (pointer to another, enum to int, + float to int,...). Has minimal type checking, and are often portable. +reinterpret_cast - converts between unrelated types (pointer to int, pointers + to functions [7.7], ...). + No type checking. Rarely portable. +dynamic_cast - run-time checked conversion. +const_cast - for removing const qualifiers. +(Type) exp - Unspecified combination of static+reinterpret+dynamic casts, + to get the cast done. diff -r 77c382ef2850 -r 3ecde21e0834 cygwin.1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cygwin.1.txt Wed Dec 31 12:09:04 2008 +0100 @@ -0,0 +1,2 @@ +Muntar unitats de xarxa: + net use S: '\\server\share' password /USER:user diff -r 77c382ef2850 -r 3ecde21e0834 wx.1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wx.1.txt Wed Dec 31 12:09:04 2008 +0100 @@ -0,0 +1,17 @@ +wxWindow: Mother of all visible GUI objects +wxFrame: A wm window (not a simple wxWindow) resizable by the user, with a title bar +wxDialog: Similar to wxFrame, but can be modal. +wxPanel: A wxWindow where the controls (other wxWindows) are placed. Like a +Dialog placeable *not only* in a new wm window. + +Sizers +========== +Any wxWindow can have a sizer: wxWindow::SetSizer(). + +Features: +- Border: pixels around each internal control +- Minimal Size: set by each internal control +- Alignment: +- Stretch factor: (specified as 'proportion' to some sizers) + - 0 : always minimum space for each control. + - >1 : proportional size related to the sum of all control stretch factors.