windows-nt/Source/XPSP1/NT/enduser/netmeeting/h/referenc.h
2020-09-26 16:20:57 +08:00

32 lines
521 B
C++

#ifndef _REFERENC_H_
#define _REFERENC_H_
class REFCOUNT
{
public:
REFCOUNT();
virtual ~REFCOUNT();
DWORD AddRef();
DWORD Release();
DWORD Delete();
void OnStack() {bOnStack = TRUE;};
private:
DWORD NumRefs;
// Give 2 bits since BOOL is signed
BOOL bMarkedForDelete : 2;
BOOL bOnStack : 2;
};
class REFERENCE
{
public:
REFERENCE(REFCOUNT * _pRefCount) : pRefCount(_pRefCount) {pRefCount->AddRef();};
~REFERENCE() {pRefCount->Release();};
private:
REFCOUNT * pRefCount;
};
#endif // ! _REFERENC_H_