SPH
Classes | Macros | Enumerations | Functions
CheckFunction.h File Reference

Helper functions to check the internal consistency of the code. More...

#include "common/Globals.h"
#include "objects/wrappers/Flags.h"
#include <atomic>

Go to the source code of this file.

Classes

class  FunctionChecker
 

Macros

#define CHECK_FUNCTION(flags)
 

Enumerations

enum class  CheckFunction {
  NON_REENRANT = 1 << 0 , MAIN_THREAD = 1 << 1 , NOT_MAIN_THREAD = 1 << 2 , ONCE = 1 << 3 ,
  NO_THROW = 1 << 4
}
 

Functions

bool isMainThread ()
 Checks if the calling thread is the main thred. More...
 

Detailed Description

Helper functions to check the internal consistency of the code.

Author
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file CheckFunction.h.

Macro Definition Documentation

◆ CHECK_FUNCTION

#define CHECK_FUNCTION (   flags)

Definition at line 40 of file CheckFunction.h.

Enumeration Type Documentation

◆ CheckFunction

enum CheckFunction
strong
Enumerator
NON_REENRANT 

Function can be executed by any thread, but only once at a time.

MAIN_THREAD 

Function can only be executed from main thread.

NOT_MAIN_THREAD 

Function cannot be called from main thread.

ONCE 

Function can be executed only once in the application.

NO_THROW 

Function cannot throw exceptions.

Definition at line 14 of file CheckFunction.h.

Function Documentation

◆ isMainThread()

bool isMainThread ( )

Checks if the calling thread is the main thred.

Definition at line 39 of file CheckFunction.cpp.