Virtual Belgium  2.0
A micro-simulation platform for the Belgian population
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
SingletonRnd< T > Class Template Reference

SingletonRnd class for the RandomGenerators class. More...

#include <Random.hpp>

Static Public Member Functions

static void makeInstance (unsigned long long i)
 Create a singleton instance of a T object. More...
 
static T * getInstance ()
 Return the instance of SingletonRnd if already generated. More...
 
static void kill ()
 Killing the instance and freeing memory. More...
 

Protected Member Functions

 SingletonRnd ()
 Constructor. More...
 
 ~SingletonRnd ()
 Destructor. More...
 

Static Private Attributes

static T * _singleton = nullptr
 unique instance of the RandomGenerators class More...
 

Detailed Description

template<typename T>
class SingletonRnd< T >

SingletonRnd class for the RandomGenerators class.

Constructor & Destructor Documentation

template<typename T>
SingletonRnd< T >::SingletonRnd ( )
inlineprotected

Constructor.

template<typename T>
SingletonRnd< T >::~SingletonRnd ( )
inlineprotected

Destructor.

Member Function Documentation

template<typename T>
static T* SingletonRnd< T >::getInstance ( )
inlinestatic

Return the instance of SingletonRnd if already generated.

/return the instance of SingletonRnd if generetad, an exception otherwise

template<typename T>
static void SingletonRnd< T >::kill ( )
inlinestatic

Killing the instance and freeing memory.

template<typename T>
static void SingletonRnd< T >::makeInstance ( unsigned long long  i)
inlinestatic

Create a singleton instance of a T object.

/param i a seed for the T constructor

Member Data Documentation

template<typename T>
T * SingletonRnd< T >::_singleton = nullptr
staticprivate

unique instance of the RandomGenerators class

Initialize the singleton to NULL.


The documentation for this class was generated from the following file: