|
BDE 4.39.x Production Release
|
#include <bslma_managedptrdeleter.h>
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 Attributes for information on the class attributes.
This class:
const thread-safe For terminology see bsldoc_glossary .Public Types | |
| typedef void(* | Deleter) (void *managedObject, void *cookie) |
Public Member Functions | |
| ManagedPtrDeleter () | |
| ManagedPtrDeleter (void *object, void *factory, Deleter deleter) | |
| ManagedPtrDeleter (const ManagedPtrDeleter &original) | |
| ~ManagedPtrDeleter ()=default | |
| ManagedPtrDeleter & | operator= (const ManagedPtrDeleter &rhs) |
| void | clear () |
| void | set (void *object, void *factory, Deleter deleter) |
| void | deleteManagedObject () const |
| Deleter | deleter () const |
| void * | factory () const |
| void * | object () const |
| typedef void(* bslma::ManagedPtrDeleter::Deleter) (void *managedObject, void *cookie) |
Deleter function prototype used to destroy the managed pointer.
|
inline |
Create a default ManagedPtrDeleter object that does not refer to any object or factory instance.
|
inline |
Create a ManagedPtrDeleter object that refers to the object and factory instances located at the specified object and factory memory locations, and the specified deleter.
deleter is either 0, or points to a function whose behavior is defined if called once with object and factory as arguments. | bslma::ManagedPtrDeleter::ManagedPtrDeleter | ( | const ManagedPtrDeleter & | original | ) |
Create a ManagedPtrDeleter object having the same value as the specified original object.
|
default |
Destroy this object.
|
inline |
Reset this ManagedPtrDeleter to its default-constructed state.
|
inline |
Invoke the deleter object.
deleter is not 0 and has not already been called on the managed object associated with this deleter.
|
inline |
Return the deleter function associated with this deleter.
|
inline |
Return a pointer to the factory instance associated with this deleter.
|
inline |
Return a pointer to the managed object associated with this deleter.
| ManagedPtrDeleter & bslma::ManagedPtrDeleter::operator= | ( | const ManagedPtrDeleter & | rhs | ) |
Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.
|
inline |
Set this ManagedPtrDeleter to refer to the object and factory instances located at the specified object and factory memory locations, and the specified deleter.
deleter is either 0, or points to a function whose behavior is defined if called once with object and factory as arguments.