15 #define GAUDI_RANDOMGENSVC_RNDMGENSVC_CPP 41 status = setProperties();
47 if ( !engine && mgr ) {
49 engine = mgr->createService( TypeNameString( machName, m_engineName ) );
53 auto service = engine.as<
IService>();
54 if ( serial && service ) {
55 status = service->sysInitialize();
59 info() <<
"Using Random engine:" << m_engineName.value() <<
endmsg;
85 error() <<
"Cannot input serialize Generator settings!" <<
endmsg;
93 error() <<
"Cannot output serialize Generator settings!" <<
endmsg;
108 refpGen = pGen.get();
virtual StatusCode initialize(const IRndmGen::Param &par)=0
Initialize the generator.
constexpr static const auto FAILURE
StatusCode initialize() override
virtual StatusCode seeds(std::vector< long > &seeds) const =0
Allow to retrieve seeds.
StreamBuffer & serialize(StreamBuffer &str) override
IRndmGenSvc interface implementation.
StatusCode finalize() override
StatusCode finalize() override
Service override: finalization.
StatusCode start() override
virtual double rndm() const =0
Single shot returning single random number.
The ISvcManager is the interface implemented by the Service Factory in the Application Manager to sup...
The stream buffer is a small object collecting object data.
virtual const InterfaceID & type() const
Parameter's type.
Definition of a interface for a generic random number generators.
SmartIF< IRndmEngine > m_engine
Random number engine.
Random Generator service definition.
#define DECLARE_COMPONENT(type)
TYPE * get() const
Get interface pointer.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Helper class to parse a string of format "type/name".
General service interface definition.
This class is used for returning status codes from appropriate routines.
virtual StreamBuffer & serialize(StreamBuffer &str)=0
Input serialization from stream buffer.
double rndm() const override
Single shot returning single random number.
StatusCode generator(const IRndmGen::Param &par, IRndmGen *&refpGen) override
Retrieve a valid generator from the service.
virtual StatusCode setSeeds(const std::vector< long > &seeds)=0
Allow to set new seeds.
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
StatusCode setSeeds(const std::vector< long > &seeds) override
Allow to set new seeds.
StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const override
Multiple shots returning vector with flat random numbers.
const StatusCode & ignore() const
Ignore/check StatusCode.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode seeds(std::vector< long > &seeds) const override
Allow to get seeds.
Definition of a interface for a generic random number generator giving randomly distributed numbers i...
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
IRndmEngine * engine() override
Retrieve engine.
virtual StatusCode rndmArray(std::vector< double > &array, long howmany, long start=0) const =0
Multiple shots returning vector with flat random numbers.
SmartIF< ISerialize > m_serialize
Serialization interface of random number engine.
Object serialization interface definition.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.