MarlinTrk  02.08
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Factory.h
Go to the documentation of this file.
1 #ifndef MarlinTrk_Factory_h
2 #define MarlinTrk_Factory_h
3 
4 #include "IMarlinTrkSystem.h"
5 
6 #include <string>
7 #include <map>
8 
9 
10 // fwd declaration for bwd compatibility
11 namespace gear{
12  class GearMgr ;
13 }
14 
15 
16 namespace MarlinTrk{
17 
28  class Factory {
29 
30  public:
31 
32  virtual ~Factory() {
33  for( auto& trkSystem : _map ) { delete trkSystem.second; }
34  }
35 
36  Factory(const Factory&) = delete;
37  Factory const& operator=(const Factory&) = delete;
38 
47  static IMarlinTrkSystem* createMarlinTrkSystem(const std::string& systemType,
48  const gear::GearMgr* gearMgr,
49  const std::string& options ) ;
50 
51 
61  static IMarlinTrkSystem* getMarlinTrkSystem(const std::string& systemType) ;
62 
63 
74 
75 
76  static Factory* instance() ;
77 
78  protected:
79 
81 
83 
85 
87 
88  } ;
89 
90 } // end of MarlinTrk namespace
91 
92 #endif
93 
virtual ~Factory()
Definition: Factory.h:32
std::map< std::string, IMarlinTrkSystem * > TrkSystemMap
Definition: Factory.h:80
Factory methods for creating the MarlinTrkSystem of a certain type: DDKalTest, aidaTT,... Currently implemented: DDKalTest, aidaTT.
Definition: Factory.h:28
TrkSystemMap _map
Definition: Factory.h:86
STL class.
Factory const & operator=(const Factory &)=delete
static IMarlinTrkSystem * getCurrentMarlinTrkSystem()
Return the current MarlinTrkSystem, i.e.
Definition: Factory.cc:87
IMarlinTrkSystem * _currentTrkSystem
Definition: Factory.h:84
Base class for tracking system implementations in MarlinTrk.
static IMarlinTrkSystem * getMarlinTrkSystem(const std::string &systemType)
Return the MarlinTrkSystem of the given type - only valid after a preceeding call to createMarlinTrkS...
Definition: Factory.cc:65
static IMarlinTrkSystem * createMarlinTrkSystem(const std::string &systemType, const gear::GearMgr *gearMgr, const std::string &options)
Create the MarlinTrkSystem instance of the specified type: DDKalTest, aidaTT,... Returns 0 if type ...
Definition: Factory.cc:14
static Factory * instance()
Definition: Factory.cc:105