Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JSingleton.hh
Go to the documentation of this file.
1#ifndef __JLANG__JSINGLETON__
2#define __JLANG__JSINGLETON__
3
4/**
5 * \author mdejong
6 */
7
8namespace JLANG {}
9namespace JPP { using namespace JLANG; }
10
11namespace JLANG {
12
13
14 /**
15 * Simple singleton class.
16 */
17 template<class T>
18 struct JSingleton {
19
20 typedef T data_type;
21
22 /**
23 * Get unique instance of template class.
24 *
25 * \return object
26 */
28 {
29 static data_type value;
30
31 return value;
32 }
33
34 protected:
35 /**
36 * Default constructor.
37 */
39 {}
40
41
42 /**
43 * Copy constructor.
44 */
46 {}
47
48 private:
50 };
51}
52
53#endif
Auxiliary classes and methods for language specific functionality.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Simple singleton class.
Definition JSingleton.hh:18
JSingleton()
Default constructor.
Definition JSingleton.hh:38
JSingleton(const JSingleton &)
Copy constructor.
Definition JSingleton.hh:45
JSingleton & operator=(const JSingleton &)
static data_type & getInstance()
Get unique instance of template class.
Definition JSingleton.hh:27