BloombergLP::bslma::ManagedPtrDeleter

This complex constrained in-core value-semantic class holds the information necessary for ManagedPtr to correctly manage its underlying object, namely the addresses of object and factory, and the deleter function, optionally supplied through the constructors or through the set method. This information is stored in a sub-structure to allow the compiler to copy it more efficiently.

Synopsis

Declared in <bslma_managedptrdeleter.h>

class ManagedPtrDeleter;

Description

See the for information on the class attributes. Note that the class invariants are identically the constraints on the individual attributes.

This class: * supports a complete set of value-semantic operations * is exception-safe * is alias-safe * is const thread-safe For terminology see bsldoc_glossary.

Type Aliases

NameDescription
Deleter Deleter function prototype used to destroy the managed pointer.

Member Functions

NameDescription
ManagedPtrDeleter [constructor]Constructors
clear Reset this ManagedPtrDeleter to its default-constructed state.
deleteManagedObject Invoke the deleter object. The behavior is undefined unless deleter is not 0 and has not already been called on the managed object associated with this deleter.
deleter Return the deleter function associated with this deleter.
factory Return a pointer to the factory instance associated with this deleter.
object Return a pointer to the managed object associated with this deleter.
set Set this ManagedPtrDeleter to refer to the object and factory instances located at the specified object and factory memory locations, and the specified deleter. The behavior is undefined unless deleter is either 0, or points to a function whose behavior is defined if called once with object and factory as arguments.

Non-Member Functions

NameDescription
operator!=Return true if the specified lhs and rhs objects do not have the same value, and false otherwise. Two ManagedPtrDeleter objects do not have the same value if any of the corresponding values of their object, factory, and deleter attributes are not the same.
operator==Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two ManagedPtrDeleter objects have the same value if the corresponding values of their object, factory, and deleter attributes are the same.