Singleton.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "ionTypes.h"
5 
6 
7 namespace ion
8 {
9 
12  template <class Implementation>
13  class Singleton
14  {
15 
16  Singleton(Singleton const &) = delete;
17  Singleton & operator = (Singleton const &) = delete;
18 
19  public:
20 
21  static Implementation & Get()
22  {
23  static Implementation * Instance = 0;
24 
25  if (! Instance)
26  Instance = new Implementation();
27 
28  return * Instance;
29  }
30 
31  static Implementation * GetPointer()
32  {
33  return & Get();
34  }
35 
36  protected:
37 
39  {}
40 
41  };
42 
43 }
Singleton()
Definition: Singleton.h:38
static Implementation * GetPointer()
Definition: Singleton.h:31
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
Base class for Singleton design pattern implementation.
Definition: Singleton.h:13
Defines typedefs for integer and floating point types.
static Implementation & Get()
Definition: Singleton.h:21