Go to the documentation of this file.
11 #ifndef GAUDIHIVE_HIVENUMBERS_H
12 #define GAUDIHIVE_HIVENUMBERS_H
22 #include <tbb/spin_rw_mutex.h>
60 #if !defined( GAUDI_V22_API ) || defined( G22_NEW_SVCLOCATOR )
69 operator bool()
const {
return m_generator != 0; }
73 double pop() {
return this->shoot(); }
76 if ( 0 != m_generator ) {
77 if ( m_buffer_index == 0 ) {
78 this->shootArray( m_buffer, m_buffer_size ).ignore( );
79 m_buffer_index = m_buffer_size - 1;
81 const double number = m_buffer[m_buffer_index];
89 if ( 0 != m_generator ) {
92 HiveNumbersMutex::scoped_lock lock( m_genMutex );
103 #endif // GAUDIHIVE_HIVENumbers_H
static HiveNumbersMutex m_genMutex
tbb::spin_rw_mutex HiveNumbersMutex
double operator()()
Operator () for the use within STL.
double pop()
Pop a new number from the buffer.
unsigned int m_buffer_index
IRndmGen * m_generator
Pointer to random number generator.
StatusCode shootArray(std::vector< double > &array, long num, long start=0)
Pop a new number from the buffer.
std::vector< double > m_buffer
const unsigned int m_buffer_size
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.
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
double shoot()
Pop a new number from the buffer.
constexpr static const auto FAILURE