Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JEventProcessor_CODA_online.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: JEventProcessor_CODA_online.h
4 // Created: Fri Nov 9 10:56:00 EST 2013
5 // Creator: wolin (on Linux stan.jlab.org 2.6.32-279.11.1.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _JEventProcessor_CODA_online_
9 #define _JEventProcessor_CODA_online_
10 
11 #include<memory>
12 #include<thread>
13 
14 
15 // for JANA
16 #include <JANA/JApplication.h>
17 #include <JANA/JEventProcessor.h>
18 #include <JANA/JParameterManager.h>
19 
20 
21 // for coda object package
22 #include <RunObject.hxx>
23 
24 
25 using namespace std;
26 using namespace jana;
27 using namespace codaObject;
28 
29 
30 /**
31  * Plugin extends RunObject to interface between coda object and JANA event processor for farm management.
32  *
33  * Uses gPARMS flags CODAOBJECT:UDL, NAME, DESCR, and SESSION.
34  */
35 class JEventProcessor_CODA_online : public JEventProcessor, public RunObject {
36 
37  public:
38  const char* className(void){return "JEventProcessor_CODA_online";}
39 
40  JEventProcessor_CODA_online(void) = delete;
42  JEventProcessor_CODA_online& operator=(const JEventProcessor_CODA_online&) = delete;
43  JEventProcessor_CODA_online(const string &UDL, const string &name, const string &descr, const string &theSession);
44  ~JEventProcessor_CODA_online() throw();
45 
46 
47  // for JANA
48  private:
49  jerror_t fini(void); /**<Called after last event of last event source has been processed.*/
50 
51 
52  public:
53  virtual bool userConfigure(const string& s) throw(CodaException) override;
54  virtual bool userDownload(const string& s) throw(CodaException) override;
55  virtual bool userPrestart(const string& s) throw(CodaException) override;
56  virtual bool userGo(const string& s) throw(CodaException) override;
57  virtual bool userPause(const string& s) throw(CodaException) override;
58  virtual bool userResume(const string& s) throw(CodaException) override;
59  virtual bool userEnd(const string& s) throw(CodaException) override;
60  virtual bool userReset(const string& s) throw(CodaException) override;
61  virtual void exit(const string& s) throw(CodaException) override;
62 
63  virtual void userMsgHandler(cMsgMessage *msgp, void *userArg) throw(CodaException) override;
64 
65 
66  public:
67  virtual const void statistics_thread(void) throw();
68  void fillReport(cMsgMessage *m) throw();
69 
70 
71  protected:
72  unique_ptr<thread> stat_thread; /**<Sets event and data counts for monitoring.*/
73 
74  public:
75  bool done; /**<Tells coda object it is done.*/
76 
77 
78 };
79 
80 #endif // _JEventProcessor_CODA_online_
81