2
|
1 /* cirbuf.h
|
|
2 *
|
|
3 * Copyright (C) DFS Deutsche Flugsicherung (2004, 2005).
|
|
4 * All Rights Reserved.
|
|
5 *
|
|
6 * Circular Buffers
|
|
7 *
|
|
8 * Version 0.2
|
|
9 */
|
|
10 #ifndef _CIRBUF_H
|
|
11
|
|
12 // must be multiple of FRAGSIZE and FRAMESIZE
|
|
13 #define CIRBUFSIZE (WIDEB*2*80*8*2)
|
|
14
|
|
15 /* circular buffer for FRAGSIZE to FRAMESIZE conversion with
|
|
16 * overrun/underrun */
|
|
17 class CIRBUF {
|
|
18 char buf[CIRBUFSIZE]; // must be multiple of FRAGSIZE and FRAMESIZE
|
|
19 int in;
|
|
20 int out;
|
|
21 int len;
|
|
22
|
|
23 public:
|
|
24 CIRBUF();
|
|
25 void CIRBUF::init();
|
|
26 int CIRBUF::push(char *from, int size);
|
|
27 int CIRBUF::pop(char *to, int size);
|
|
28 int getlen() {
|
|
29 return len;
|
|
30 }
|
|
31 };
|
|
32
|
|
33 #define _CIRBUF_H
|
|
34 #endif
|