base_global.hh

Go to the documentation of this file.
00001 /*
00008  * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
00009  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00010  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00011  *****************************************************************************/
00012 
00013 #ifndef BASE_GLOBAL_HH
00014 #define BASE_GLOBAL_HH 1
00015 
00016 #include "base_common.hh"
00017 
00018 namespace base {
00019 
00040 class Global
00041 {
00042 
00043 public:
00044     Global( void )
00045     :   mExiting(false),
00046         mTesting(false)
00047     {
00048         // NOP
00049     }
00050 
00051     // The order of construction/destruction of class members
00052     // is determined by the order in which they're declared.
00053     // ctor initialization list has no effect on order.
00054 
00055     // mExiting: Destructors that might destroy a static object should
00056     // check mExiting to avoid calling methods of another destroyed static object.
00057 
00058     bool                mExiting;
00059     bool                mTesting;
00060     Streams             mStreams;
00061 #if COMPILE_THREADS
00062     Thread              mThread;
00063 #endif
00064     Random              mRandom;        // Random depends on Thread/PerThreadPtr
00065 #if DEBUG
00066     bool                mAssertAbort;  // call abort() if ASSERT() fails
00067 #endif
00068 };
00069 
00070 #if BASE_CC
00071 Global global;
00072 #else
00073 extern Global global;
00074 #endif
00075 
00076 } // namespace base
00077 
00078 #endif // BASE_GLOBAL_HH
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:06 2007