The C++ framework for developing highly scalable, high performance servers on Windows platforms.

IAllocateBuffers Class Reference
[InterfacesOpaque user dataI/O BuffersProtected destructors on abstract base classes]

Inheritance diagram for IAllocateBuffers:
Collaboration diagram for IAllocateBuffers:

List of all members.


Detailed Description

An interface to a class that allocates instances of IBuffer of a fixed size. Each instance of IBuffer has opaque user data associated with it and so this allocator derives from IProvideUserData to allow the user to request user data "slots" from the allocator; you must request all of your slots before calling Allocate() for the first time.

Public Types

typedef
IBuffer::BufferSize 
BufferSize

Public Member Functions

CSmartBuffer Allocate () override=0
 Allocate an instance of IBuffer, remember to call Release() on it when you're done with it.
CSmartBuffer AllocateCustomSizedBuffer (BufferSize bufferSize) override=0
 Creates a buffer that is a specific size rather than the size that the allocator usually creates. These buffers are currently NOT pooled and are deleted when the last reference is released.
virtual void AllocateBuffers (size_t numBuffers, CBufferChain &buffers)=0
virtual void AllocateBuffersForBytes (size_t numBytes, CBufferChain &buffers)=0
virtual BufferSize GetBufferSize () const =0
 Returns the size of the buffers that are allocated by this allocator.
virtual bool Flush ()=0
 Flushes the allocator. Use with care as this forces active buffers to be released and destroyed! Generally only called as part of process cleanup and even then only to aid in buffer leak tracking.
virtual
IIndexedOpaqueUserData::UserDataIndex 
RequestUserDataSlot (const _tstring &name)=0
 Request a named user data slot and get an index to use in calls to methods on IIndexedOpaqueUserData.
virtual
IIndexedOpaqueUserData::UserDataIndex 
LockUserDataSlots ()=0
 Prevent more user data slots from being allocated. Returns the number of user data slots that have been allocated.

Static Public Attributes

static const
JetByteTools::Core::IIndexedOpaqueUserData::UserDataIndex 
DefaultBufferChainIndex = 0
static const
JetByteTools::Core::IIndexedOpaqueUserData::UserDataIndex 
NumberOfDefaultUserDataSlots = 1

Protected Member Functions

 ~IAllocateBuffers () override
 We never delete instances of this interface; you must manage the lifetime of the class that implements it.

Static Protected Member Functions

static void AllocateDefaultUserDataIndices (JetByteTools::Core::IProvideUserData &dataProvider)

Member Typedef Documentation

typedef IBuffer::BufferSize BufferSize


Constructor & Destructor Documentation

~IAllocateBuffers (  )  [override, protected]

We never delete instances of this interface; you must manage the lifetime of the class that implements it.


Member Function Documentation

CSmartBuffer Allocate (  )  [override, pure virtual]

Allocate an instance of IBuffer, remember to call Release() on it when you're done with it.

Implements IAllocateBuffer.

Implemented in CBufferAllocator, and CBufferBasedBufferAllocator.

CSmartBuffer AllocateCustomSizedBuffer ( BufferSize  bufferSize  )  [override, pure virtual]

Creates a buffer that is a specific size rather than the size that the allocator usually creates. These buffers are currently NOT pooled and are deleted when the last reference is released.

Implements IAllocateBuffer.

virtual void AllocateBuffers ( size_t  numBuffers,
CBufferChain buffers 
) [pure virtual]

virtual void AllocateBuffersForBytes ( size_t  numBytes,
CBufferChain buffers 
) [pure virtual]

virtual BufferSize GetBufferSize (  )  const [pure virtual]

Returns the size of the buffers that are allocated by this allocator.

Implemented in CBufferAllocator, and CBufferBasedBufferAllocator.

virtual bool Flush (  )  [pure virtual]

Flushes the allocator. Use with care as this forces active buffers to be released and destroyed! Generally only called as part of process cleanup and even then only to aid in buffer leak tracking.

Implemented in CBufferAllocator, and CBufferBasedBufferAllocator.

static void AllocateDefaultUserDataIndices ( JetByteTools::Core::IProvideUserData dataProvider  )  [static, protected]


Member Data Documentation


Generated on Sun Sep 12 19:09:26 2021 for The Server Framework - v7.4 by doxygen 1.5.3