GEMC  2.3
Geant4 Monte-Carlo Framework
detector_factory.h
Go to the documentation of this file.
1 #ifndef detector_factory_H
2 #define detector_factory_H 1
3 
4 // gemc headers
5 #include "options.h"
6 #include "detector.h"
7 #include "run_conditions.h"
8 #include "utils.h"
9 
10 // c++ headers
11 #include <map>
12 #include <iostream>
13 
15 {
16  public:
17  // Pure Virtual Method to create the map<string, detectors>
18  virtual map<string, detector> loadDetectors() = 0;
19  virtual ~detectorFactory(){}
20 
21  // initialize factorytype, option and runcondition classes
22  void initFactory(goptions, runConditions, string) ;
23 
24  string factoryType;
27 };
28 
29 // Define detectorFactoryInMap as a pointer to a function that returns a pointer
30 typedef detectorFactory *(*detectorFactoryInMap)();
31 
32 // returns detectorFactory from Factory Map
33 detectorFactory *getDetectorFactory(map<string, detectorFactoryInMap> *detectorFactoryMap, string);
34 
35 // Registers detectorFactories in detectorFactoryMap
36 map<string, detectorFactoryInMap> registerDetectorFactory();
37 
38 // build detectors according to their factory
39 map<string, detector> buildDetector(map<string, detectorFactoryInMap> detectorFactoryMap, goptions go, runConditions rc);
40 
41 string check_factory_existance(map<string, detectorFactoryInMap> detectorFactoryMap, runConditions rc);
42 
43 // load detector from gtable
45 
46 #endif
string check_factory_existance(map< string, detectorFactoryInMap > detectorFactoryMap, runConditions rc)
Definition: utils.h:65
detectorFactory * getDetectorFactory(map< string, detectorFactoryInMap > *detectorFactoryMap, string)
runConditions RC
virtual ~detectorFactory()
virtual map< string, detector > loadDetectors()=0
map< string, detector > buildDetector(map< string, detectorFactoryInMap > detectorFactoryMap, goptions go, runConditions rc)
map< string, detectorFactoryInMap > registerDetectorFactory()
void initFactory(goptions, runConditions, string)
detector get_detector(gtable, goptions go, runConditions rc)