Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Some ideas/questions on PersonalityManager.h/cpp
killerbot:
Thomas,
on your ad) .
Agreed, but we never know how someone might use this piece of code today, if we allow to derive from it.
Gurus also say : don't derive from full classes (eg classes dat don't have virtual functions), use aggreagation at that time.
But my point is , why make it protected, this is partially breaking the data hiding concept of OO. Why go half the way, if it is better to go all the way, loose coupling.
thomas:
--- Quote from: killerbot on December 19, 2005, 01:10:34 pm --- - clearer interface : easier to understand, suppose someone needs this functionality, looks at the header
--- End quote ---
That will never happen. You have absolutely no reason to use PersonalityManager.
You don't know about personalities. There are no personalities. You have not seeeeeen anything. 8)
--- Quote --- - the static variables in the function can lead to problems in multi instance
--- End quote ---
You do cannot have several instances within the same process.
--- Quote ---Why not be const correct? [...] We know what the code deos today, but when after 6 months we turn back to this code ...
--- End quote ---
I know exactly what this particular code will do in 6 months. In one word: nothing. :)
--- Quote --- - just trying to know for myself what to use : _T(), _(), wxT() ...
--- End quote ---
--- Code: ---#define _(s) wxGetTranslation(_T(s))
#ifdef UNICODE
#define wxT(x) L ## x
#else
#define wxT(x) x
#endif
#define _T(x) wxT(x)
--- End code ---
So, you use _() if you want the text translated into another language. Otherwise, you use one of the others.
Please note that there are _U and _C macros too... the WiKi has a documentation on them.
(Edit: the last #define in my code is of course illegal, but I was too lazy to type that all again, you get the idea...)
Navigation
[0] Message Index
[*] Previous page
Go to full version