34 #include <boost/lexical_cast.hpp> 45 using boost::lexical_cast;
46 using std::unique_ptr;
68 virtual void externalOperation () =0;
76 virtual void reset () =0;
88 virtual uint getMagic() =0;
95 static void invokeImplementationService();
107 void externalOperation() ;
110 void implementationService() ;
115 operator string()
const;
120 template<
class API,
class IMPL>
140 forwardServiceInvocation()
142 IMPL::implementationService();
146 template<
typename IMPS
155 static FRONT& current;
182 unique_ptr<SessionImplAPI> pImpl_;
201 unique_ptr<SessionImplAPI> tmpS {
new SessionImplAPI};
207 uint TSessionImpl::magic_;
225 InternalAPI_1::access()
231 InternalAPI_2::invokeImplementationService()
233 SessionImplAPI::current->forwardServiceInvocation();
242 TSessionImpl::operator string()
const 244 return string(
"Session-Impl(")
245 + lexical_cast<
string>(magic_)
249 TSessionImpl::TSessionImpl()
252 cout <<
"creating new Session " << magic_ << endl;
256 TSessionImpl::externalOperation()
258 cout <<
this <<
"::externalOperation()" << endl;
263 TSessionImpl::implementationService()
265 cout <<
this <<
"::implementationService()" << endl;
295 access_defaultSession();
297 invoke_implServices();
308 cout <<
"Session not yet used...." << endl;
309 TSession::current->externalOperation();
320 TSession::current.reset();
321 TSession::current->externalOperation();
327 uint
magic() {
return InternalAPI_1::access().getMagic(); }
333 cout <<
"current Session-Impl-ID = " << magic() << endl;
334 InternalAPI_2::invokeImplementationService();
336 cout <<
"now resetting this session." << endl;
337 TSession::current.reset();
339 InternalAPI_2::invokeImplementationService();
340 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
Simple 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.