#pragma once
|
class CMyCircularBuf
|
{
|
public:
|
CMyCircularBuf();
|
~CMyCircularBuf();
|
CMyCircularBuf(int nCapicity);
|
CCriticalSection m_critial1;
|
int nmCapacity; //ÈÝÁ¿
|
char * pBuffer;
|
int WriteP;
|
int ReadP;
|
int nDataSize;
|
bool bIsEmpty;
|
bool bIsFull;
|
public:
|
int Alloc(int nCapicity);
|
int GetCapicity();
|
int GetNextWriteP(int nOffset);
|
int GetNextReadP(int nOffset);
|
int GetTailRoomSize();
|
int GetTailDataSize();
|
int GetLeftRoomSize();
|
int GetDataSize();
|
char * GetWriteBuffer(int * LeftRoomSize);
|
int ReleaseWriteBuffer(int AddSize);
|
char * GetReadBuffer(int * DataSize);
|
int ReleaseReadBuffer(int DelSize);
|
bool IsEmpty(){return bIsEmpty;}
|
bool IsFull(){return bIsFull;}
|
int PushIn(void * pData,int Size);
|
int CopyData(void *pData,int Size);
|
int DelData(int Size);
|
int PopOut(void * pData,int Size);
|
};
|