namespace X3DTK {

template<class T>
T *Singleton<T>::_instance = 0;

template<class T>
T *Singleton<T>::getInstance()
{
  if (_instance == 0)
    _instance = new T();
  
  return _instance;  
}

template<class T>
void Singleton<T>::removeInstance()
{
  delete _instance;
  _instance = 0;
}

}
