Luiza  v03-01
ProcessorMgr.h
1 #ifndef ProcessorMgr_h
2 #define ProcessorMgr_h 1
3 
4 // #include "lcio.h"
5 #include "Processor.h"
6 // #include "LCIOOutputProcessor.h"
7 
8 // #include "IO/LCRunListener.h"
9 // #include "IO/LCEventListener.h"
10 
11 // #include "EVENT/LCEvent.h"
12 // #include "EVENT/LCRunHeader.h"
13 
14 #include "LogicalExpressions.h"
15 
16 #include "gloria/GloriaDataContainer.h"
17 
18 #include <map>
19 #include <set>
20 #include <list>
21 
22 using namespace gloria;
23 
24 namespace luiza{
25 
26  // class ProcessorEventSeeder;
27 
28 typedef std::map< const std::string , Processor* > ProcessorMap ;
29 typedef std::list< Processor* > ProcessorList ;
30 typedef std::map< const std::string , int > SkippedEventMap ;
31 
39 // class ProcessorMgr : public LCRunListener, public LCEventListener {
40 class ProcessorMgr {
41 
42 friend class Processor ;
43 friend class CMProcessor ;
44 friend class LuizaSteerCheck ;
45 
46 public:
47 
50  static ProcessorMgr* instance() ;
51 
54  virtual ~ProcessorMgr() ;
55 
59 // bool addActiveProcessor( const std::string& processorType , const std::string& processorName ,
60 // StringParameters* parameters=0 ) ;
61 
65  bool addActiveProcessor( const std::string& processorType , const std::string& processorName ,
66  StringParameters* parameters , const std::string condition="true" ) ;
67 
70  void removeActiveProcessor( const std::string& name ) ;
71 
72 
76  Processor* getActiveProcessor( const std::string& name ) ;
77 
81  Processor* getProcessor( const std::string& type ) ;
82 
85  void dumpRegisteredProcessors() ;
86 
89  void dumpRegisteredProcessorsXML() ;
90 
92  virtual void init() ;
93 
95  virtual void startAnalysis( GloriaDataContainer* ) ;
96 
98  virtual bool processData( GloriaDataContainer* ) ;
99 
101  virtual void concludeAnalysis( GloriaDataContainer* ) ;
102 
104  virtual void end() ;
105 
106 
109  // virtual void readDataSource( int numEvents ) ;
110 
114  void processingLoop( int numEvents ) ;
115 
116 
118  virtual void setProcessorReturnValue( Processor* proc, bool val ) ;
119 
121  virtual void setProcessorReturnValue( Processor* proc, bool val , const std::string& name) ;
122 
123 
124 protected:
127  void registerProcessor( Processor* processor ) ;
128 
130  std::set< std::string > getAvailableProcessorTypes() ;
131 
132 // ProcessorMgr() : _outputProcessor(0) {}
133 // ProcessorMgr() {}
134  ProcessorMgr() ;
135 
136 private:
137  static ProcessorMgr* _me ;
138  ProcessorMap _map ;
139  ProcessorMap _activeMap ;
140  ProcessorList _list ;
141  SkippedEventMap _skipMap ;
142 
143  LogicalExpressions _conditions ;
144 
145 };
146 
147 } // end namespace luiza
148 #endif
Definition: CMProcessor.h:21
namespace for data storing and exchange formats
Definition: GloriaAstrometry.h:15
Definition: LuizaSteerCheck.h:72
Definition: LogicalExpressions.h:143
Class for storing all data processed in Luiza.
Definition: GloriaDataContainer.h:82
Base class for Luiza processors.
Definition: Processor.h:55
Definition: ProcessorMgr.h:40
Namespace for Luiza framework.
Definition: CCCollection.h:6