Type‐agnostic container for the internal state of a managed pointer.

Synopsis

Declared in <bslma_managedptr_members.h>

class ManagedPtr_Members;

Description

This class provides a type‐agnostic container for managed pointer data members. This type exists so that a ManagedPtr_Ref (see bslma_managedptr) can point to the representation of a ManagedPtr even if the ManagedPtr_Ref object is instantiated on a different type than the managed pointer type (e.g., in the case of conversions or aliasing). ManagedPtr_Members also "erases" the type of each member, so that the same object code can be shared between all instantiations of the ManagedPtr class template, reducing template bloat. Note that objects of this type have an "unset" state, where the pointer member has a null value and the deleter member has an unspecified value.

Member Functions

Name

Description

ManagedPtr_Members [constructor]

Constructors

clear

Reset this object to an unset state with no effect on the previously managed object (if any).

deleter

Return a reference to the deleter for the currently managed object.

move

Take ownership of the managed state from other.

moveAssign

Destroy the managed object and take ownership from other.

pointer

Return the address of the currently managed object, or 0 if unset.

runDeleter

Destroy the currently managed object (if any).

set

Reset this object to manage the specified object and deleter.

setAliasPtr

Set the exposed pointer to the specified alias.

swap

Efficiently exchange the state of this object with that of other.

Created with MrDocs