BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslma::ManagedPtr_Ref< TARGET_TYPE > Class Template Reference

#include <bslma_managedptr.h>

Public Member Functions

 ManagedPtr_Ref (ManagedPtr_Members *base, TARGET_TYPE *target)
 
 ManagedPtr_Ref (const ManagedPtr_Ref &original)=default
 
 ~ManagedPtr_Ref ()
 
ManagedPtr_Refoperator= (const ManagedPtr_Ref &original)=default
 
ManagedPtr_Membersbase () const
 Return a pointer to the managed state of a ManagedPtr object.
 
TARGET_TYPE * target () const
 Return a pointer to the referenced object.
 

Detailed Description

template<class TARGET_TYPE>
class bslma::ManagedPtr_Ref< TARGET_TYPE >

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 bslma_managedptr

Constructor & Destructor Documentation

◆ ManagedPtr_Ref() [1/2]

template<class TARGET_TYPE >
bslma::ManagedPtr_Ref< TARGET_TYPE >::ManagedPtr_Ref ( ManagedPtr_Members base,
TARGET_TYPE *  target 
)
inline

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.

◆ ManagedPtr_Ref() [2/2]

template<class TARGET_TYPE >
bslma::ManagedPtr_Ref< TARGET_TYPE >::ManagedPtr_Ref ( const ManagedPtr_Ref< TARGET_TYPE > &  original)
default

◆ ~ManagedPtr_Ref()

template<class TARGET_TYPE >
bslma::ManagedPtr_Ref< TARGET_TYPE >::~ManagedPtr_Ref ( )
inline

Destroy this object. Note that the referenced managed object is not destroyed.

Member Function Documentation

◆ base()

template<class TARGET_TYPE >
ManagedPtr_Members * bslma::ManagedPtr_Ref< TARGET_TYPE >::base ( ) const
inline

◆ operator=()

template<class TARGET_TYPE >
ManagedPtr_Ref & bslma::ManagedPtr_Ref< TARGET_TYPE >::operator= ( const ManagedPtr_Ref< TARGET_TYPE > &  original)
default

◆ target()

template<class TARGET_TYPE >
TARGET_TYPE * bslma::ManagedPtr_Ref< TARGET_TYPE >::target ( ) const
inline

The documentation for this class was generated from the following file: