BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlma::Factory< TYPE > Class Template Referenceabstract

#include <bdlma_factory.h>

Inheritance diagram for bdlma::Factory< TYPE >:
bdlma::Deleter< TYPE > bdlcc::ObjectPool< RepType, ObjectPoolFunctors::DefaultCreator, ObjectPoolFunctors::Reset< RepType > > bdlcc::ObjectPool< bdlmt::MultiQueueThreadPool_Queue, bsl::function, bdlcc::ObjectPoolFunctors::Reset< bdlmt::MultiQueueThreadPool_Queue > > bdlcc::ObjectPool< TYPE, CREATOR, RESETTER >

Public Member Functions

virtual ~Factory ()
 Destroy this object factory.
 
virtual TYPE * createObject ()=0
 
virtual void deleteObject (TYPE *instance)=0
 
- Public Member Functions inherited from bdlma::Deleter< TYPE >
virtual ~Deleter ()
 Destroy this object deleter.
 

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 bdlma_factory

Constructor & Destructor Documentation

◆ ~Factory()

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

Member Function Documentation

◆ createObject()

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< bdlmt::MultiQueueThreadPool_Queue, bsl::function, bdlcc::ObjectPoolFunctors::Reset< bdlmt::MultiQueueThreadPool_Queue > >, and bdlcc::ObjectPool< RepType, ObjectPoolFunctors::DefaultCreator, ObjectPoolFunctors::Reset< RepType > >.

◆ deleteObject()

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< bdlmt::MultiQueueThreadPool_Queue, bsl::function, bdlcc::ObjectPoolFunctors::Reset< bdlmt::MultiQueueThreadPool_Queue > >, bdlcc::ObjectPool< RepType, ObjectPoolFunctors::DefaultCreator, ObjectPoolFunctors::Reset< RepType > >, and bdlcc::ObjectPool< TYPE, CREATOR, RESETTER >.


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