|
| ParserFactory () |
| Default constructor.
|
|
void | registerParser (const std::string &name, createFunc create) |
| Register the parser with this factory.
|
|
Definition at line 19 of file ParserFactory.h.
◆ ParserFactory()
simcore::geo::ParserFactory::ParserFactory |
( |
| ) |
|
|
private |
Default constructor.
Definition at line 19 of file ParserFactory.cxx.
static Parser * create(framework::config::Parameters ¶meters, simcore::ConditionsInterface &ci)
Create an instance of this parser.
void registerParser(const std::string &name, createFunc create)
Register the parser with this factory.
References simcore::geo::GDMLParser::create(), and registerParser().
◆ createParser()
Create an instance of the parser of the given type.
- Parameters
-
[in] | type | String type of the perser that needs to be created. |
[in] | ci | Interface to conditions system. |
Definition at line 25 of file ParserFactory.cxx.
27 {
28 auto it{parser_map.find(name)};
29 if (it == parser_map.end())
30 EXCEPTION_RAISE("ParserNotFound", "The parser " + name + " was not found.");
31
32 return it->second(parameters, ci);
33}
◆ getInstance()
Get the instance to this factory.
Definition at line 14 of file ParserFactory.cxx.
14 {
16 return instance;
17}
ParserFactory()
Default constructor.
◆ registerParser()
void simcore::geo::ParserFactory::registerParser |
( |
const std::string & |
name, |
|
|
createFunc |
create |
|
) |
| |
|
private |
Register the parser with this factory.
This is used to map the name of the parser to the function used to create it.
- Parameters
-
[in] | name | Name of the parser being registered. |
[in] | crate | Function used to create this function. |
Definition at line 21 of file ParserFactory.cxx.
21 {
22 parser_map[name] = create;
23}
Referenced by ParserFactory().
◆ parser_map
std::map<std::string, createFunc> simcore::geo::ParserFactory::parser_map |
|
private |
The documentation for this class was generated from the following files: