SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Common class to hold a dictionary of update methods for various elements in SMTK. More...
#include <Factory.h>
Classes | |
struct | Entry |
An entry in the factory holding an update method and all the metadata required to index the things the method applies to. More... | |
Public Member Functions | |
const Entry & | find (smtk::string::Token elementSpec, std::size_t resultElementVersion, std::size_t inputElementVersion) |
Return an entry with the appropriate updater (or an invalid entry). | |
std::set< std::size_t > | canProduce (smtk::string::Token elementSpec) const |
Given a target, return the set of versions which updaters can produce as output. | |
std::set< std::size_t > | canAccept (smtk::string::Token elementSpec) const |
Given a target, return the set of versions which updaters can accept as input. | |
bool | registerUpdater (smtk::string::Token target, std::size_t appliesToVersionMin, std::size_t appliesToVersionMax, std::size_t producesVersion, UpdaterSignature updater) |
Protected Attributes | |
std::unordered_map< smtk::string::Token, std::set< Entry > > | m_entries |
Common class to hold a dictionary of update methods for various elements in SMTK.
The template parameter is the signature of a function to which a target element and output object are passed.
The template parameter must name a type with a default constructor that produces an object which can be implicitly converted to a false-like value. For example, an item updater might use an UpdaterSignature of std::function<bool(const Item*, Item*)>; the default constructor produces an empty functor that is implicitly converted to nullptr. This property is used to produce an invalid factory Entry when no updater exists.