In‐place SharedPtrRep implementation for a managed object of TYPE.

Synopsis

Declared in <bslma_sharedptrinplacerep.h>

template<class TYPE>
class SharedPtrInplaceRep
    : public SharedPtrRep

Description

This class provides a concrete implementation of the SharedPtrRep protocol for "in‐place" instances of the parameterized TYPE. Upon destruction of this object, the destructor of TYPE is invoked.

Base Classes

Name

Description

SharedPtrRep

Partially implemented shared pointer representation protocol.

Member Functions

Name

Description

SharedPtrInplaceRep [constructor]

Create an in‐place representation constructed from args.

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]

Destroy the in‐place object managed by this representation.

disposeRep [virtual]

Deallocate the memory associated with this representation object.

getDeleter [virtual]

Return a null pointer; in‐place representations never store a deleter.

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 the (untyped) address of the modifiable (in‐place) object referred to by this representation object.

ptr

Return the address of the modifiable (in‐place) object referred to by this representation object.

releaseRef

Atomically release a shared reference to the shared object.

releaseWeakRef

Atomically release a weak reference to the shared 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