-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprdfoStream.h
More file actions
63 lines (41 loc) · 937 Bytes
/
Copy pathprdfoStream.h
File metadata and controls
63 lines (41 loc) · 937 Bytes
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
60
61
62
#ifndef __PRDFOSTREAM_H
#define __PRDFOSTREAM_H
#include <EventTypes.h>
#include <Event.h>
#include <BufferConstants.h>
class prdfoStream {
public:
//** Constructors
prdfoStream(const char *filename, const int bufferlength = 4*1024*1024);
virtual ~prdfoStream();
int addEvent( Event *);
int is_defunct() const { return defunct; };
protected:
// add end-of-buffer
int addEoB();
// now the write routine
unsigned int writeout ();
int prepare_next( const int iseq, const int irun=0);
static unsigned int writen (int fd, char *ptr, const unsigned int nbytes);
std::string _filename;
typedef struct
{
int Length;
int ID;
int Bufseq;
int Runnr;
int data[1];
} *buffer_ptr;
int has_buffer;
int buffer_sequence;
buffer_ptr bptr;
int *data_ptr;
int current_index;
int max_length;
int max_size;
int left;
int has_end;
int fd;
int defunct;
};
#endif