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

167  : _M_obj_ptr(_Ptr)
168  {
169  _Init();
170  }
173  : _M_obj_ptr(_Other._M_obj_ptr)
174  {
175  _Init();
176  }
179  : _M_obj_ptr(_Other._M_obj_ptr)
180  {
181  _Other._M_obj_ptr = nullptr;
182  // No change to ref-count
183  }
187  {
188  if (_M_obj_ptr != NULL) {
190  }
191  }
#define NULL
Definition: crtdbg.h:30
static void _UnInitialize(_In_ T *_Obj_ptr)
Definition: amprt.h:258

Member Function Documentation

template<class T>
_Ret_ T* Concurrency::details::_Reference_counted_obj_ptr< T >::_Get_ptr ( ) const
inline
243  {
244  return _M_obj_ptr;
245  }
template<class T>
void Concurrency::details::_Reference_counted_obj_ptr< T >::_Init ( )
inlineprivate
251  {
252  if (_M_obj_ptr == NULL)
253  return;
254 
255  reinterpret_cast<_Reference_counter*>(_M_obj_ptr)->_Add_reference();
256  }
#define NULL
Definition: crtdbg.h:30
template<class T>
static void Concurrency::details::_Reference_counted_obj_ptr< T >::_UnInitialize ( _In_ T *  _Obj_ptr)
inlinestaticprivate
259  {
260  reinterpret_cast<_Reference_counter*>(_Obj_ptr)->_Remove_reference();
261  }
template<class T>
Concurrency::details::_Reference_counted_obj_ptr< T >::operator T * ( ) const
inline
238  {
239  return _M_obj_ptr;
240  }
template<class T>
T& Concurrency::details::_Reference_counted_obj_ptr< T >::operator* ( ) const
inline
233  {
234  return *_M_obj_ptr;
235  }
template<class T>
_Ret_ T* Concurrency::details::_Reference_counted_obj_ptr< T >::operator-> ( ) const
inline
228  {
229  return _M_obj_ptr;
230  }
template<class T>
_Reference_counted_obj_ptr& Concurrency::details::_Reference_counted_obj_ptr< T >::operator= ( const _Reference_counted_obj_ptr< T > &  _Other)
inline
195  {
196  if (_M_obj_ptr != _Other._M_obj_ptr)
197  {
198  T *oldPtr = _M_obj_ptr;
199  _M_obj_ptr = _Other._M_obj_ptr;
200  _Init();
201 
202  if (oldPtr != NULL) {
203  _UnInitialize(oldPtr);
204  }
205  }
206  return *this;
207  }
#define NULL
Definition: crtdbg.h:30
static void _UnInitialize(_In_ T *_Obj_ptr)
Definition: amprt.h:258
211  {
212  if (_M_obj_ptr != _Other._M_obj_ptr)
213  {
214  T *oldPtr = _M_obj_ptr;
215  _M_obj_ptr = _Other._M_obj_ptr;
216  _Other._M_obj_ptr = nullptr;
217  // No change to ref-count of the adopted pointer.
218 
219  if (oldPtr != nullptr)
220  {
221  _UnInitialize(oldPtr);
222  }
223  }
224  return *this;
225  }
static void _UnInitialize(_In_ T *_Obj_ptr)
Definition: amprt.h:258

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: