#include <base_global.hh>
Public Member Functions | |
| Global (void) | |
Public Attributes | |
| bool | mExiting |
| bool | mTesting |
| Streams | mStreams |
| Thread | mThread |
| Random | mRandom |
| bool | mAssertAbort |
Design philosophy is to minimize globals but make them explicit by putting them in a "global" namespace and using the qualifier "global::". The Singleton pattern or otherwise hiding globals is detrimental to thread-safety.
Global construction/destruction order: Some globals may depend on other globals being constructed first. C++ doesn't define the order which separate global variables are constructed. But the order of constructing class members is defined as the order in which they're declared (destruction order is defined as the reverse).
Global class vs. conventional singletons: Singleton disadvantages: tedious to write, obscure the fact they're globals. Singleton advantages: are initialized after load-time, solve run-time dependencies. Global class advantages: searchable, the order of initializing class members is defined. World::GetEdge(); // obscure global global::mWorld.GetEdge(); // obvious global
| base::Global::Global | ( | void | ) | [inline] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:19 2007