Quick Links: |
#include <bdlma_factory.h>
Public Member Functions | |
virtual | ~Factory () |
virtual TYPE * | createObject ()=0 |
virtual void | deleteObject (TYPE *instance)=0 |
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.
virtual bdlma::Factory< TYPE >::~Factory | ( | ) | [virtual] |
Destroy this object factory.
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 > >.
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 > >.