Quick Links: |
#include <bslma_managedptr.h>
Public Member Functions | |
ManagedPtr_Ref (ManagedPtr_Members *base, TARGET_TYPE *target) | |
ManagedPtr_Ref (const ManagedPtr_Ref &original) | |
~ManagedPtr_Ref () | |
ManagedPtr_Ref & | operator= (const ManagedPtr_Ref &original) |
ManagedPtr_Members * | base () const |
TARGET_TYPE * | target () const |
This class holds a managed pointer reference, returned by the implicit conversion operator in the class ManagedPtr
. This class is used to allow the construction of managed pointers from temporary managed pointer objects, since temporaries cannot bind to the reference to a modifiable object used in the copy constructor and copy-assignment operator for ManagedPtr
. Note that while no members or methods of this class template depend on the specified TARGET_TYPE
, it is important to carry this type into conversions to support passing ownership of ManagedPtr_Members
pointers when assigning or constructing ManagedPtr
objects.
See Component bslma_managedptr
bslma::ManagedPtr_Ref< TARGET_TYPE >::ManagedPtr_Ref | ( | ManagedPtr_Members * | base, | |
TARGET_TYPE * | target | |||
) |
Create a ManagedPtr_Ref
object having the specified base
value for its base
attribute, and the specified target
for its target
attribute. Note that target
(but not base
) may be null.
bslma::ManagedPtr_Ref< TARGET_TYPE >::ManagedPtr_Ref | ( | const ManagedPtr_Ref< TARGET_TYPE > & | original | ) |
Create a ManagedPtr_Ref
object having the same d_base_p
value as the specified original
. Note that this trivial constructor's definition is compiler generated.
bslma::ManagedPtr_Ref< TARGET_TYPE >::~ManagedPtr_Ref | ( | ) |
Destroy this object. Note that the referenced managed object is not destroyed.
ManagedPtr_Ref& bslma::ManagedPtr_Ref< TARGET_TYPE >::operator= | ( | const ManagedPtr_Ref< TARGET_TYPE > & | original | ) |
Create a ManagedPtr_Ref
object having the same d_base_p
as the specified original
. Note that this trivial copy-assignment operator's definition is compiler generated.
ManagedPtr_Members* bslma::ManagedPtr_Ref< TARGET_TYPE >::base | ( | ) | const |
Return a pointer to the managed state of a ManagedPtr
object.
TARGET_TYPE* bslma::ManagedPtr_Ref< TARGET_TYPE >::target | ( | ) | const |
Return a pointer to the referenced object.