Panda3D
ringbuffer_slide.h
1 #ifndef __RINGBUFFER_GM_H__
2 #define __RINGBUFFER_GM_H__
3 ////////////////////////////////////////////
4 
5 // RHH
6 ////////////////////////////////////////////////////////////////////
7 // Class : GmRingBuffer
8 // Description : This is an implemention of the membuffer with ring
9 // buffer interface on it....
10 //
11 // Main target right know is base class for network
12 // stream buffering both input and output
13 //
14 // see BufferedReader_Gm
15 // BufferedWriter_Gm
16 //
17 ////////////////////////////////////////////////////////////////////
18 #include "membuffer.h"
19 class RingBuffer_Slide : protected MemBuffer
20 {
21 protected:
22  size_t _StartPos;
23  size_t _EndPos;
24  inline char * GetMessageHead(void);
25  inline char * GetBufferOpen(void);
26  inline void ForceWindowSlide(void);
27 #define FastGetMessageHead() (_Buffer+_StartPos)
28 #define FastAmountBeffered() (_EndPos - _StartPos)
29 
30 inline bool PutFast(const char * data, size_t len);
31 
32 public:
33  inline size_t AmountBuffered(void);
34  inline size_t BufferAvailabe(void);
35  inline void ResetContent(void);
36 
37  inline RingBuffer_Slide(size_t in_size = 4096);
38  inline void FullCompress(void);
39  inline void Compress(void);
40  inline bool Put(const char * data, size_t len);
41  inline bool Get(char * data, size_t len);
42 };
43 
44 #include "ringbuffer_slide.i"
45 
46 #endif //__RINGBUFFER_GM_H__
47 
48 
this a base class designed to be used to for items that will share portions of a memorty buufer and w...
Definition: membuffer.h:17
This is an implemention of the membuffer with ring buffer interface on it....