Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

RndmGenSvc Class Reference

Random Generator service definition. More...

#include <RndmGenSvc.h>

Inheritance diagram for RndmGenSvc:

Service IRndmGenSvc IRndmEngine ISerialize List of all members.

Public Methods

StatusCode queryInterface (const IID& riid, void** ppvInterface)
 Query interface. More...

virtual StatusCode initialize ()
 Service override: initialisation. More...

virtual StatusCode finalize ()
 Service override: finalisation. More...

virtual StreamBuffer& serialize (StreamBuffer& str)
 Input serialisation from stream buffer. Restores the status of the generator engine. More...

virtual StreamBuffer& serialize (StreamBuffer& str) const
 Output serialisation to stream buffer. Saves the status of the generator engine. More...

virtual IRndmEngineengine ()
 Retrieve engine. More...

virtual StatusCode addFactory (const IRndmGenFactory* fac)
 Add a Generator factory. More...

virtual StatusCode removeFactory (const IID& type)
 Remove a Generator factory. More...

virtual StatusCode generator (const IRndmGen::Param& par, IRndmGen*& refpGen)
 Retrieve a valid generator from the service. More...

virtual double rndm () const
 Single shot returning single random number. More...

virtual StatusCode rndmArray ( std::vector<double>& array, long howmany, long start = 0) const
 Multiple shots returning vector with flat random numbers. More...

virtual StatusCode setSeeds (const std::vector<long>& seeds)
 Allow to set new seeds. More...

virtual StatusCode seeds (std::vector<long>& seeds) const
 Allow to get seeds. More...


Protected Methods

 RndmGenSvc (const std::string& name, ISvcLocator* svc)
 Standard Service constructor. More...

virtual ~RndmGenSvc ()
 Standard Service destructor. More...

StatusCode createGenerator (const IRndmGenFactory* pFactory, const IRndmGen::Param& par, IRndmGen*& refpGen)
 Create new Generator from known factory. More...

const IRndmGenFactory* factory (const IID& type)
StatusCode requestFactory (const IID& type, const IRndmGenFactory*& refpFactory)

Private Types

typedef std::vector<const
IRndmGenFactory*> 
FactoryContainer
 Container definition. More...


Private Attributes

IRndmEnginem_engine
 Random number engine. More...

ISerializem_serialize
 Serialization interface of random number engine. More...

FactoryContainer m_factories
 Container with factories. More...

std::string m_engineName
 Engine name. More...


Friends

class  SvcFactory< RndmGenSvc >

Detailed Description

Random Generator service definition.

Description: Definition of a interface for a service to access random generators according to predefined distributions. For more detailed explanations please see the interface definition.

Dependencies:

History :

    +---------+----------------------------------------------+--------+
    |    Date |                 Comment                      | Who    |
    +---------+----------------------------------------------+--------+
    | 21/04/99| Initial version.                             | MF     |
    +---------+----------------------------------------------+--------+
    
Author: M.Frank Version: 1.0

Definition at line 52 of file RndmGenSvc.h.


Member Typedef Documentation

typedef std::vector<const IRndmGenFactory*> RndmGenSvc::FactoryContainer [private]
 

Container definition.

Definition at line 58 of file RndmGenSvc.h.


Constructor & Destructor Documentation

RndmGenSvc::RndmGenSvc ( const std::string & name,
ISvcLocator * svc ) [protected]
 

Standard Service constructor.

Definition at line 39 of file RndmGenSvc.cpp.

RndmGenSvc::~RndmGenSvc ( ) [protected, virtual]
 

Standard Service destructor.

Definition at line 46 of file RndmGenSvc.cpp.


Member Function Documentation

StatusCode RndmGenSvc::addFactory ( const IRndmGenFactory * fac ) [virtual]
 

Add a Generator factory.

Definition at line 146 of file RndmGenSvc.cpp.

Referenced by generator().

StatusCode RndmGenSvc::createGenerator ( const IRndmGenFactory * pFactory,
const IRndmGen::Param & par,
IRndmGen *& refpGen ) [protected]
 

Create new Generator from known factory.

Definition at line 230 of file RndmGenSvc.cpp.

Referenced by generator().

IRndmEngine * RndmGenSvc::engine ( ) [virtual]
 

Retrieve engine.

Definition at line 141 of file RndmGenSvc.cpp.

Referenced by initialize().

const IRndmGenFactory * RndmGenSvc::factory ( const IID & type ) [protected]
 

Definition at line 195 of file RndmGenSvc.cpp.

Referenced by generator().

StatusCode RndmGenSvc::finalize ( ) [virtual]
 

Service override: finalisation.

Definition at line 106 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::generator ( const IRndmGen::Param & par,
IRndmGen *& refpGen ) [virtual]
 

Retrieve a valid generator from the service.

Definition at line 173 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::initialize ( ) [virtual]
 

Service override: initialisation.

Definition at line 68 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::queryInterface ( const IID & riid,
void ** ppvInterface )
 

Query interface.

Definition at line 50 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::removeFactory ( const IID & type ) [virtual]
 

Remove a Generator factory.

Definition at line 162 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::requestFactory ( const IID & type,
const IRndmGenFactory *& refpFactory ) [protected]
 

Definition at line 205 of file RndmGenSvc.cpp.

Referenced by generator().

double RndmGenSvc::rndm ( ) const [virtual]
 

Single shot returning single random number.

Definition at line 250 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::rndmArray ( std::vector< double >& array,
long howmany,
long start = 0 ) const [virtual]
 

Multiple shots returning vector with flat random numbers.

Parameters:
array   Array containing random numbers
howmany   fill 'howmany' random numbers into array
start   ... starting at position start
Returns:
StatusCode indicating failure or success.

Definition at line 263 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::seeds ( std::vector< long >& seeds ) const [virtual]
 

Allow to get seeds.

Definition at line 279 of file RndmGenSvc.cpp.

StreamBuffer & RndmGenSvc::serialize ( StreamBuffer & str ) const [virtual]
 

Output serialisation to stream buffer. Saves the status of the generator engine.

Definition at line 131 of file RndmGenSvc.cpp.

StreamBuffer & RndmGenSvc::serialize ( StreamBuffer & str ) [virtual]
 

Input serialisation from stream buffer. Restores the status of the generator engine.

Definition at line 121 of file RndmGenSvc.cpp.

StatusCode RndmGenSvc::setSeeds ( const std::vector< long >& seeds ) [virtual]
 

Allow to set new seeds.

Definition at line 271 of file RndmGenSvc.cpp.


Friends And Related Function Documentation

class SvcFactory [friend]
 

Only the factory is allowed to create this service.

Definition at line 55 of file RndmGenSvc.h.


Member Data Documentation

IRndmEngine * RndmGenSvc::m_engine [mutable, private]
 

Random number engine.

Definition at line 60 of file RndmGenSvc.h.

std::string RndmGenSvc::m_engineName [private]
 

Engine name.

Definition at line 66 of file RndmGenSvc.h.

FactoryContainer RndmGenSvc::m_factories [private]
 

Container with factories.

Definition at line 64 of file RndmGenSvc.h.

ISerialize * RndmGenSvc::m_serialize [mutable, private]
 

Serialization interface of random number engine.

Definition at line 62 of file RndmGenSvc.h.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 12:22:35 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000