FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
SpecTclWorker.h
1 /*
2  This software is Copyright by the Board of Trustees of Michigan
3  State University (c) Copyright 2017.
4 
5  You may use this software under the terms of the GNU public license
6  (GPL). The terms of this license are described at:
7 
8  http://www.gnu.org/licenses/gpl.txt
9 
10  Authors:
11  Ron Fox
12  Giordano Cerriza
13  FRIB
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
21 #ifndef ANALYSIS_SPECTCLWORKER_H
22 #define ANALYSIS_SPECTCLWORKER_H
24 
25 #include <vector>
26 #include <string>
27 namespace frib {
28  namespace analysis {
29  class CEventProcessor;
30  class CBufferDecoder;
31  class CAnalyzer;
32  class CEvent;
48  private:
49  std::vector<std::pair<std::string, CEventProcessor*>> m_pipeline;
50  unsigned m_unNamedIndex;
51 
52  // Needed for the event processors:
53 
54  CBufferDecoder* m_pDecoder;
55  CAnalyzer* m_pAnalyzer;
56  CEvent* m_pEvent;
57  public:
59  virtual ~CSpecTclWorker();
60 
61  // Pipeline manipulation - I'd really guess add is the only one
62  // that would be used.
63 
64  std::string addProcessor(CEventProcessor* pProcessor, const char* name=nullptr);
65  void removeEventProcessor(CEventProcessor* pProcessor);
66  void removeEventProcessor(const char* name);
67 
68  // Interfaces for the worker:
69 
70  virtual void initializeUserCode(
71  int argc, char** argv, AbstractApplication& app
72  );
73  virtual void unpackData(const void* pData);
74 
75  // In case the filename is in some other pocket the
76  // user can replace this.
77 
78  virtual std::string getInputFilename(int argc, char** argv);
79  private:
80  std::string makeName();
82  std::vector<std::pair<std::string, CEventProcessor*>>::iterator p
83  );
84  };
85  }
86 }
87 
88 #endif
Definition: AbstractApplication.h:102
virtual ~CSpecTclWorker()
Definition: SpecTclWorker.cpp:58
Definition: Analyzer.h:41
CSpecTclWorker(AbstractApplication &app)
Definition: SpecTclWorker.cpp:46
Definition: SpecTclWorker.h:47
: Raw events -> Parameter worker skeleton.
Definition: BufferDecoder.h:39
Definition: Event.h:45
virtual std::string getInputFilename(int argc, char **argv)
Definition: SpecTclWorker.cpp:211
Definition: EventProcessor.h:37
Definition: MPIRawToParametersWorker.h:67
std::string addProcessor(CEventProcessor *pProcessor, const char *name=nullptr)
Definition: SpecTclWorker.cpp:73
virtual void initializeUserCode(int argc, char **argv, AbstractApplication &app)
Definition: SpecTclWorker.cpp:130
void removeEventProcessor(CEventProcessor *pProcessor)
Definition: SpecTclWorker.cpp:92
Definition: AbstractApplication.cpp:30
virtual void unpackData(const void *pData)
Definition: SpecTclWorker.cpp:165