21#ifndef __stir_FactoryRegistry_H__
22#define __stir_FactoryRegistry_H__
51template <
typename Key,
typename Factory,
typename Compare = std::less<Key>>
92 typedef std::map<Key, Factory, Compare> FactoryMap;
94 const bool has_defaults;
95 const Key default_key;
96 const Factory default_factory;
Inline implementations for stir::FactoryRegistry.
FactoryRegistry()
Default constructor without defaults (see find_factory())
Definition FactoryRegistry.inl:29
FactoryRegistry(const Key &default_key, const Factory &default_factory)
constructor with default values which will be returned when no match is found (see find_factory())
Definition FactoryRegistry.inl:34
Factory const & find_factory(const Key &key) const
Find a factory corresponding to a key.
Definition FactoryRegistry.inl:99
void remove_from_registry(const Key &key)
Remove a pair from the registry.
Definition FactoryRegistry.inl:72
void list_keys(std::ostream &s) const
List all keys to an ostream, separated by newlines.
Definition FactoryRegistry.inl:91
void add_to_registry(const Key &key, Factory const &factory)
Add a pair to the registry.
Definition FactoryRegistry.inl:54
basic configuration include file