SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Given a Registrar (a class that describes how to register and unregister a plugin) and one or more Managers, the Registry is a class composed of MaybeRegister-s for the Registrar and each Manager (and also a base class RegistryBase for good measure). More...
#include <Registry.h>
Public Types | |
typedef int | DoNotRegisterDependencies |
Public Member Functions | |
Registry (const std::shared_ptr< Manager > &manager, const std::shared_ptr< T > &... managers) | |
template<typename M > | |
bool | contains (const std::shared_ptr< M > &m) |
Registry (DoNotRegisterDependencies, const std::shared_ptr< Manager > &manager, const std::shared_ptr< T > &... managers) | |
Additional Inherited Members | |
Protected Attributes inherited from smtk::plugin::RegistryBase | |
std::vector< RegistryBase * > | m_registries |
Given a Registrar (a class that describes how to register and unregister a plugin) and one or more Managers, the Registry is a class composed of MaybeRegister-s for the Registrar and each Manager (and also a base class RegistryBase for good measure).
The lifetime of a plugin's registration to the managers passed to the Registry is then guaranteed to be at least as long as the lifetime of the Registry. Multiple Registries can exist with overlapping registration conditions; multiple registration and early unregistration are avoided via the use of Schwarz counters in MaybeRegister.
Both gcc and clang are savvy to template class descriptions using parameter packs. MSVC isn't quite there yet. The following code is bifurcated according to compiler type because, even though the two code paths produce functionally equivalent code, the first implementation does so with much less compile-time (and library size) overhead. Eventually, only the first implementation should be used.