Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bdlma::Factory< TYPE > Class Template Reference

#include <bdlma_factory.h>

Inheritance diagram for bdlma::Factory< TYPE >:
bdlma::Deleter< TYPE > bdlcc::ObjectPool< TYPE, CREATOR, RESETTER >

List of all members.

Public Member Functions

virtual ~Factory ()
virtual TYPE * createObject ()=0
virtual void deleteObject (TYPE *instance)=0

Detailed Description

template<class TYPE>
class bdlma::Factory< TYPE >

This class provides a protocol (or pure interface) for a thread-safe object creator and deleter. It extends the Deleter protocol with the addition of a createObject method.

See Component bdlma_factory


Constructor & Destructor Documentation

template<class TYPE>
virtual bdlma::Factory< TYPE >::~Factory (  )  [virtual]

Destroy this object factory.


Member Function Documentation

template<class TYPE>
virtual TYPE* bdlma::Factory< TYPE >::createObject (  )  [pure virtual]

Create an instance of the specified TYPE using default arguments. Return the address of the newly-created object on success, and 0 otherwise. The instance must be destroyed using the deleteObject method of this object factory.

Implemented in bdlcc::ObjectPool< TYPE, CREATOR, RESETTER >, bdlcc::ObjectPool< MultiQueueThreadPool_Queue, bdlcc::ObjectPoolFunctors::DefaultCreator, bdlcc::ObjectPoolFunctors::Reset< MultiQueueThreadPool_Queue > >, and bdlcc::ObjectPool< RepType, ObjectPoolFunctors::DefaultCreator, ObjectPoolFunctors::Reset< RepType > >.

template<class TYPE>
virtual void bdlma::Factory< TYPE >::deleteObject ( TYPE *  instance  )  [pure virtual]

Destroy the specified instance based on its static type and return its memory footprint to the appropriate memory manager. The behavior is undefined unless instance was obtained from a call to createObject on this object factory and has not yet been deleted.

Implements bdlma::Deleter< TYPE >.

Implemented in bdlcc::ObjectPool< TYPE, CREATOR, RESETTER >, bdlcc::ObjectPool< MultiQueueThreadPool_Queue, bdlcc::ObjectPoolFunctors::DefaultCreator, bdlcc::ObjectPoolFunctors::Reset< MultiQueueThreadPool_Queue > >, and bdlcc::ObjectPool< RepType, ObjectPoolFunctors::DefaultCreator, ObjectPoolFunctors::Reset< RepType > >.


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