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::_RefCounterBase Class Reference

#include <concrt.h>

Inheritance diagram for Concurrency::details::_RefCounterBase:
Concurrency::details::_AsyncTaskCollection

Public Member Functions

virtual ~_RefCounterBase ()
 
long _Reference ()
 
long _Release ()
 

Protected Member Functions

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

Protected Attributes

volatile long _M_refCount
 

Constructor & Destructor Documentation

virtual Concurrency::details::_RefCounterBase::~_RefCounterBase ( )
inlinevirtual
4036  {
4038  }
#define _CONCRT_ASSERT(x)
Definition: concrt.h:123
volatile long _M_refCount
Definition: concrt.h:4081
Concurrency::details::_RefCounterBase::_RefCounterBase ( long  _InitialCount = 1)
inlineprotected
4075  : _M_refCount(_InitialCount)
4076  {
4078  }
#define _CONCRT_ASSERT(x)
Definition: concrt.h:123
volatile long _M_refCount
Definition: concrt.h:4081

Member Function Documentation

virtual void Concurrency::details::_RefCounterBase::_Destroy ( )
inlineprotectedvirtual

Reimplemented in Concurrency::details::_AsyncTaskCollection.

4070  {
4071  delete this;
4072  }
long Concurrency::details::_RefCounterBase::_Reference ( )
inline
4043  {
4044  long _Refcount = _InterlockedIncrement(&_M_refCount);
4045 
4046  // 0 - 1 transition is illegal
4047  _CONCRT_ASSERT(_Refcount > 1);
4048  return _Refcount;
4049  }
#define _CONCRT_ASSERT(x)
Definition: concrt.h:123
volatile long _M_refCount
Definition: concrt.h:4081
long __cdecl _InterlockedIncrement(long volatile *)
long Concurrency::details::_RefCounterBase::_Release ( )
inline
4054  {
4055  long _Refcount = _InterlockedDecrement(&_M_refCount);
4056  _CONCRT_ASSERT(_Refcount >= 0);
4057 
4058  if (_Refcount == 0)
4059  {
4060  _Destroy();
4061  }
4062 
4063  return _Refcount;
4064  }
#define _CONCRT_ASSERT(x)
Definition: concrt.h:123
long __cdecl _InterlockedDecrement(long volatile *)
volatile long _M_refCount
Definition: concrt.h:4081
virtual void _Destroy()
Definition: concrt.h:4069

Member Data Documentation

volatile long Concurrency::details::_RefCounterBase::_M_refCount
protected

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