Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bslma::ManagedPtr_Ref< TARGET_TYPE > Class Template Reference

#include <bslma_managedptr.h>

List of all members.

Public Member Functions

 ManagedPtr_Ref (ManagedPtr_Members *base, TARGET_TYPE *target)
 ManagedPtr_Ref (const ManagedPtr_Ref &original)
 ~ManagedPtr_Ref ()
ManagedPtr_Refoperator= (const ManagedPtr_Ref &original)
ManagedPtr_Membersbase () const
TARGET_TYPE * target () const

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 Component bslma_managedptr


Constructor & Destructor Documentation

template<class TARGET_TYPE>
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.

template<class TARGET_TYPE>
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.

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

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


Member Function Documentation

template<class TARGET_TYPE>
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.

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

Return a pointer to the managed state of a ManagedPtr object.

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

Return a pointer to the referenced object.


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