SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RefCountedObj.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 *
10 * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11 *
12 * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13 * license found in the license.txt file in the root directory of this source tree.
14 */
15
19
20
21
22 #ifndef __REF_COUNTED_OBJ_H
23 #define __REF_COUNTED_OBJ_H
24
25 #include "memoryoverride.h"
26
28 class RefCountedObj
29 {
30 public:
31 RefCountedObj() {refCount=1;}
32 virtual ~RefCountedObj() {}
33 void AddRef(void) {refCount++;}
34 void Deref(void) {if (--refCount==0) SLNet::OP_DELETE(this, _FILE_AND_LINE_);}
35 int refCount;
36 };
37
38 #endif