rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rexlib::service_catalog Class Reference

Stores a single instance of each type service_manager. More...

#include <rexlib/core/service_catalog.hpp>

Public Member Functions

 service_catalog (bool register_builtin_backends=true)
 Construct a new interface catalog object.
 
 service_catalog (const service_catalog &other)=delete
 
 service_catalog (service_catalog &&other) noexcept
 
service_catalog & operator= (const service_catalog &other)=delete
 
service_catalog & operator= (service_catalog &&other) noexcept
 
template<typename T >
std::shared_ptr< T > get_service_manager ()
 Retrieve the unique instance of a concrete service_manager.
 

Detailed Description

Stores a single instance of each type service_manager.

The interface catalog allows to centralize interface managers.

See also
service_manager

Constructor & Destructor Documentation

◆ service_catalog()

rexlib::service_catalog::service_catalog ( bool  register_builtin_backends = true)
explicit

Construct a new interface catalog object.

Parameters
register_builtin_backendsThis parameters controls whether the interface catalog should load the backends bundled with the core.

Member Function Documentation

◆ get_service_manager()

template<typename T >
std::shared_ptr< T > rexlib::service_catalog::get_service_manager ( )

Retrieve the unique instance of a concrete service_manager.

Always returns the same instance of T held by this catalog, constructing it on first access, so within a given catalog the returned pointer behaves like a singleton. These are not true singletons: the uniqueness is scoped to the owning service_catalog rather than to the whole process, which keeps service_manager instances out of global state.

Template Parameters
TConcrete type derived from service_manager to retrieve.
Returns
Shared pointer to the catalog-owned instance of T. Never null.
See also
service_manager

The documentation for this class was generated from the following file: