Blender V5.0
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
11
12#include "MEM_guardedalloc.h"
13
14#include "BLI_sys_types.h"
15
16namespace Freestyle {
17
18class TimeStamp {
19 public:
20 static inline TimeStamp *instance()
21 {
22 return &_instance;
23 }
24
25 inline uint getTimeStamp() const
26 {
27 return _time_stamp;
28 }
29
30 inline void increment()
31 {
32 ++_time_stamp;
33 }
34
35 inline void reset()
36 {
37 _time_stamp = 1;
38 }
39
40 protected:
42 {
43 _time_stamp = 1;
44 }
45
46 TimeStamp(const TimeStamp &) {}
47
48 private:
49 static TimeStamp _instance;
50 uint _time_stamp;
51
52 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:TimeStamp")
53};
54
55} /* namespace Freestyle */
unsigned int uint
Read Guarded memory(de)allocation.
TimeStamp(const TimeStamp &)
Definition TimeStamp.h:46
uint getTimeStamp() const
Definition TimeStamp.h:25
static TimeStamp * instance()
Definition TimeStamp.h:20
inherits from class Rep
Definition AppCanvas.cpp:20