tapioca_singleton.hpp 431 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include "tapioca.hpp"

class Tapioca_S : public Tapioca
{
public:
  static Tapioca_S* getInstance ();

private:
  Tapioca_S () {};
  Tapioca_S ( Tapioca_S const& );
  void operator=( Tapioca_S const& );
  
  static Tapioca_S *tapiocaInstance;
  
};

Tapioca_S* Tapioca_S::tapiocaInstance = NULL;

Tapioca_S* Tapioca_S::getInstance ()
{
  if ( !tapiocaInstance )
    tapiocaInstance = new Tapioca_S;
  
  return tapiocaInstance;
}