GetFEM  5.4.3
dal::singleton< T, LEV > Class Template Reference

singleton class. More...

#include <dal_singleton.h>

Static Public Member Functions

static T & instance ()
 Instance from the current thread.
 
static size_type num_threads ()
 number of threads this singleton is distributed on.
 
static size_type this_thread ()
 this thread number according to the threading policy of the singleton
 

Detailed Description

template<typename T, int LEV = 1>
class dal::singleton< T, LEV >

singleton class.

usage:

const foo &f = singleton<foo>::const_instance();
static T & instance()
Instance from the current thread.

the LEV template arguments allows one to choose the order of destruction of the singletons: lowest LEV will be destroyed first.

Definition at line 158 of file dal_singleton.h.


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