STIR
6.2.0
|
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files. More...
#include "stir/RegisteredParsingObject.h"
Inherits Parent.
Classes | |
struct | RegisterIt |
A helper class to allow automatic registration. More... | |
Public Member Functions | |
std::string | get_registered_name () const override |
Returns Derived::registered_name. | |
std::string | parameter_info () override |
Returns a string with all parameters and their values, in a form suitable for parsing again. | |
Static Public Member Functions | |
static Base * | read_from_stream (std::istream *) |
Construct a new object (of type Derived) by parsing the istream. More... | |
Friends | |
struct | RegisterIt |
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
RegisteredParsingObject::read_from_stream is implemented in terms of ParsingObject::parse.
Requirements on the class Base:
Requirements on the class Derived:
Requirements on the class Parent:
Use the 2 parameter form if there is no ParsingObject anywhere in the hierarchy yet. However, we recommend to immediately derive Base from ParsingObject.
A leaf will be entered in the hierarchy by declaring a variable as follows:
As soon as the variable is destructed, the leaf will be taken out of the registry (but see todo). If you want to add it as long as the program runs, use a static variable.
Currently, STIR has static variables in files for each module (for instance, buildblock_registries.cxx). Note that these files have to be linked explicitly into your program, as opposed to sticking it in a library. This is because the linker will think that the variables in that file are never referenced, so would not include it in the final executable (to try to remove redundant object files).
|
inlinestatic |
Construct a new object (of type Derived) by parsing the istream.
When the istream * is 0, questions are asked interactively.