wrap calls to server-side-functions with different error-handling strategies More...
#include <client_wrapper.hxx>
Static Public Member Functions | |
static void | set_connection (std::auto_ptr< ConnectionWrapper > wrappedConnection) |
tell the wrapper which connection to use | |
static ConnectionWrapper * | get_connection_wrapper (void) |
return a pointer to the ConnectionWrapper currently in use | |
static void | ensure_singleton_there (void) |
manually establish the connection without actually executing a call | |
Static Protected Attributes | |
static const char * | NotInitializedMessage = "T2nSingletonWrapper used before setting initializing connection" |
Private Member Functions | |
T2nSingletonWrapper (std::auto_ptr< Client > stub) | |
Static Private Member Functions | |
static void | init () |
template<typename R > | |
static detail::TypeWrap< R >::type | real_exec (boost::function< R(Client *) > f) |
Private Attributes | |
std::auto_ptr< Client > | Stub |
Static Private Attributes | |
static std::auto_ptr < T2nSingletonWrapper > | SingletonObject |
static std::auto_ptr < ConnectionWrapper > | WrappedConnection |
wrap calls to server-side-functions with different error-handling strategies
Template class to access a process-wide singleton server-connection and to wrap all calls using this connection with an error-handling strategy (e.g. to reconnect when the connection broke). The source looks very complicated due to heavy use of templates, look at the 3rd codegen example to see how to use it.
t2n_exec(&cmd_group_t2nexample_client::testfunc)("the answer is %d",42)
libt2n::T2nSingletonWrapper< Client >::T2nSingletonWrapper | ( | std::auto_ptr< Client > | stub | ) | [inline, private] |
References libt2n::T2nSingletonWrapper< Client >::Stub.
Referenced by libt2n::T2nSingletonWrapper< Client >::init().
static void libt2n::T2nSingletonWrapper< Client >::ensure_singleton_there | ( | void | ) | [inline, static] |
manually establish the connection without actually executing a call
References libt2n::T2nSingletonWrapper< Client >::init(), and libt2n::T2nSingletonWrapper< Client >::SingletonObject.
Referenced by libt2n::T2nSingletonWrapper< Client >::real_exec().
static ConnectionWrapper* libt2n::T2nSingletonWrapper< Client >::get_connection_wrapper | ( | void | ) | [inline, static] |
return a pointer to the ConnectionWrapper currently in use
References libt2n::T2nSingletonWrapper< Client >::WrappedConnection.
static void libt2n::T2nSingletonWrapper< Client >::init | ( | ) | [inline, static, private] |
References libt2n::T2nSingletonWrapperMessages::NotInitializedMessage, libt2n::T2nSingletonWrapper< Client >::SingletonObject, libt2n::T2nSingletonWrapper< Client >::T2nSingletonWrapper(), and libt2n::T2nSingletonWrapper< Client >::WrappedConnection.
Referenced by libt2n::T2nSingletonWrapper< Client >::ensure_singleton_there().
static detail::TypeWrap<R>::type libt2n::T2nSingletonWrapper< Client >::real_exec | ( | boost::function< R(Client *) > | f | ) | [inline, static, private] |
static void libt2n::T2nSingletonWrapper< Client >::set_connection | ( | std::auto_ptr< ConnectionWrapper > | wrappedConnection | ) | [inline, static] |
tell the wrapper which connection to use
wrappedConnection | the connection to establish when needed |
References libt2n::T2nSingletonWrapper< Client >::SingletonObject, and libt2n::T2nSingletonWrapper< Client >::WrappedConnection.
const char * libt2n::T2nSingletonWrapperMessages::NotInitializedMessage = "T2nSingletonWrapper used before setting initializing connection" [static, protected, inherited] |
Referenced by libt2n::T2nSingletonWrapper< Client >::init().
std::auto_ptr<T2nSingletonWrapper> libt2n::T2nSingletonWrapper< Client >::SingletonObject [static, private] |
std::auto_ptr<Client> libt2n::T2nSingletonWrapper< Client >::Stub [private] |
Referenced by libt2n::T2nSingletonWrapper< Client >::T2nSingletonWrapper().
std::auto_ptr<ConnectionWrapper> libt2n::T2nSingletonWrapper< Client >::WrappedConnection [static, private] |