-
Notifications
You must be signed in to change notification settings - Fork 0
/
circbuffer.h
48 lines (42 loc) · 1.27 KB
/
circbuffer.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
//---------------------------------------------------------------------------
#ifndef circbufferH
#define circbufferH
//---------------------------------------------------------------------------
#include <windows.h>
class tCircularBuffer;
class tBufReader;
class tBufReader
{
public:
long bufferStart;
long nowInBuffer;
tCircularBuffer *parent;
__fastcall tBufReader();
int getData(char *data, int count);
tBufReader *nextreader;
HANDLE in_event_id;
};
class tCircularBuffer
{
public:
char *buffer;
long bufferSize;
long bufferStart, bufferEnd;
long nowInBuffer;
HANDLE in_event_id;
HANDLE out_event_id;
HANDLE hSemafor;
tBufReader *FirstReader;
__fastcall tCircularBuffer();
__fastcall tCircularBuffer(int bufsize);
__fastcall ~tCircularBuffer();
__fastcall initBuffer(int bufsize);
__fastcall clear();
__fastcall registerReader(tBufReader *R);
__fastcall unRegisterReader(tBufReader *R);
int insertData(char *data, int count);
int getData(char *data, int count);
int peekData(char *data, int count);
int advance(int count);
};
#endif