STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Concurrency::details::_RefCounter Class Reference

#include <pplcancellation_token.h>

Inheritance diagram for Concurrency::details::_RefCounter:
Concurrency::details::_CancellationTokenRegistration Concurrency::details::_CancellationTokenState Concurrency::details::_CancellationTokenCallback< _Function > Concurrency::details::CancellationTokenRegistration_TaskProc

Public Member Functions

virtual ~_RefCounter ()
 
long _Reference ()
 
long _Release ()
 

Protected Member Functions

virtual void _Destroy ()
 
 _RefCounter (long _InitialCount=1)
 

Protected Attributes

volatile long _M_refCount
 

Constructor & Destructor Documentation

virtual Concurrency::details::_RefCounter::~_RefCounter ( )
inlinevirtual
56  {
57  _ASSERTE(_M_refCount == 0);
58  }
volatile long _M_refCount
Definition: pplcancellation_token.h:101
Concurrency::details::_RefCounter::_RefCounter ( long  _InitialCount = 1)
inlineprotected
95  : _M_refCount(_InitialCount)
96  {
97  _ASSERTE(_M_refCount > 0);
98  }
volatile long _M_refCount
Definition: pplcancellation_token.h:101

Member Function Documentation

virtual void Concurrency::details::_RefCounter::_Destroy ( )
inlineprotectedvirtual
90  {
91  delete this;
92  }
long Concurrency::details::_RefCounter::_Reference ( )
inline
63  {
64  long _Refcount = _InterlockedIncrement(&_M_refCount);
65 
66  // 0 - 1 transition is illegal
67  _ASSERTE(_Refcount > 1);
68  return _Refcount;
69  }
volatile long _M_refCount
Definition: pplcancellation_token.h:101
long __cdecl _InterlockedIncrement(long volatile *)
long Concurrency::details::_RefCounter::_Release ( )
inline
74  {
75  long _Refcount = _InterlockedDecrement(&_M_refCount);
76  _ASSERTE(_Refcount >= 0);
77 
78  if (_Refcount == 0)
79  {
80  _Destroy();
81  }
82 
83  return _Refcount;
84  }
volatile long _M_refCount
Definition: pplcancellation_token.h:101
virtual void _Destroy()
Definition: pplcancellation_token.h:89
long __cdecl _InterlockedDecrement(long volatile *)

Member Data Documentation

volatile long Concurrency::details::_RefCounter::_M_refCount
protected

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