GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Util.hpp
Go to the documentation of this file.
1 #ifndef RADIX_UTIL_HPP
2 #define RADIX_UTIL_HPP
3 
4 #include <string>
5 #include <memory>
6 #include <random>
7 #include <thread>
8 
10 
11 namespace radix {
12 
13 class Util {
14 private:
15  static std::unique_ptr<Logger> logger;
16 
17 public:
19  struct _Log {
20  LogInput operator()();
21  LogInput operator()(LogLevel);
22  LogInput operator()(LogLevel, const std::string &tag);
23  };
25  static _Log Log;
26 
27  static std::random_device RandDev;
28  static std::mt19937 Rand;
29 
30  static void Init();
31 
32  static void SetThreadName(std::thread&, const char*);
33  inline static void SetThreadName(std::thread &thread, const std::string &name) {
34  SetThreadName(thread, name.c_str());
35  }
36 };
37 
38 } /* namespace radix */
39 
40 #endif /* RADIX_UTIL_HPP */
Definition: GameController.hpp:7
static _Log Log
Definition: Util.hpp:25
Definition: Util.hpp:13
static std::mt19937 Rand
Definition: Util.hpp:28
std::cout-like object that sends the data it aggregated to a Logger when it dies
Definition: LogInput.hpp:17
static void Init()
Definition: Util.cpp:34
static std::random_device RandDev
Definition: Util.hpp:27
static void SetThreadName(std::thread &thread, const std::string &name)
Definition: Util.hpp:33
LogLevel
Definition: Logger.hpp:8
static std::unique_ptr< Logger > logger
Definition: Util.hpp:15
static void SetThreadName(std::thread &, const char *)
Definition: Util.cpp:79