/* */ #ifndef D_SINGLETON_HOLDER_H #define D_SINGLETON_HOLDER_H #include "SharedHandle.h" namespace aria2 { template class SingletonHolder { private: static SharedHandle instance_; SingletonHolder() {} public: ~SingletonHolder() {} static const SharedHandle& instance() { return instance_; } static void instance(const SharedHandle& instance) { instance_ = instance; } static void clear() { instance_.reset(); } }; template SharedHandle SingletonHolder::instance_; } // namespace aria2 #endif // D_SINGLETON_HOLDER_H