Blender
V3.3
intern
memutil
MEM_RefCounted.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later
2
* Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3
10
#ifndef __MEM_REFCOUNTED_H__
11
#define __MEM_REFCOUNTED_H__
12
25
class
MEM_RefCounted
{
26
public
:
30
MEM_RefCounted
() :
m_refCount
(1)
31
{
32
}
33
38
inline
virtual
int
getRef
()
const
;
39
44
inline
virtual
int
incRef
();
45
51
inline
virtual
int
decRef
();
52
53
protected
:
58
virtual
~MEM_RefCounted
()
59
{
60
}
61
62
protected
:
64
int
m_refCount
;
65
};
66
67
inline
int
MEM_RefCounted::getRef
()
const
68
{
69
return
m_refCount
;
70
}
71
72
inline
int
MEM_RefCounted::incRef
()
73
{
74
return
++
m_refCount
;
75
}
76
77
inline
int
MEM_RefCounted::decRef
()
78
{
79
m_refCount
--;
80
if
(
m_refCount
== 0) {
81
delete
this
;
82
return
0;
83
}
84
return
m_refCount
;
85
}
86
87
#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:67
MEM_RefCounted::~MEM_RefCounted
virtual ~MEM_RefCounted()
Definition:
MEM_RefCounted.h:58
MEM_RefCounted::m_refCount
int m_refCount
Definition:
MEM_RefCounted.h:64
MEM_RefCounted::decRef
virtual int decRef()
Definition:
MEM_RefCounted.h:77
MEM_RefCounted::incRef
virtual int incRef()
Definition:
MEM_RefCounted.h:72
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1