LDMX Software
ParserFactory.h
1#ifndef SIMCORE_GEO_PARSERFACTORY_H_
2#define SIMCORE_GEO_PARSERFACTORY_H_
3
4#include "SimCore/Geo/Parser.h"
5
6/*~~~~~~~~~~~~~~~~*/
7/* C++ StdLib */
8/*~~~~~~~~~~~~~~~~*/
9#include <map>
10
11/*~~~~~~~~~~~~~~~*/
12/* Framework */
13/*~~~~~~~~~~~~~~~*/
14#include "Framework/Configure/Parameters.h"
15
16namespace simcore {
17namespace geo {
18
20 public:
22 static ParserFactory &getInstance();
23
25 ~ParserFactory() = default;
26
33 Parser *createParser(const std::string &name,
36
37 // Delete the following methods to make sure they are inaccesible.
38 ParserFactory(ParserFactory const &) = delete;
39 void operator=(ParserFactory const &) = delete;
40
41 private:
44
54 void registerParser(const std::string &name, createFunc create);
55
56 // Mapping between a parser type and its create function
57 std::map<std::string, createFunc> parser_map;
58};
59} // namespace geo
60} // namespace simcore
61
62#endif // SIMCORE_GEO_PARSERFACTORY_H_
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Handle to the conditions system, provided at construction to classes which require it.
void registerParser(const std::string &name, createFunc create)
Register the parser with this factory.
Parser * createParser(const std::string &name, framework::config::Parameters &parameters, simcore::ConditionsInterface &ci)
Create an instance of the parser of the given type.
static ParserFactory & getInstance()
Get the instance to this factory.
~ParserFactory()=default
Default constructor.
ParserFactory()
Default constructor.
Interface for a parser used to load a geometry into Geant4.
Definition Parser.h:25