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