BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlbb::PooledBlobBufferFactory Class Reference

#include <bdlbb_pooledblobbufferfactory.h>

Inheritance diagram for bdlbb::PooledBlobBufferFactory:
bdlbb::BlobBufferFactory

Public Member Functions

 PooledBlobBufferFactory (int bufferSize, bslma::Allocator *basicAllocator=0)
 
 PooledBlobBufferFactory (int bufferSize, bsls::BlockGrowth::Strategy growthStrategy, bslma::Allocator *basicAllocator=0)
 
 PooledBlobBufferFactory (int bufferSize, bsls::BlockGrowth::Strategy growthStrategy, int maxBlocksPerChunk, bslma::Allocator *basicAllocator=0)
 
 ~PooledBlobBufferFactory () BSLS_KEYWORD_OVERRIDE
 
void allocate (BlobBuffer *buffer) BSLS_KEYWORD_OVERRIDE
 
int bufferSize () const
 Return the buffer size specified at construction of this factory.
 
- Public Member Functions inherited from bdlbb::BlobBufferFactory
virtual ~BlobBufferFactory ()
 Destroy this blob buffer factory.
 

Detailed Description

This class implements the BlobBufferFactory protocol and provides a mechanism for allocating BlobBuffer objects of a fixed size passed at construction.

See bdlbb_pooledblobbufferfactory

Constructor & Destructor Documentation

◆ PooledBlobBufferFactory() [1/3]

bdlbb::PooledBlobBufferFactory::PooledBlobBufferFactory ( int  bufferSize,
bslma::Allocator basicAllocator = 0 
)

◆ PooledBlobBufferFactory() [2/3]

bdlbb::PooledBlobBufferFactory::PooledBlobBufferFactory ( int  bufferSize,
bsls::BlockGrowth::Strategy  growthStrategy,
bslma::Allocator basicAllocator = 0 
)

◆ PooledBlobBufferFactory() [3/3]

bdlbb::PooledBlobBufferFactory::PooledBlobBufferFactory ( int  bufferSize,
bsls::BlockGrowth::Strategy  growthStrategy,
int  maxBlocksPerChunk,
bslma::Allocator basicAllocator = 0 
)

Create a pooled factory for allocating BlobBuffer objects of the specified bufferSize. Optionally specify a growthStrategy used to control the growth of internal memory chunks (from which memory blocks are dispensed). If growthStrategy is not specified, geometric growth is used. If growthStrategy is specified, optionally specify a maxBlocksPerChunk, indicating the maximum number of blocks to be allocated at once when the underlying pool must be replenished. If maxBlocksPerChunk is not specified, an implementation-defined value is used. If geometric growth is used, the chunk size grows starting at the value returned by blockSize, doubling in size until the size is exactly blockSize() * maxBlocksPerChunk. If constant growth is used, the chunk size is always maxBlocksPerChunk. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 < bufferSize, and 1 <= maxBlocksPerChunk.

◆ ~PooledBlobBufferFactory()

bdlbb::PooledBlobBufferFactory::~PooledBlobBufferFactory ( )

Destroy this factory. This operation releases all BlobBuffer objects allocated via this factory.

Member Function Documentation

◆ allocate()

void bdlbb::PooledBlobBufferFactory::allocate ( BlobBuffer buffer)
virtual

Allocate a new buffer with the buffer size specified at construction and load it into the specified buffer. Note that destruction of the bdlbb::PooledBlobBufferFactory object releases all BlobBuffer objects allocated via this factory.

Implements bdlbb::BlobBufferFactory.

◆ bufferSize()

int bdlbb::PooledBlobBufferFactory::bufferSize ( ) const
inline

The documentation for this class was generated from the following file: