Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
include
Utilities
InstanceCount.h
Go to the documentation of this file.
1
/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2
*
3
*
4
* MoDELib is distributed without any warranty under the
5
* GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6
*/
7
8
#ifndef model_InstanceCount_H_
9
#define model_InstanceCount_H_
10
11
//#include <modelMacros.h> // model_checkInput
12
13
namespace
model
14
{
15
16
/************************************************************/
17
/************************************************************/
27
template
<
typename
Derived>
28
class
InstanceCount
29
{
30
31
32
// The incremental counters
33
static
size_t
count;
34
35
public
:
36
37
38
39
/**********************************************************************/
40
InstanceCount
()
41
{
42
count+=1;
43
}
44
45
/**********************************************************************/
46
InstanceCount
(
const
InstanceCount
&)
47
{
48
count+=1;
49
}
50
51
/**********************************************************************/
52
~InstanceCount
()
53
{
54
count-=1;
55
}
56
57
/**********************************************************************/
58
static
size_t
&
counter
()
59
{
60
return
count;
61
}
62
63
64
65
66
67
};
68
69
template
<
typename
Derived>
70
size_t
InstanceCount<Derived>::count = 0;
71
72
}
// namespace model
73
#endif
model::InstanceCount::InstanceCount
InstanceCount()
Definition
InstanceCount.h:40
model::InstanceCount::InstanceCount
InstanceCount(const InstanceCount &)
Definition
InstanceCount.h:46
model::InstanceCount::~InstanceCount
~InstanceCount()
Definition
InstanceCount.h:52
model::InstanceCount::counter
static size_t & counter()
Definition
InstanceCount.h:58
model
Definition
DD_converter.dox:2
Generated by
1.15.0