25#include <boost/lexical_cast.hpp>
36 using boost::lexical_cast;
37 using std::unique_ptr;
86 static void invokeImplementationService();
98 void externalOperation() ;
101 void implementationService() ;
106 operator string()
const;
111 template<
class API,
class IMPL>
133 IMPL::implementationService();
137 template<
typename IMPS
162 struct TSessManagerImpl;
198 uint TSessionImpl::magic_;
204 TSessManagerImpl& SessionImplAPI::current =
static_cast<TSessManagerImpl&
> (TSession::current);
216 InternalAPI_1::access()
222 InternalAPI_2::invokeImplementationService()
224 SessionImplAPI::current->forwardServiceInvocation();
233 TSessionImpl::operator string()
const
235 return string(
"Session-Impl(")
236 + lexical_cast<string>(magic_)
240 TSessionImpl::TSessionImpl()
243 cout <<
"creating new Session " << magic_ << endl;
247 TSessionImpl::externalOperation()
249 cout <<
this <<
"::externalOperation()" << endl;
254 TSessionImpl::implementationService()
256 cout <<
this <<
"::implementationService()" << endl;
299 cout <<
"Session not yet used...." << endl;
300 TSession::current->externalOperation();
311 TSession::current.reset();
312 TSession::current->externalOperation();
318 uint magic() {
return InternalAPI_1::access().getMagic(); }
324 cout <<
"current Session-Impl-ID = " <<
magic() << endl;
325 InternalAPI_2::invokeImplementationService();
327 cout <<
"now resetting this session." << endl;
328 TSession::current.reset();
330 InternalAPI_2::invokeImplementationService();
331 cout <<
"current Session-Impl-ID = " <<
magic() << endl;
Access point to singletons and other kinds of dependencies designated by type.
Verify the access mechanism both to the pubic session API and to implementation level APIs used by St...
void invoke_implServices()
uint magic()
example of an one-liner, as it might be used internally by implementation code within Steam-Layer
void access_defaultSession()
Singleton services and Dependency Injection.
Helpers for working with lib::meta::Types (i.e.
Namespace of Session and user visible high-level objects.
session::SessManager & PSess
acts as a "PImpl" smart ptr
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
Simplistic test class runner.
#define LAUNCHER(_TEST_CLASS_, _GROUPS_)
Primary Interface to the current Session.
void forwardServiceInvocation()
virtual uint getMagic()=0
unique_ptr< SessionImplAPI > pImpl_
virtual void externalOperation()=0
static TSessManager & current