/*****************************************************************************
 * $LastChangedDate: 2009-11-22 22:39:11 -0500 (Sun, 22 Nov 2009) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Globals class (the fewer the better).
 *//*
 * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef BASE_GLOBALS_HH
#define BASE_GLOBALS_HH 1

namespace base {

////////////////////////////////////////////////////////////////////////////////
/// @brief Globals class defines the order of construction of globals.
///
/// See doc/html/coding.html.
///
/// mExiting: Destructors that might destroy a static object should
/// check mExiting to avoid calling methods of another destroyed static object.
///
/// C++ notes:
/// The order of construction/destruction of class members
/// is determined by the order in which they're declared.
/// ctor initialization list has no effect on order.
///
class Globals
{
PREVENT_COPYING(Globals)
public:
    Globals( void )
    :   mExiting(false),
        mTesting(false)
#if DEBUG
       ,mAssertAbort(false)
#endif
    {
    }

    bool    mExiting;
    bool    mTesting;
#if DEBUG
    bool    mAssertAbort;  ///< call abort() if ASSERT() fails
#endif
};

BASE_GLOBAL Globals gGlobals;  ///< the dreaded Globals var

} // namespace base

#endif // BASE_GLOBALS_HH
