In‐core value‐semantic class that stores a bound delete function.

Synopsis

Declared in <bslma_managedptrdeleter.h>

class ManagedPtrDeleter;

Description

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.

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

Name

Description

Deleter

Deleter function prototype used to destroy the managed pointer.

Member Functions

Name

Description

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 deleter to the specified object, factory, and deleter.

Non-Member Functions

Name

Description

operator!=

Return true if the specified lhs and rhs do not have the same value.

operator==

Return true if the specified lhs and rhs have the same value.

Created with MrDocs