1 #include "accessguard.h"
5 thread_local AccessGuard *AccessGuard::instance = nullptr;
7 AccessGuard::AccessGuard()
13 AccessGuard::AccessGuard(AccessGuard &&other):
14 flags(std::move(other.flags))
20 AccessGuard &AccessGuard::operator=(AccessGuard &&other)
22 flags = std::move(other.flags);
28 AccessGuard::~AccessGuard()
34 AccessGuard &AccessGuard::get_instance()
37 throw std::logic_error("no AccessGuard instance");
41 void AccessGuard::block_all()
43 default_flag = BLOCKED;
44 for(uint8_t &f: flags)
48 void AccessGuard::unblock_all()
50 default_flag = UNBLOCKED;
51 for(uint8_t &f: flags)
55 unsigned AccessGuard::get_next_index()
57 static unsigned next_index = 0;
61 } // namespace Msp::Game