// // File : SingletonBase.hh // // Purpose: Declaration of the class SingletonBase // // $Id: SingletonBase.hh 8758 2010-09-27 12:16:24Z mathes $ // /** @file SingletonBase.hh * Declaration of the class SingletonBase. * @author H.-J. Mathes, FzK */ #ifndef _FdUtil_SingletonBase_hh_ #define _FdUtil_SingletonBase_hh_ #include #ifndef NO_VERSION # include #endif // NO_VERSION namespace FdUtil { // --- forward declaration(s) class SingletonRegistry; /** This class should serve as teh base class for all singletons. * * It contains a mechanism which cares about the proper cleanup of singletons * using the atexit() system function. */ class SingletonBase { friend class SingletonRegistry; public: /** */ SingletonBase(std::string name="unnamed"); /** */ const std::string& GetName() { return fName; } /** */ static void SetPrintLevel(unsigned int level=1); protected: /** */ virtual ~SingletonBase(); private: // these ones don't exist SingletonBase(const SingletonBase&); SingletonBase& operator=(const SingletonBase&); std::string fName; }; } // FdUtil #endif // _FdUtil_SingletonBase_hh_