10 std::atomic<Size>& totalCnt,
12 : reentrantCnt(reentrantCnt)
24 SPH_ASSERT(reentrantCnt == 1,
"Reentrant " + std::to_string(reentrantCnt));
27 SPH_ASSERT(totalCnt == 1,
"Called more than once");
35 SPH_ASSERT(!std::uncaught_exception(),
"Function threw an exception");
#define SPH_ASSERT(x,...)
NAMESPACE_SPH_BEGIN const std::thread::id MAIN_THREAD_ID
bool isMainThread()
Checks if the calling thread is the main thred.
Helper functions to check the internal consistency of the code.
@ NOT_MAIN_THREAD
Function cannot be called from main thread.
@ NO_THROW
Function cannot throw exceptions.
@ MAIN_THREAD
Function can only be executed from main thread.
@ ONCE
Function can be executed only once in the application.
@ NON_REENRANT
Function can be executed by any thread, but only once at a time.
#define NAMESPACE_SPH_END
constexpr INLINE bool has(const TEnum flag) const
Checks if the object has a given flag.
FunctionChecker(std::atomic< Size > &reentrantCnt, std::atomic< Size > &totalCnt, const Flags< CheckFunction > flags)