SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Interface generator class. More...
#include <Generator.h>
Public Member Functions | |
template<typename... T> | |
Generator (T &&... all) | |
bool | valid (const Input &) const override |
Loop over registered generators and return true if any of the generators' valid() calls return true; otherwise, return false. | |
Output | operator() (const Input &) override |
Loop over registered generators and return an Output instance from the first generator (a) whose valid() call returns true, and (b) that successfully creates an instance of Output (without throwing). | |
![]() | |
GeneratorBase (T &&... all) | |
Static Protected Member Functions | |
static std::weak_ptr< std::set< GeneratorBase< Input, Output, Base > * > > | generators () |
Even though the set of generators is static, we cannot guarantee its existence across compilation units due to our plugin-based architecture. More... | |
Friends | |
template<class U , class V , class W , class X > | |
class | GeneratorType |
Interface generator class.
Implements the base methods valid() and the function call operator as a loop over the registered GeneratorTypes. Also contains the static set of generator types.
|
staticprotected |
Even though the set of generators is static, we cannot guarantee its existence across compilation units due to our plugin-based architecture.
We therefore use a weak pointer to guard ourselves against the unlikely event of a generator implementation outliving its base generator class.