Blender
V2.93
source
blender
freestyle
intern
system
BaseObject.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*/
16
17
#pragma once
18
25
#ifdef WITH_CXX_GUARDEDALLOC
26
# include "
MEM_guardedalloc.h
"
27
#endif
28
29
namespace
Freestyle
{
30
31
class
BaseObject
{
32
public
:
33
inline
BaseObject
()
34
{
35
_ref_counter = 0;
36
}
37
38
virtual
~BaseObject
()
39
{
40
}
41
45
virtual
int
destroy
()
46
{
47
return
release
();
48
}
49
51
inline
int
addRef
()
52
{
53
return
++_ref_counter;
54
}
55
57
inline
int
release
()
58
{
59
if
(_ref_counter) {
60
_ref_counter--;
61
}
62
return
_ref_counter;
63
}
64
65
private
:
66
unsigned
_ref_counter;
67
68
#ifdef WITH_CXX_GUARDEDALLOC
69
MEM_CXX_CLASS_ALLOC_FUNCS(
"Freestyle:BaseObject"
)
70
#endif
71
};
72
73
}
/* namespace Freestyle */
MEM_guardedalloc.h
Read Guarded memory(de)allocation.
Freestyle::BaseObject
Definition:
BaseObject.h:31
Freestyle::BaseObject::BaseObject
BaseObject()
Definition:
BaseObject.h:33
Freestyle::BaseObject::destroy
virtual int destroy()
Definition:
BaseObject.h:45
Freestyle::BaseObject::~BaseObject
virtual ~BaseObject()
Definition:
BaseObject.h:38
Freestyle::BaseObject::addRef
int addRef()
Definition:
BaseObject.h:51
Freestyle::BaseObject::release
int release()
Definition:
BaseObject.h:57
Freestyle
inherits from class Rep
Definition:
AppCanvas.cpp:32
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1