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