SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Generator templates. More...
#include "smtk/common/CompilerInformation.h"
#include <algorithm>
#include <cassert>
#include <memory>
#include <set>
Go to the source code of this file.
Classes | |
struct | smtk::common::detail::NullGeneratorBase |
class | smtk::common::GeneratorBase< Input, Output, Base > |
Base for all generators. More... | |
class | smtk::common::Generator< Input, Output, Base > |
Interface generator class. More... | |
class | smtk::common::GeneratorType< Input, Output, Self, Base > |
Base class for specific generator types. More... | |
Namespaces | |
smtk | |
The main namespace for the Simulation Modeling Tool Kit (SMTK). | |
smtk::common | |
Classes used throughout the toolkit. | |
Macros | |
#define | DEBUG_GENERATOR 0 |
Generator templates.
Given an input type <Input>
and a desired output type <Output>
, the following class templates describe a class Generator<Input, Output>
for generating an instance of the Output type given the Input type. The output type must have a default constructor; this value will be returned when no conditions for generation have been satisfied. Here is an example of an implementation that accepts std::string and outputs type Foo:
(RegisterGenerateFoo.h) This class can exist external to smtk, like in a plugin (RGG, for example).
(RegisterGenerateFoo.cxx) Note that valid()
and operator()
may be defined in the header, and registerClass()
may be called in another .cxx file, like smtk's Registrar.cxx
files.
(GenerateFoo.h) Note: the macros used here are different and depend on the smtk module, here IOVTK
(GenerateFoo.cxx) The .cxx must exist to generate the right symbols to link against.
(Implementation.cxx)