ref.cpp

来自「基于Tapi 3.0的软电话源代码」· C++ 代码 · 共 37 行

CPP
37
字号
//-----------------------------------------------------------------------
//  Copyright (c) 2002 Avaya Global SME Solutions 
//-----------------------------------------------------------------------
//  Project name: TAPI 3 Test Harness
//  Module file : ref.cpp
//  Compiler    : Visual C++ 6.0
//-----------------------------------------------------------------------
//  Description : Implementation of the CRef class. Class handles 
//                incrementing/decrementing of number of used instances                 
//-----------------------------------------------------------------------

#include "stdafx.h"
#include "Ref.h"

// Construction/Destruction
CRef::CRef()
{
	m_Ref = 1;
}

CRef::~CRef()
{
}

int CRef::AddRef()
{
	m_Ref++;
	return m_Ref;
}

int CRef::Release()
{
	int l = --m_Ref;
	
	if (l == 0) delete this;
	return l;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?