Collection of pre-defined random engines. More...
#include <fwk/RandomEngineRegistry.h>
Classes | |
class | InvalidRandomEngineException |
Base class for exceptions in the RandomEngineRegistry. More... | |
Public Types | |
enum | RandomEngineID { eDetector = 0, ePhysics = 1 } |
Identifiers for all pre-defined random engines. More... | |
Public Member Functions | |
utl::RandomEngine & | Get (const RandomEngineID id=eDetector) |
Get a pre-defined random engine. More... | |
Public Attributes | |
static RandomEngineRegistry &return | instance |
Private Types | |
typedef std::map < RandomEngineID, utl::RandomEngine * > | Registry |
Private Member Functions | |
void | GenerateSeeds (long *const seed, const int n) const |
void | Init () |
Initialise the registry. More... | |
RandomEngineRegistry () | |
void | RegisterOne (const RandomEngineID id, utl::RandomEngine *const engine) |
Register an engine. More... | |
~RandomEngineRegistry () | |
Private Attributes | |
utl::ShadowPtr< Registry > | fRegistry |
Friends | |
class | utl::Singleton< RandomEngineRegistry > |
Collection of pre-defined random engines.
This class registers the pre-defined random engines and provides symbolic names for them.
The class is implemented as a singleton.
Definition at line 37 of file RandomEngineRegistry.h.
|
private |
Definition at line 83 of file RandomEngineRegistry.h.
Identifiers for all pre-defined random engines.
Enumerator | |
---|---|
eDetector |
Detector engine. |
ePhysics |
Physics engine. |
Definition at line 41 of file RandomEngineRegistry.h.
|
inlineprivate |
Definition at line 72 of file RandomEngineRegistry.h.
|
private |
Definition at line 58 of file RandomEngineRegistry.cc.
|
private |
Definition at line 118 of file RandomEngineRegistry.cc.
References utl::abs(), fd, utl::s, and WARNING.
RandomEngine & fwk::RandomEngineRegistry::Get | ( | const RandomEngineID | id = eDetector | ) |
Get a pre-defined random engine.
Definition at line 42 of file RandomEngineRegistry.cc.
References ERROR, and fwk::CoordinateSystemRegistry::Init().
|
private |
Initialise the registry.
Definition at line 67 of file RandomEngineRegistry.cc.
References ERROR, utl::Branch::GetChild(), utl::Branch::GetData(), utl::RandomEngine::GetEngine(), utl::Branch::GetTopBranch(), INFO, and WARNING.
|
private |
Register an engine.
Definition at line 30 of file RandomEngineRegistry.cc.
|
friend |
Definition at line 86 of file RandomEngineRegistry.h.
|
private |
Definition at line 84 of file RandomEngineRegistry.h.
|
inherited |
Definition at line 44 of file Singleton.h.