Added common and test directories

This commit is contained in:
Kayne Ruse
2013-06-09 17:06:32 +10:00
parent 78326a3bbd
commit 0a48131de4
10 changed files with 193 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef SERVICELOCATOR_HPP_
#define SERVICELOCATOR_HPP_
template<typename T>
class ServiceLocator {
public:
static T* Set(T* t) {
delete service;
return service = t;
}
static T* Get() {
return service;
}
private:
static T* service;
};
template<typename T>
T* ServiceLocator<T>::service = nullptr;
#endif