Blender  V3.3
TimeStamp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #ifdef WITH_CXX_GUARDEDALLOC
11 # include "MEM_guardedalloc.h"
12 #endif
13 
14 namespace Freestyle {
15 
16 class TimeStamp {
17  public:
18  static inline TimeStamp *instance()
19  {
20  return &_instance;
21  }
22 
23  inline unsigned getTimeStamp() const
24  {
25  return _time_stamp;
26  }
27 
28  inline void increment()
29  {
30  ++_time_stamp;
31  }
32 
33  inline void reset()
34  {
35  _time_stamp = 1;
36  }
37 
38  protected:
40  {
41  _time_stamp = 1;
42  }
43 
45  {
46  }
47 
48  private:
49  static TimeStamp _instance;
50  unsigned _time_stamp;
51 
52 #ifdef WITH_CXX_GUARDEDALLOC
53  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:TimeStamp")
54 #endif
55 };
56 
57 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
TimeStamp(const TimeStamp &)
Definition: TimeStamp.h:44
static TimeStamp * instance()
Definition: TimeStamp.h:18
unsigned getTimeStamp() const
Definition: TimeStamp.h:23
inherits from class Rep
Definition: AppCanvas.cpp:18