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
54  {
55  _ASSERTE(_M_refCount == 0);
56  }
volatile long _M_refCount
Definition: pplcancellation_token.h:99
#define _ASSERTE(expr)
Definition: crtdbg.h:216
Concurrency::details::_RefCounter::_RefCounter ( long  _InitialCount = 1)
inlineprotected
93  : _M_refCount(_InitialCount)
94  {
95  _ASSERTE(_M_refCount > 0);
96  }
volatile long _M_refCount
Definition: pplcancellation_token.h:99
#define _ASSERTE(expr)
Definition: crtdbg.h:216

Member Function Documentation

virtual void Concurrency::details::_RefCounter::_Destroy ( )
inlineprotectedvirtual
88  {
89  delete this;
90  }
long Concurrency::details::_RefCounter::_Reference ( )
inline
61  {
62  long _Refcount = _InterlockedIncrement(&_M_refCount);
63 
64  // 0 - 1 transition is illegal
65  _ASSERTE(_Refcount > 1);
66  return _Refcount;
67  }
volatile long _M_refCount
Definition: pplcancellation_token.h:99
#define _ASSERTE(expr)
Definition: crtdbg.h:216
long __cdecl _InterlockedIncrement(long volatile *)
long Concurrency::details::_RefCounter::_Release ( )
inline
72  {
73  long _Refcount = _InterlockedDecrement(&_M_refCount);
74  _ASSERTE(_Refcount >= 0);
75 
76  if (_Refcount == 0)
77  {
78  _Destroy();
79  }
80 
81  return _Refcount;
82  }
volatile long _M_refCount
Definition: pplcancellation_token.h:99
virtual void _Destroy()
Definition: pplcancellation_token.h:87
#define _ASSERTE(expr)
Definition: crtdbg.h:216
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: