source: trunk/ETSI-Testsuites/ETSI_auto_IOT/adapter/src/Helper/Singleton.h

Last change on this file was 22, checked in by rings, 14 years ago
  • Property svn:executable set to *
File size: 602 bytes
Line 
1/**
2 * @file Singleton.h
3 * Defines the Singleton class template
4 * @author Alexandre Berge
5 * @version 1.0
6 * @date 16/07/2009
7 */
8#ifndef SINGLETON_H
9#define SINGLETON_H
10template <class T>
11/**
12 * Template class for singleton objects.
13 */
14class Singleton
15{
16 public:
17 /**
18  * The methods returns the singleton instance of this class.
19  * @return Class instance
20  */
21  static T& Instance() {
22    static T m_instance;
23    return m_instance;
24  }
25 
26 protected:
27  Singleton() {};
28  virtual ~Singleton() {};
29
30 private:
31  Singleton(Singleton const&); 
32  Singleton& operator=(Singleton const&);
33};
34
35#endif
Note: See TracBrowser for help on using the repository browser.