Classes | Defines

singleton.h File Reference

#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdexcept>
#include "singleton.h"

Go to the source code of this file.

Classes

class  TSingleton< T >

Defines

#define SINGLETON_TIMEOUT   1000000000
#define SINGLETON(T)
#define SINGLETON_REGISTER(T)   TSingleton<T> T::m_singleton( #T )

Define Documentation

#define SINGLETON (   T  ) 
Value:
friend class TSingleton<T>;                     \
  static TSingleton<T> m_singleton;             \
  static T *GetPtr(bool suppressError=false)    \
  {                                             \
    return m_singleton.GetPtr(suppressError);   \
  }                                             \
  static T &GetRef()                            \
  {                                             \
    return m_singleton.GetRef();                \
  }                                             \
  static void Release()                         \
  {                                             \
    m_singleton.Release();                      \
  }                                             \
  static bool Requested()                       \
  {                                             \
    return m_singleton.Requested();             \
  }
#define SINGLETON_REGISTER (   T  )     TSingleton<T> T::m_singleton( #T )
#define SINGLETON_TIMEOUT   1000000000