5
* This file singleton.h is created at Almende B.V. It is open-source software and part
6
* of the Common Hybrid Agent Platform (CHAP). A toolbox with a lot of open-source tools.
7
* Ranging from thread pools, and TCP/IP components to control architectures and learning
8
* algorithms. This software is published under the GNU Lesser General Public license,
9
* but the software is not allowed to be used for military use, within the bio-industry
10
* or for animal experimentation.
12
* @author Anne C. van Rossum
14
* @project Replicator FP7
15
* @company Almende B.V.
33
/* **************************************************************************************
34
* Interface of singleton
35
* **************************************************************************************/
42
static T* Instance() {
43
if(!m_pInstance) m_pInstance = new T;
44
assert(m_pInstance !=NULL);
51
Singleton(Singleton const&);
52
Singleton& operator=(Singleton const&);
53
static T* m_pInstance;
56
template <class T> T* Singleton<T>::m_pInstance=NULL;
63
#endif /* SINGLETON_H_ */