1 #ifndef JSONSINGLETON_H
2 #define JSONSINGLETON_H
4 template <
typename T>
class JSONSingleton {
6 static inline T
get(void){
7 return get_singleton() -> ptr;
9 static inline void set(T p){
10 get_singleton() -> ptr = p;
13 inline JSONSingleton() : ptr(NULL) { }
14 JSONSingleton(
const JSONSingleton<T> &);
15 JSONSingleton<T> operator = (
const JSONSingleton<T> &);
16 static inline JSONSingleton<T> * get_singleton(
void){
17 static JSONSingleton<T> instance;