Public Types | |
typedef unsigned long | BufferCount |
Public Member Functions | |
CBufferHandleAllocator (BufferCount maxFreeBuffers, IAllocateBuffers &bufferAllocator) | |
Create an allocator for buffer handles and keep up to maxFreeBuffers in a pool for reuse. Use the supplied buffer allocator if a handle ever needs to be converted to a proper buffer. | |
CBufferHandleAllocator (IMonitorBufferAllocation &monitor, BufferCount maxFreeBuffers, IAllocateBuffers &bufferAllocator) | |
Create an allocator for buffer handles and keep up to maxFreeBuffers in a pool for reuse. Provide monitoring information via the supplied instance of the IMonitorBufferAllocation interface. Use the supplied buffer allocator if a handle ever needs to be converted to a proper buffer. | |
CBufferHandleAllocator (const CBufferHandleAllocator &rhs) | |
~CBufferHandleAllocator () override | |
CBufferHandleAllocator & | operator= (const CBufferHandleAllocator &rhs) |
BufferCount | EnlargePool (BufferCount buffersToAdd) |
Add buffersToAdd buffer handles to the pool. | |
CBufferHandle * | AllocateHandle () override |
Allocate a CBufferHandle, remember to call Release() on it when you're done with it. | |
IBuffer::BufferSize | GetBufferSize () const override |
CSmartBuffer | Allocate () override |
Allocate an instance of IBuffer, remember to call Release() on it when you're done with it. | |
CSmartBuffer | AllocateCustomSizedBuffer (IBuffer::BufferSize bufferSize) override |
CSmartBuffer | Allocate (const IBuffer &buffer) override |
Allocate a CBufferHandle and attach the supplied IBuffer to it, return the CBufferHandle's IBuffer interface, remember to call Release() on it when you're done with it. | |
bool | Flush () override |
Flushes the allocator. Use with care as this forces active buffer handles to be released and destroyed! Generally only called as part of process cleanup and even then only to aid in buffer leak tracking. |
typedef unsigned long BufferCount |
CBufferHandleAllocator | ( | BufferCount | maxFreeBuffers, | |
IAllocateBuffers & | bufferAllocator | |||
) |
Create an allocator for buffer handles and keep up to maxFreeBuffers in a pool for reuse. Use the supplied buffer allocator if a handle ever needs to be converted to a proper buffer.
CBufferHandleAllocator | ( | IMonitorBufferAllocation & | monitor, | |
BufferCount | maxFreeBuffers, | |||
IAllocateBuffers & | bufferAllocator | |||
) |
Create an allocator for buffer handles and keep up to maxFreeBuffers in a pool for reuse. Provide monitoring information via the supplied instance of the IMonitorBufferAllocation interface. Use the supplied buffer allocator if a handle ever needs to be converted to a proper buffer.
CBufferHandleAllocator | ( | const CBufferHandleAllocator & | rhs | ) |
~CBufferHandleAllocator | ( | ) | [override] |
Reimplemented in CBufferHandleAllocator.
CBufferHandleAllocator& operator= | ( | const CBufferHandleAllocator & | rhs | ) |
CBufferHandleAllocator::BufferCount EnlargePool | ( | BufferCount | buffersToAdd | ) |
Add buffersToAdd buffer handles to the pool.
CBufferHandle * AllocateHandle | ( | ) | [override, virtual] |
Allocate a CBufferHandle, remember to call Release() on it when you're done with it.
Implements IAllocateBufferHandles.
IBuffer::BufferSize GetBufferSize | ( | ) | const [override, virtual] |
Implements IManageBufferLifeCycle.
CSmartBuffer Allocate | ( | ) | [override, virtual] |
Allocate an instance of IBuffer, remember to call Release() on it when you're done with it.
Implements IManageBufferLifeCycle.
CSmartBuffer AllocateCustomSizedBuffer | ( | IBuffer::BufferSize | bufferSize | ) | [override, virtual] |
Implements IManageBufferLifeCycle.
CSmartBuffer Allocate | ( | const IBuffer & | buffer | ) | [override, virtual] |
Allocate a CBufferHandle and attach the supplied IBuffer to it, return the CBufferHandle's IBuffer interface, remember to call Release() on it when you're done with it.
Implements IAllocateBufferHandles.
bool Flush | ( | ) | [override, virtual] |
Flushes the allocator. Use with care as this forces active buffer handles to be released and destroyed! Generally only called as part of process cleanup and even then only to aid in buffer leak tracking.
Implements IAllocateBufferHandles.