#include <functional>
#include <boost/config.hpp>
-#include <boost/any.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/preprocessor.hpp>
#undef _GEN_PREP
#undef _GEN_ARG
- T2nSingletonWrapper()
+ T2nSingletonWrapper(std::auto_ptr<Client> stub)
+ {
+ Stub=stub;
+ }
+
+ static void init()
{
if (WrappedConnection.get() == NULL)
throw std::logic_error(NotInitializedMessage);
- Stub=std::auto_ptr<Client>(new Client(*(WrappedConnection->get_connection()),
+ std::auto_ptr<Client> stub(new Client(*(WrappedConnection->get_connection()),
WrappedConnection->get_command_timeout_usec(),
WrappedConnection->get_hello_timeout_usec()));
+
+ SingletonObject=std::auto_ptr<T2nSingletonWrapper>(new T2nSingletonWrapper(stub));
}
template< typename R >
static void ensure_singleton_there(void)
{
if (SingletonObject.get() == NULL)
- SingletonObject=std::auto_ptr<T2nSingletonWrapper>(new T2nSingletonWrapper());
+ init();
}
// create an exec-method for each possible number of parameters