Shared pointer representation object used by SharedObjectPool.

Synopsis

Declared in <bdlcc_sharedobjectpool.h>

template<
    class TYPE,
    class RESETTER>
class SharedObjectPool_Rep
    : public bslma::SharedPtrRep

Base Classes

Name

Description

bslma::SharedPtrRep

Partially implemented shared pointer representation protocol.

Member Functions

Name

Description

SharedObjectPool_Rep [constructor]

Construct a new representation that embeds a TYPE object.

~SharedObjectPool_Rep [destructor] [virtual]

Destroy this representation object and the embedded instance of TYPE.

acquireRef

Atomically acquire a shared reference to the shared object referred to by this representation. The behavior is undefined unless 0 < numReferences().

acquireWeakRef

Atomically acquire a weak reference to the shared object.

disposeObject [virtual]

Release the object managed by this representation.

disposeRep [virtual]

Release this representation object back to its pool.

getDeleter [virtual]

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

hasUniqueOwner

Return true if there is only one shared reference and no weak references to the object referred to by this representation, and false otherwise.

incrementRefs

Atomically increment the number of shared references.

numReferences

Return a "snapshot" of the current number of shared references to the shared object referred to by this representation object.

numWeakReferences

Return a "snapshot" of the current number of weak references to the shared object referred to by this representation object.

originalPtr [virtual]

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

ptr

Return a pointer to the in‐place object.

releaseRef

Atomically release a shared reference to the shared object.

releaseWeakRef

Atomically release a weak reference to the shared object.

reset

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

resetCountsRaw

Reset the shared and weak reference counts to the specified values.

tryAcquireRef

Try to atomically acquire a shared reference to the shared object.

Static Member Functions

Name

Description

managedPtrDeleter

Release the shared reference held by the specified representation.

managedPtrEmptyDeleter

Deleter that has no effect when converting a null shared pointer.

Created with MrDocs