Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ophBuffer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ophBuffer.h
1 #ifndef __OPHBUFFER_H
2 #define __OPHBUFFER_H
3 
4 #include "event_io.h"
5 
6 #include "phenixTypes.h"
7 #include "oBuffer.h"
8 #include "oEvent.h"
9 #include "Event.h"
10 
11 
12 class ophBuffer : public oBuffer {
13 
14 public:
15 
16  //** Constructors
17 
18  // ophBuffer( FILE *fpp, PHDWORD * , const int length
19  // , const int iseq = 1, const int irun=1);
20 
21  ophBuffer() {};
22 
23  ophBuffer (int fd, PHDWORD * where, const int length,
24  const int irun=1 , const int iseq=0 );
25 
26  ophBuffer (const char *filename, PHDWORD * where, const int length,
27  int &status,
28  const int irun=1 , const int iseq=0 );
29 
30 
31  ~ophBuffer();
32 
33  // this creates a new event on the next address
34  int nextEvent( const unsigned int evtsize, const int etype =0, const int evtseq =0);
35 
36 
37  // frame and packet adding
38 
39  int addRawEvent(unsigned int *);
40 
41  int addEvent(Event *);
42 
43  int addFrame(PHDWORD *);
44 
45  int addPacket( const Packet *p);
46 
48  const int length,
49  const int id,
50  const int wordsize,
51  const int hitformat);
52 
53  int writeout ();
54 
55  // now the re-sizing of buffer
56  int setMaxSize( const int size);
57 
58  // and the query
59  int getMaxSize() const;
60 
61  // and the query`
62  unsigned long long getBytesWritten() const;
63 
64  int addEoB();
65 
66 
67 protected:
68 
69  int prepare_next();
70 
71 
74 
80  int max_size;
81  unsigned int left;
82  int sequence;
83  int runnumber;
84  unsigned long long byteswritten;
88  int has_end;
89  int dirty;
90  int fd;
91  int our_fd;
93 
94 
95 };
96 
97 #endif
98