This repository has been archived on 2026-04-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
original-mcpe-0.6.1/handheld/project/lib_projects/raknet/jni/RaknetSources/RefCountedObj.h
2026-04-01 23:13:15 +02:00

26 lines
621 B
C++

/// \file
/// \brief \b Reference counted object. Very simple class for quick and dirty uses.
///
/// This file is part of RakNet Copyright 2003 Jenkins Software LLC
///
/// Usage of RakNet is subject to the appropriate license agreement.
#ifndef __REF_COUNTED_OBJ_H
#define __REF_COUNTED_OBJ_H
#include "RakMemoryOverride.h"
/// World's simplest class :)
class RefCountedObj
{
public:
RefCountedObj() {refCount=1;}
virtual ~RefCountedObj() {}
void AddRef(void) {refCount++;}
void Deref(void) {if (--refCount==0) RakNet::OP_DELETE(this, _FILE_AND_LINE_);}
int refCount;
};
#endif