STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Concurrency::details::_Reference_counted_obj_ptr< T > Class Template Reference

#include <amprt.h>

Public Member Functions

 _Reference_counted_obj_ptr (T *_Ptr=NULL)
 
 _Reference_counted_obj_ptr (const _Reference_counted_obj_ptr &_Other)
 
 _Reference_counted_obj_ptr (_Reference_counted_obj_ptr &&_Other)
 
 ~_Reference_counted_obj_ptr ()
 
_Reference_counted_obj_ptroperator= (const _Reference_counted_obj_ptr &_Other)
 
_Reference_counted_obj_ptroperator= (_Reference_counted_obj_ptr &&_Other)
 
_Ret_ T * operator-> () const
 
T & operator* () const
 
 operator T * () const
 
_Ret_ T * _Get_ptr () const
 

Private Member Functions

void _Init ()
 

Static Private Member Functions

static void _UnInitialize (_In_ T *_Obj_ptr)
 

Private Attributes

T * _M_obj_ptr
 

Constructor & Destructor Documentation

173  : _M_obj_ptr(_Ptr)
174  {
175  _Init();
176  }
179  : _M_obj_ptr(_Other._M_obj_ptr)
180  {
181  _Init();
182  }
185  : _M_obj_ptr(_Other._M_obj_ptr)
186  {
187  _Other._M_obj_ptr = nullptr;
188  // No change to ref-count
189  }
193  {
194  if (_M_obj_ptr != NULL) {
196  }
197  }
static void _UnInitialize(_In_ T *_Obj_ptr)
Definition: amprt.h:264
#define NULL
Definition: corecrt.h:158

Member Function Documentation

template<class T>
_Ret_ T* Concurrency::details::_Reference_counted_obj_ptr< T >::_Get_ptr ( ) const
inline
249  {
250  return _M_obj_ptr;
251  }
template<class T>
void Concurrency::details::_Reference_counted_obj_ptr< T >::_Init ( )
inlineprivate
257  {
258  if (_M_obj_ptr == NULL)
259  return;
260 
261  reinterpret_cast<_Reference_counter*>(_M_obj_ptr)->_Add_reference();
262  }
Definition: type_traits:160
#define NULL
Definition: corecrt.h:158
template<class T>
static void Concurrency::details::_Reference_counted_obj_ptr< T >::_UnInitialize ( _In_ T *  _Obj_ptr)
inlinestaticprivate
265  {
266  reinterpret_cast<_Reference_counter*>(_Obj_ptr)->_Remove_reference();
267  }
template<class T>
Concurrency::details::_Reference_counted_obj_ptr< T >::operator T * ( ) const
inline
244  {
245  return _M_obj_ptr;
246  }
template<class T>
T& Concurrency::details::_Reference_counted_obj_ptr< T >::operator* ( ) const
inline
239  {
240  return *_M_obj_ptr;
241  }
template<class T>
_Ret_ T* Concurrency::details::_Reference_counted_obj_ptr< T >::operator-> ( ) const
inline
234  {
235  return _M_obj_ptr;
236  }
template<class T>
_Reference_counted_obj_ptr& Concurrency::details::_Reference_counted_obj_ptr< T >::operator= ( const _Reference_counted_obj_ptr< T > &  _Other)
inline
201  {
202  if (_M_obj_ptr != _Other._M_obj_ptr)
203  {
204  T *oldPtr = _M_obj_ptr;
205  _M_obj_ptr = _Other._M_obj_ptr;
206  _Init();
207 
208  if (oldPtr != NULL) {
209  _UnInitialize(oldPtr);
210  }
211  }
212  return *this;
213  }
static void _UnInitialize(_In_ T *_Obj_ptr)
Definition: amprt.h:264
#define NULL
Definition: corecrt.h:158
217  {
218  if (_M_obj_ptr != _Other._M_obj_ptr)
219  {
220  T *oldPtr = _M_obj_ptr;
221  _M_obj_ptr = _Other._M_obj_ptr;
222  _Other._M_obj_ptr = nullptr;
223  // No change to ref-count of the adopted pointer.
224 
225  if (oldPtr != nullptr)
226  {
227  _UnInitialize(oldPtr);
228  }
229  }
230  return *this;
231  }
static void _UnInitialize(_In_ T *_Obj_ptr)
Definition: amprt.h:264

Member Data Documentation

template<class T>
T* Concurrency::details::_Reference_counted_obj_ptr< T >::_M_obj_ptr
private

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