vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
fault_latch.h
1#pragma once
2
3namespace Vkm::Engine {
4
11class FaultLatch {
12 public:
13 FaultLatch() = default;
14 ~FaultLatch() = default;
15
16 FaultLatch(const FaultLatch& other) = default;
17 FaultLatch& operator=(const FaultLatch& other) = default;
18
19 FaultLatch(FaultLatch && other) = default;
20 FaultLatch& operator=(FaultLatch && other) = default;
21
28 bool report() {
29 m_seen = true;
30 if (m_named) return false;
31 m_named = true;
32 return true;
33 }
34
38 void endPass() {
39 m_named = m_seen;
40 m_seen = false;
41 }
42
43 private:
44 bool m_seen = false;
45 bool m_named = false;
46};
47
48} // namespace Vkm::Engine
bool report()
Record that the pass in progress met the fault.
Definition fault_latch.h:28
void endPass()
Close the pass: a fault it did not meet is named again next time.
Definition fault_latch.h:38