25 #include <boost/lexical_cast.hpp> 36 using boost::lexical_cast;
37 using std::unique_ptr;
59 virtual void externalOperation () =0;
67 virtual void reset () =0;
79 virtual uint getMagic() =0;
86 static void invokeImplementationService();
98 void externalOperation() ;
101 void implementationService() ;
106 operator string()
const;
111 template<
class API,
class IMPL>
131 forwardServiceInvocation()
133 IMPL::implementationService();
137 template<
typename IMPS
146 static FRONT& current;
173 unique_ptr<SessionImplAPI> pImpl_;
192 unique_ptr<SessionImplAPI> tmpS {
new SessionImplAPI};
198 uint TSessionImpl::magic_;
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;
286 access_defaultSession();
288 invoke_implServices();
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;
static FRONT & current
intended to be hard-wired to SessManagerImpl singleton
void access_defaultSession()
Helpers for working with lib::meta::Types (i.e.
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Access point to singletons and other kinds of dependencies designated by type.
session::SessManager & PSess
acts as a "PImpl" smart ptr
Simplistic test class runner.
SessionServices< Types< SessionServiceFetch, SessionServiceMutate, SessionServiceExploreScope, SessionServiceMockIndex, SessionServiceDefaults >, SessManagerImpl, SessionImpl > SessionImplAPI
actual configuration of the session implementation compound: forming an inheritance chain of all inte...
Singleton services and Dependency Injection.
void invoke_implServices()
uint magic()
example of an one-liner, as it might be used internally by implementation code within Steam-Layer ...
Verify the access mechanism both to the pubic session API and to implementation level APIs used by St...
Primary Interface to the current Session.