]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/Singleton.hxx
Add smart pointer tests (finally using Boost.Test)
[simgear.git] / simgear / structure / Singleton.hxx
index cc98c497633a7d754f910af66d151a8995b6325a..0db235fec976aa7646ecf105b58d878fe43ce5c4 100644 (file)
@@ -1,12 +1,7 @@
 #ifndef SIMGEAR_SINGLETON_HXX
 #define SIMGEAR_SINGLETON_HXX 1
 
-#include <boost/pool/detail/singleton.hpp>
-
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
-#include <osg/Referenced>
-#include <osg/ref_ptr>
-#endif 
+#include "singleton.hpp"
 
 namespace simgear
 {
@@ -29,35 +24,5 @@ public:
     }
 };
 
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
-template <typename RefClass>
-class SingletonRefPtr
-{
-public:
-    SingletonRefPtr()
-    {
-        ptr = new RefClass;
-    }
-    static RefClass* instance()
-    {
-        SingletonRefPtr& singleton
-            = boost::details::pool::singleton_default<SingletonRefPtr>::instance();
-        return singleton.ptr.get();
-    }
-private:
-    osg::ref_ptr<RefClass> ptr;
-};
-
-template <typename RefClass>
-class ReferencedSingleton : public virtual osg::Referenced
-{
-public:
-    static RefClass* instance()
-    {
-        return SingletonRefPtr<RefClass>::instance();
-    }
-};
-#endif // of NO_OPENSCENEGRAPH_INTERFACE
-
 }
 #endif