forked from IevgenLavrukhin/e1039_coda_decoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTHaCodaData.h
66 lines (45 loc) · 1.63 KB
/
THaCodaData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef THaCodaData_h
#define THaCodaData_h
/////////////////////////////////////////////////////////////////////
//
// THaCodaData
// Abstract class of CODA data.
//
// THaCodaData is an abstract class of CODA data. Derived
// classes will be typically either a CODA file (a disk
// file) or a connection to the ET system. Public methods
// allow to open (i.e. set up), read, write, etc.
//
// author Robert Michaels (rom@jlab.org)
//
/////////////////////////////////////////////////////////////////////
#include <Rtypes.h>
#include "TString.h"
#define CODA_ERROR -1 // Generic error return code
#define CODA_OK 0 // Means return is ok.
#define MAXEVLEN 200000 // Maximum size of events
#define CODA_VERBOSE 1 // Errors explained verbosely (recommended)
#define CODA_DEBUG 1 // Lots of printout (recommend to set = 0)
using namespace std;
class THaCodaData {
public:
THaCodaData();
virtual ~THaCodaData();
virtual int codaOpen(TString filename)=0;
virtual int codaOpen(TString filename, TString session) {return CODA_OK;};
virtual int codaOpen(TString filename, TString session, int mode) {return CODA_OK;};
virtual int codaClose()=0;
virtual int codaRead()=0;
virtual unsigned *getEvBuffer() { return evbuffer; };
virtual int getBuffSize() const { return MAXEVLEN; };
private:
THaCodaData(const THaCodaData &fn);
THaCodaData& operator=(const THaCodaData &fn);
protected:
TString filename;
unsigned *evbuffer; // Raw data
#ifndef STANDALONE
ClassDef(THaCodaData,0) // Base class of CODA data (file, ET conn, etc)
#endif
};
#endif