Lumiera  0.pre.03
»edit your freedom«
session-services.hpp File Reference

Go to the source code of this file.

Description

A mechanism for exposing and accessing implementation level services of the session.

While any client code should always use the public Session API, some implementation level facilities within Steam-Layer need to cooperate with a wider SessionImpl API. On the other hand, we don't want to create coupling between the mentioned Steam internals and the session implementation. Another concern addressed by this mechanism is to assure consistency across all those implementation APIs. New APIs can be added just by extending a template definition and will automatically participate in the session management mechanisms, because any access is routed through the top level Session PImpl.

structure of session implementation-level services

Assumed any part of the Steam implementation needs to cooperate with the session implementation; the necessary link has to be abstracted into an implementation level API. Typically, this API provides an static access function, which is to be implemented "somewhere else", so the Steam implementation isn't required to include anything of the session implementation level

In order to actually provide such a service, an specialisation of the ServiceAccessPoint template has to be defined, which may mix in the service API and implement it directly on top of SessionImpl. Note, mixing in the API isn't required – alternatively the API might be completely bridged through the mentioned static access functions (i.e. such would be kind of an generic API, relying on convention rather than on a vtable)

When the SessManagerImpl creates the concrete session object, it doesn't use the bare SessionImpl class; rather, an inheritance chain is formed, starting with SessionImpl and stacking any of the configured ServiceAccessPoint instantiations on top of it. Thus, the public session access gets the concrete implementation of the Session API (through the vtable), while any service level access can use the corresponding service API directly. Service APIs have to care to avoid name clashes though.

The implementation of all the service API access functions is bundled within session-service.cpp – where the full compound of SessionImpl and the ServiceAccessPoint specialisations has to be visible.

See also
session-service-access-test.cpp simplified inline demo definition of this setup
session.hpp public Session API
session-impl.hpp definition of ServiceAccessPoint specialisations
session-impl.cpp Session implementation internals

Definition in file session-services.hpp.

Classes

struct  ServiceAccessPoint< API, IMPL >
 Access point to a single implementation-level API. More...
 
class  SessionServices< APIS, FRONT, SESS >
 Collection of configured implementation-level services to provide by the Session. More...
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::mobject
 Media-Objects, edit operations and high-level session.
 
 steam::mobject::session
 Namespace of Session and user visible high-level objects.
 

Class Documentation

◆ steam::mobject::session::ServiceAccessPoint

struct steam::mobject::session::ServiceAccessPoint
+ Collaboration diagram for ServiceAccessPoint< API, IMPL >: