Leviathan  0.8.0.0
Leviathan game engine
ComplainOnce.h
Go to the documentation of this file.
1 // Leviathan Game Engine
2 // Copyright (c) 2012-2018 Henri Hyyryläinen
3 #pragma once
4 // ------------------------------------ //
5 #include "Common/ThreadSafe.h"
6 
7 #include <unordered_set>
8 
9 namespace Leviathan {
10 
12 class ComplainOnce {
13 public:
14  ComplainOnce() = delete;
15  DLLEXPORT static bool PrintWarningOnce(
16  const std::string& warning, const std::string& message);
17  DLLEXPORT static bool PrintErrorOnce(const std::string& error, const std::string& message);
18 
19 private:
21  static std::unordered_set<std::string> FiredErrors;
22 
23  static Mutex ErrorsMutex;
24 };
25 
26 } // namespace Leviathan
std::mutex Mutex
Definition: ThreadSafe.h:14
static DLLEXPORT bool PrintWarningOnce(const std::string &warning, const std::string &message)
Definition: ComplainOnce.cpp:7
static DLLEXPORT bool PrintErrorOnce(const std::string &error, const std::string &message)
#define DLLEXPORT
Definition: Include.h:115
Prints a warning or an error once.
Definition: ComplainOnce.h:12
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12