00001 /* 00002 * BaseSingleton.hpp 00003 * 00004 * Created on: Mar 22, 2012 00005 * Author: mriedel 00006 */ 00007 00008 #ifndef BASESINGLETON_HPP_ 00009 #define BASESINGLETON_HPP_ 00010 00011 #include <telekyb_defines/telekyb_defines.hpp> 00012 00013 #include <list> 00014 00015 namespace TELEKYB_NAMESPACE { 00016 00017 class BaseSingleton { 00018 private: 00019 static std::list<BaseSingleton*> singletons; 00020 std::list<BaseSingleton*>::iterator it_self; 00021 00022 protected: 00023 BaseSingleton(); 00024 virtual ~BaseSingleton(); 00025 00026 public: 00027 // delete created Singletons in reverse Order. 00028 static void deleteAllSingletons(); 00029 }; 00030 00031 } 00032 00033 #endif /* BASESINGLETON_HPP_ */