27 #include <boost/smart_ptr.hpp> 28 #include <boost/thread/mutex.hpp> 29 #include <boost/thread/thread.hpp> 30 #include <boost/function.hpp> 31 #include <boost/bind.hpp> 41 if(existed_ptr.use_count() == 0) {
42 std::cout<<
"WRONG: using an empty ptr to get singleton, exit."<<std::endl;
55 std::cout<<
"WRONG: try to get an not existed ptr, exit."<<std::endl;
95 template<
class P1,
class P2>
108 template<
class P1,
class P2,
class P3>
static boost::mutex singleton_mutex_
static boost::shared_ptr< T > singleton_object_
static boost::shared_ptr< T > getSingleton(P1 p1, P2 p2, P3 p3)
static boost::shared_ptr< T > getSingleton()
static void deleteSingleton()
static boost::shared_ptr< T > getExistedSingleton()
static void makeSingleton(boost::shared_ptr< T > &existed_ptr)
static boost::shared_ptr< T > getSingleton(P1 p1)
static boost::shared_ptr< T > getSingleton(P1 p1, P2 p2)