8 #ifndef MBase_SimpleBuffer_h 9 #define MBase_SimpleBuffer_h 19 class SimpleBuffer :
public Buffer
25 for(
size_t i=0; i<mBuffer.size(); ++i)
26 delete [] mBuffer[i].first;
33 virtual bool Reserve(
size_t iSize) {
return false; }
39 unsigned char* lBuffer =
new unsigned char[iSize];
40 mBuffer.push_back(
MemBlock(lBuffer, iSize));
65 typedef std::pair<unsigned char*, int>
MemBlock;
66 typedef std::vector<MemBlock>
MemVec;
68 for(
size_t i=0; i<mBuffer.size(); ++i)
69 delete [] mBuffer[i].first;
77 #endif // MBase_BufferImplementation_h virtual unsigned Int32 GetAllocMemSize() const
Definition: SimpleBuffer.h:48
SimpleBuffer()
Definition: SimpleBuffer.h:22
std::vector< MemBlock > MemVec
Definition: SimpleBuffer.h:66
virtual bool Reserve(size_t iSize)
Definition: SimpleBuffer.h:33
virtual unsigned Int64 GetAllocMemSizeInBytes() const
Definition: SimpleBuffer.h:52
#define Int64
Definition: BasicTypes.h:36
~SimpleBuffer()
Definition: SimpleBuffer.h:67
#define Int32
Definition: BasicTypes.h:20
std::pair< unsigned char *, int > MemBlock
Definition: ReportServiceCore/Classes/common/SimpleBuffer.h:65
Definition: Allocator.h:47
virtual void WriteLock()
Definition: SimpleBuffer.h:58
virtual void Delete()
Definition: SimpleBuffer.h:24
virtual void SetTotalAllocatedSpaceLimit(Int64 iLimit)
Definition: SimpleBuffer.h:63
virtual unsigned Int32 GetTotalMemSize() const
Definition: SimpleBuffer.h:45
virtual unsigned Int64 GetTotalMemSizeInBytes() const
Definition: SimpleBuffer.h:51
virtual void * GetMem(size_t iSize)
Definition: SimpleBuffer.h:38