Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventWriterREST_factory.h
Go to the documentation of this file.
1 #ifndef _DEventWriterREST_factory_
2 #define _DEventWriterREST_factory_
3 
4 #include <JANA/JFactory.h>
5 #include <JANA/JEventLoop.h>
6 
8 
9 class DEventWriterREST_factory : public jana::JFactory<DEventWriterREST>
10 {
11  public:
12  DEventWriterREST_factory(){use_factory = 1;}; //prevents JANA from searching the input file for these objects
14 
15  private:
16  jerror_t init(void)
17  {
18  dOutputFileBaseName = "dana_rest";
19  gPARMS->SetDefaultParameter("rest:FILENAME", dOutputFileBaseName);
20  string locDummyString = "";
21  gPARMS->SetDefaultParameter("REST:DATAVERSIONSTRING", locDummyString);
22  return NOERROR;
23  }
24 
25  jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t locEventNumber)
26  {
27  // Create single DEventWriterREST object and marks the factory as persistent so it doesn't get deleted every event.
28  SetFactoryFlag(PERSISTANT);
29  ClearFactoryFlag(WRITE_TO_OUTPUT);
30  _data.push_back(new DEventWriterREST(locEventLoop, dOutputFileBaseName));
31  return NOERROR;
32  }
34 };
35 
36 #endif // _DEventWriterREST_factory_
37 
jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t locEventNumber)