SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Resources and operations both have optional managers that can be used as an interface for their construction, to track their existence and to attach observers to their actions. More...
Classes | |
struct | AllDependencies |
AllDependencies accepts a Registrar and returns a tuple of all of its dependencies. More... | |
struct | AllDependenciesWithDuplicates |
AllDependenciesWithDuplicates is an intermediate step in constructing a flat list of all of the dependencies of a Registrar. More... | |
struct | AllDependenciesWithDuplicates< Registrar, Registrars... > |
struct | AllDependenciesWithDuplicates< std::tuple< T > > |
struct | AllDependenciesWithDuplicates< std::tuple<> > |
struct | AllDependenciesWithDuplicates<> |
class | Client |
The "public" Client is simply a composition of detail::Clients, one for each Manager type. More... | |
class | ClientFor |
Clients are a composition of Registrars and Managers. More... | |
class | Dependencies |
Registrars may declare dependencies to other Registrars by defining a type "Dependencies" as a std::tuple of additional Registrars. More... | |
class | Manager |
class | ManagerCount |
ManagerCount is a singleton map of Schwarz counters for pairs of Manager instances and Registrar types. More... | |
class | MaybeRegister |
MaybeRegister accepts a Registrar, a Manager and a boolean type. More... | |
class | MaybeRegister< Registrar, Manager, std::false_type > |
class | MaybeRegister< Registrar, Manager, std::true_type > |
class | RegistersTo |
This template class takes as arguments a Registrar and a Manager. More... | |
struct | Sentinel |
Resources and operations both have optional managers that can be used as an interface for their construction, to track their existence and to attach observers to their actions.
Additional modeling sessions and other plugins can augment the functionality of these managers, but they must register themselves with a manager to do so. Additionally, plugins that can be unloaded must remove themselves from managers, or else managers may try to call routines that are no longer in memory. To facilitate this registration process, we introduce a Registry that accepts as template parameters a Registrar, or class with pairs of "registerTo" and "unregisterFrom" methods for each manager type to which the plugin registers, and a variable number of manager classes. The Registrar's registration methods are called for each appropriate manager upon the Registry's construction, and the Registrar's unregister methods are called for each manager (if they are still in memory) upon the Registry's deletion.
The Registry class is implemented via templates to facilitate a) the registration to only a subset of available managers, b) the abilty to accommodate additional managers in the future without incurring a runtime dispatch penalty, c) construction of an object that can call new code during its own destruction (pure virtual methods should not be called in a base class's destructor), and d) to keep homologous Manager classes from being entwined via a superfluous base class.