Blender
V5.0
intern
memutil
MEM_RefCounted.h
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11
#ifndef __MEM_REFCOUNTED_H__
12
#define __MEM_REFCOUNTED_H__
13
25
class
MEM_RefCounted
{
26
public
:
30
MEM_RefCounted
() =
default
;
31
36
inline
virtual
int
getRef
()
const
;
37
42
inline
virtual
int
incRef
();
43
49
inline
virtual
int
decRef
();
50
51
protected
:
56
virtual
~MEM_RefCounted
() =
default
;
57
59
int
m_refCount
= 1;
60
};
61
62
inline
int
MEM_RefCounted::getRef
()
const
63
{
64
return
m_refCount
;
65
}
66
67
inline
int
MEM_RefCounted::incRef
()
68
{
69
return
++
m_refCount
;
70
}
71
72
inline
int
MEM_RefCounted::decRef
()
73
{
74
m_refCount
--;
75
if
(
m_refCount
== 0) {
76
delete
this
;
77
return
0;
78
}
79
return
m_refCount
;
80
}
81
82
#endif
// __MEM_REFCOUNTED_H__
MEM_RefCounted::getRef
virtual int getRef() const
Definition
MEM_RefCounted.h:62
MEM_RefCounted::m_refCount
int m_refCount
Definition
MEM_RefCounted.h:59
MEM_RefCounted::~MEM_RefCounted
virtual ~MEM_RefCounted()=default
MEM_RefCounted::decRef
virtual int decRef()
Definition
MEM_RefCounted.h:72
MEM_RefCounted::incRef
virtual int incRef()
Definition
MEM_RefCounted.h:67
MEM_RefCounted::MEM_RefCounted
MEM_RefCounted()=default
Generated on
for Blender by
doxygen
1.16.1