OSB_LIB::Asn1BufferCache Class Reference

Collaboration diagram for OSB_LIB::Asn1BufferCache:

Collaboration graph
[legend]
List of all members.

Detailed Description

Cache for Asn1Buffer.

Definition at line 65 of file asn1writer.h.

Public Member Functions

Private Types

Private Member Functions

Private Attributes

Friends


Member Typedef Documentation

typedef std::list<Asn1Buffer*> OSB_LIB::Asn1BufferCache::Buffers [private]

STL container for the buffers.

A std::set<Asn1Buffer*> would allow better control over the buffers in use.
However performance tests have shown that rebalancing of the set's tree after insert/erase is too expensive. (Old logic should be available in older versions of the file.)

Definition at line 75 of file asn1writer.h.


Constructor & Destructor Documentation

OSB_LIB::Asn1BufferCache::Asn1BufferCache (  ) 

Default constructor.

OSB_LIB::Asn1BufferCache::~Asn1BufferCache (  ) 

Destructor: deletes the buffers in the cache.

OSB_LIB::Asn1BufferCache::Asn1BufferCache ( const Asn1BufferCache  )  [private]

Prevent copying until needed: not implemented.


Member Function Documentation

Asn1Buffer* OSB_LIB::Asn1BufferCache::get (  )  [private]

Get a buffer from the cache.

Returns:
An Asn1Buffer, it has no content.
The buffer should be returned to the cache with put() if it is no more used.
Takes a buffer from pool_ (or creates a new buffer if the pool is empty) and returns it to the called.

Asn1BufferCache& OSB_LIB::Asn1BufferCache::operator= ( const Asn1BufferCache  )  [private]

Prevent assignment until needed: not implemented.

void OSB_LIB::Asn1BufferCache::put ( Asn1Buffer buf  )  [private]

Put a buffer to the cache.

Parameters:
buf Asn1Buffer to add, its data is cleared.


Friends And Related Function Documentation

friend class Asn1Buffer [friend]

Allow to use the cache: get() and put().

Definition at line 78 of file asn1writer.h.


Member Data Documentation

bool OSB_LIB::Asn1BufferCache::indtor_ [private]

Flag if the destructor was invoked.

Definition at line 113 of file asn1writer.h.

Buffers OSB_LIB::Asn1BufferCache::pool_ [private]

List of available Asn1Buffer.

Definition at line 115 of file asn1writer.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:09:18 2006 for OSB Library by  doxygen 1.4.7