Load GUI from XML

This commit is contained in:
2015-03-10 00:48:25 +01:00
parent 9d7dd452c7
commit 884fd8bb52
21 changed files with 1019 additions and 119 deletions

24
Singleton.hh Normal file
View File

@@ -0,0 +1,24 @@
#ifndef __OPENGLPLAYGROUND_SINGLETON_HH__
#define __OPENGLPLAYGROUND_SINGLETON_HH__
#include <memory>
#include <mutex>
template<typename T>
class Singleton {
public:
static T& getInstance() {
call_once(instance_flag, init);
return *instance;
}
private:
static std::unique_ptr<T> instance;
static std::once_flag instance_flag;
static void init() {
instance.reset(new T{});
}
};
#endif