Blender
V4.3
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
11
#ifndef __MEM_REFCOUNTED_H__
12
#define __MEM_REFCOUNTED_H__
13
25
class
MEM_RefCounted
{
26
public
:
30
MEM_RefCounted
() :
m_refCount
(1) {}
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
() {}
57
58
protected
:
60
int
m_refCount
;
61
};
62
63
inline
int
MEM_RefCounted::getRef
()
const
64
{
65
return
m_refCount
;
66
}
67
68
inline
int
MEM_RefCounted::incRef
()
69
{
70
return
++
m_refCount
;
71
}
72
73
inline
int
MEM_RefCounted::decRef
()
74
{
75
m_refCount
--;
76
if
(
m_refCount
== 0) {
77
delete
this
;
78
return
0;
79
}
80
return
m_refCount
;
81
}
82
83
#endif
// __MEM_REFCOUNTED_H__
MEM_RefCounted
Definition
MEM_RefCounted.h:25
MEM_RefCounted::MEM_RefCounted
MEM_RefCounted()
Definition
MEM_RefCounted.h:30
MEM_RefCounted::getRef
virtual int getRef() const
Definition
MEM_RefCounted.h:63
MEM_RefCounted::~MEM_RefCounted
virtual ~MEM_RefCounted()
Definition
MEM_RefCounted.h:56
MEM_RefCounted::m_refCount
int m_refCount
Definition
MEM_RefCounted.h:60
MEM_RefCounted::decRef
virtual int decRef()
Definition
MEM_RefCounted.h:73
MEM_RefCounted::incRef
virtual int incRef()
Definition
MEM_RefCounted.h:68
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0