DABC (Data Acquisition Backbone Core)  2.9.9
HldOutput.h
Go to the documentation of this file.
1 // $Id: HldOutput.h 4575 2020-08-04 12:44:29Z linev $
2 
3 /************************************************************
4  * The Data Acquisition Backbone Core (DABC) *
5  ************************************************************
6  * Copyright (C) 2009 - *
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8  * Planckstr. 1, 64291 Darmstadt, Germany *
9  * Contact: http://dabc.gsi.de *
10  ************************************************************
11  * This software can be used under the GPL license *
12  * agreements as stated in LICENSE.txt file *
13  * which is part of the distribution. *
14  ************************************************************/
15 
16 #ifndef HADAQ_HldOutput
17 #define HADAQ_HldOutput
18 
19 #ifndef DABC_DataIO
20 #include "dabc/DataIO.h"
21 #endif
22 
23 #ifndef HADAQ_HldFile
24 #include "hadaq/HldFile.h"
25 #endif
26 
27 namespace hadaq {
28 
31  class HldOutput : public dabc::FileOutput {
32  protected:
33 
34  bool fRunSlave;
35  uint32_t fLastRunNumber;
36  uint32_t fRunNumber;
37  uint32_t fEventNumber;
38  uint16_t fEBNumber;
39  bool fUseDaqDisk;
40  bool fRfio;
41  bool fLtsm;
42  bool fPlainName;
43  std::string fUrlOptions;
44  std::string fLastPrefix;
45 
46  std::string fRunInfoToOraFilename;
47 
49 
50  bool CloseFile();
51  bool StartNewFile();
52 
53  /* stolen from daqdata/hadaq/logger.c to keep oracle export output format of numbers*/
54  char* Unit(unsigned long v);
55 
56  public:
57 
58  HldOutput(const dabc::Url& url);
59  virtual ~HldOutput();
60 
61  virtual bool Write_Init();
62 
63  virtual bool Write_Retry();
64 
65  virtual unsigned Write_Buffer(dabc::Buffer& buf);
66 
67  virtual bool Write_Stat(dabc::Command cmd);
68 
69  virtual bool Write_Restart(dabc::Command cmd);
70  };
71 }
72 
73 #endif
Reference on memory from memory pool.
Definition: Buffer.h:135
Represents command with its arguments.
Definition: Command.h:99
Interface for implementing file outputs.
Definition: DataIO.h:283
Uniform Resource Locator interpreter.
Definition: Url.h:33
HLD file implementation.
Definition: HldFile.h:31
Implementation of file output for HLD files.
Definition: HldOutput.h:31
bool fRfio
true if we write to rfio
Definition: HldOutput.h:40
char * Unit(unsigned long v)
bool fRunSlave
true if run id is controlled by combiner
Definition: HldOutput.h:34
uint32_t fEventNumber
used to count event numbers when writing plain subevents
Definition: HldOutput.h:37
bool fLtsm
true if we write to ltsm
Definition: HldOutput.h:41
virtual ~HldOutput()
Definition: HldOutput.cxx:79
virtual bool Write_Stat(dabc::Command cmd)
Fill different statistic parameters into provided command.
Definition: HldOutput.cxx:226
uint32_t fRunNumber
id number of current run (can be 0 when data are ignored)
Definition: HldOutput.h:36
virtual bool Write_Retry()
Returns true if output object can be reinitialized for recover error.
Definition: HldOutput.cxx:191
virtual unsigned Write_Buffer(dabc::Buffer &buf)
Start writing of buffer to output.
Definition: HldOutput.cxx:239
uint32_t fLastRunNumber
id number of last written run
Definition: HldOutput.h:35
virtual bool Write_Init()
This is generic virtual method to initialize output before real work is started.
Definition: HldOutput.cxx:85
hadaq::HldFile fFile
Definition: HldOutput.h:48
std::string fRunInfoToOraFilename
Definition: HldOutput.h:46
uint16_t fEBNumber
id of parent event builder process
Definition: HldOutput.h:38
bool fPlainName
if true no any runid extensions appended to file name
Definition: HldOutput.h:42
bool fUseDaqDisk
true if /data number is taken from daq_disk (HADES setup)
Definition: HldOutput.h:39
std::string fUrlOptions
remember URL options, may be used for RFIO file open
Definition: HldOutput.h:43
virtual bool Write_Restart(dabc::Command cmd)
Method used to restart output - like recreate new output file.
Definition: HldOutput.cxx:211
std::string fLastPrefix
last prefix submitted from BNet master
Definition: HldOutput.h:44
HldOutput(const dabc::Url &url)
Definition: HldOutput.cxx:34
Support for HADAQ - HADES DAQ
Definition: api.h:27