BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlcc::SharedObjectPool_Rep< TYPE, RESETTER > Class Template Reference

#include <bdlcc_sharedobjectpool.h>

Inheritance diagram for bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >:
bslma::SharedPtrRep

Public Member Functions

template<class CREATOR >
 SharedObjectPool_Rep (CREATOR *objectCreator, const bslalg::ConstructorProxy< RESETTER > &objectResetter, PoolType *pool, bslma::Allocator *basicAllocator)
 
 ~SharedObjectPool_Rep () BSLS_KEYWORD_OVERRIDE
 
void disposeRep () BSLS_KEYWORD_OVERRIDE
 
void disposeObject () BSLS_KEYWORD_OVERRIDE
 
void reset ()
 
void * getDeleter (const std::type_info &type) BSLS_KEYWORD_OVERRIDE
 
void * originalPtr () const BSLS_KEYWORD_OVERRIDE
 
TYPE * ptr ()
 Return a pointer to the in-place object.
 
- Public Member Functions inherited from bslma::SharedPtrRep
 SharedPtrRep ()
 
void acquireRef ()
 
void acquireWeakRef ()
 
void incrementRefs (int incrementAmount=1)
 
void releaseRef ()
 
void releaseWeakRef ()
 
void resetCountsRaw (int numSharedReferences, int numWeakReferences)
 
bool tryAcquireRef ()
 
bool hasUniqueOwner () const
 
int numReferences () const
 
int numWeakReferences () const
 

Additional Inherited Members

- Static Public Member Functions inherited from bslma::SharedPtrRep
static void managedPtrDeleter (void *, void *rep)
 
static void managedPtrEmptyDeleter (void *, void *rep)
 
- Protected Member Functions inherited from bslma::SharedPtrRep
virtual ~SharedPtrRep ()
 

Constructor & Destructor Documentation

◆ SharedObjectPool_Rep()

template<class TYPE , class RESETTER >
template<class CREATOR >
bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::SharedObjectPool_Rep ( CREATOR *  objectCreator,
const bslalg::ConstructorProxy< RESETTER > &  objectResetter,
PoolType pool,
bslma::Allocator basicAllocator 
)
inline

Construct a new rep object that, upon release, will invoke the specified objectResetter and return itself to the specified pool; then invoke objectCreator to construct an object of TYPE embedded within the new rep object. Use the specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~SharedObjectPool_Rep()

template<class TYPE , class RESETTER >
bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::~SharedObjectPool_Rep ( )
inline

Destroy this representation object and the embedded instance of TYPE.

Member Function Documentation

◆ disposeObject()

template<class TYPE , class RESETTER >
void bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::disposeObject ( )
inlinevirtual

Release the object being managed by this representation. This method is invoked when the number of strong references reaches zero. Note that if there are any weak references to the shared object then this function does nothing, including not destroying the object or returning it to the pool.

Implements bslma::SharedPtrRep.

◆ disposeRep()

template<class TYPE , class RESETTER >
void bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::disposeRep ( )
inlinevirtual

Release this representation object. This method is invoked when the number of weak references and the number of strong references reach zero. This virtual override will return the object, and this representation, to the associated pool.

Implements bslma::SharedPtrRep.

◆ getDeleter()

template<class TYPE , class RESETTER >
void * bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::getDeleter ( const std::type_info &  type)
inlinevirtual

Return NULL. Shared object pools strictly control the delete policy for their objects, and do not expose it to end users.

Implements bslma::SharedPtrRep.

◆ originalPtr()

template<class TYPE , class RESETTER >
void * bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::originalPtr ( ) const
inlinevirtual

Return (untyped) address of the object managed by this representation. This virtual override effectively returns "(void*)ptr()".

Implements bslma::SharedPtrRep.

◆ ptr()

template<class TYPE , class RESETTER >
TYPE * bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::ptr ( )
inline

◆ reset()

template<class TYPE , class RESETTER >
void bdlcc::SharedObjectPool_Rep< TYPE, RESETTER >::reset ( )
inline

Invoke the object resetter specified at construction on the associated object.


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