OSDN Git Service

[COMMON] Add pair16_t and pair64_t.
[csp-qt/common_source_project-fm7.git] / source / src / fifo.h
1 /*
2         Skelton for retropc emulator
3
4         Author : Takeda.Toshiya
5         Date   : 2006.09.17-
6
7         [ fifo buffer ]
8 */
9
10 #ifndef _FIFO_H_
11 #define _FIFO_H_
12
13 #include "common.h"
14
15 class csp_state_data_saver;
16 class DLL_PREFIX FIFO
17 {
18 private:
19         int size;
20         int* buf;
21         int cnt, rpt, wpt;
22
23         const _TCHAR *_ns = "FIFO::BEGIN";
24         const _TCHAR *_ne = "FIFO::END";
25 public:
26         FIFO(int s);
27         void release();
28         void clear();
29         void write(int val);
30         int read();
31         int read_not_remove(int pt);
32         void write_not_push(int pt, int d);
33         int count();
34         bool full();
35         bool empty();
36         void save_state(void *f);
37         bool load_state(void *f);
38
39         void save_state_helper(csp_state_data_saver *state_saver, uint32_t *sumseed, bool *__stat);
40         bool load_state_helper(csp_state_data_saver *state_saver, uint32_t *sumseed, bool *__stat);
41         
42 };
43
44 #endif
45