Blender  V2.93
TimeStamp.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 
24 #ifdef WITH_CXX_GUARDEDALLOC
25 # include "MEM_guardedalloc.h"
26 #endif
27 
28 namespace Freestyle {
29 
30 class TimeStamp {
31  public:
32  static inline TimeStamp *instance()
33  {
34  return &_instance;
35  }
36 
37  inline unsigned getTimeStamp() const
38  {
39  return _time_stamp;
40  }
41 
42  inline void increment()
43  {
44  ++_time_stamp;
45  }
46 
47  inline void reset()
48  {
49  _time_stamp = 1;
50  }
51 
52  protected:
54  {
55  _time_stamp = 1;
56  }
57 
59  {
60  }
61 
62  private:
63  static TimeStamp _instance;
64  unsigned _time_stamp;
65 
66 #ifdef WITH_CXX_GUARDEDALLOC
67  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:TimeStamp")
68 #endif
69 };
70 
71 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
TimeStamp(const TimeStamp &)
Definition: TimeStamp.h:58
static TimeStamp * instance()
Definition: TimeStamp.h:32
unsigned getTimeStamp() const
Definition: TimeStamp.h:37
inherits from class Rep
Definition: AppCanvas.cpp:32