1 #ifndef GAUDIHIVE_HIVENUMBERS_H 2 #define GAUDIHIVE_HIVENUMBERS_H 12 #include "tbb/spin_rw_mutex.h" 48 #if !defined(GAUDI_V22_API) || defined(G22_NEW_SVCLOCATOR) 57 operator bool ()
const {
58 return m_generator != 0;
70 if ( 0 != m_generator ) {
71 if (m_buffer_index==0){
72 this->shootArray(m_buffer, m_buffer_size);
73 m_buffer_index=m_buffer_size-1;
75 const double number=m_buffer[m_buffer_index];
83 if ( 0 != m_generator ) {
86 HiveNumbersMutex::scoped_lock lock(m_genMutex);
99 #endif // GAUDIHIVE_HIVENumbers_H const unsigned int m_buffer_size
tbb::spin_rw_mutex_v3 HiveNumbersMutex
Definition of a interface for a generic random number generators.
std::vector< double > m_buffer
IRndmGen * m_generator
Pointer to random number generator.
Random Generator service interface definition Definition of a interface for a service to access rando...
This class is used for returning status codes from appropriate routines.
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
StatusCode shootArray(std::vector< double > &array, long num, long start=0)
Pop a new number from the buffer.
unsigned int m_buffer_index
virtual StatusCode shootArray(std::vector< double > &array, long howmany, long start=0) const =0
Multiple shots returning vector with random number according to specified distribution.
double pop()
Pop a new number from the buffer.
static HiveNumbersMutex m_genMutex
double shoot()
Pop a new number from the buffer.