/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Control/BesServices/BesServices-00-00-11/src/BesRndmGenSvc.cxx File Reference

#include "BesServices/BesRndmGenSvc.h"
#include <boost/lexical_cast.hpp>
#include <boost/tokenizer.hpp>
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/IIncidentSvc.h"
#include "GaudiKernel/Incident.h"

Go to the source code of this file.

Defines

#define BOOST_NO_STRINGSTREAM   1

Functions

bool interpretSeeds (const string &buffer, string &stream, std::vector< unsigned long > &seed)


Define Documentation

#define BOOST_NO_STRINGSTREAM   1

Definition at line 4 of file BesRndmGenSvc.cxx.


Function Documentation

bool interpretSeeds ( const string buffer,
string stream,
std::vector< unsigned long > &  seed 
)

Definition at line 15 of file BesRndmGenSvc.cxx.

References genRecEmupikp::i.

Referenced by BesRndmGenSvc::initialize().

00016                                                                     {
00017   bool status(false);
00018   seed.clear();
00019   //split the space-separated string in 3 words:        
00020   typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
00021   boost::char_separator<char> sep(" ");
00022   tokenizer tokens(buffer, sep);                    
00023   if (status = (distance(tokens.begin(), tokens.end()) == 32)) {
00024     tokenizer::iterator token(tokens.begin());
00025     stream = *token++;
00026     try {
00027       for(int i=0; i<31; i++) {
00028         long tmp = boost::lexical_cast<long>(*token++);
00029         seed.push_back(tmp);
00030       }
00031     } catch (boost::bad_lexical_cast e) {
00032       status = false;
00033     }
00034   }
00035   return status;
00036 }


Generated on Tue Nov 29 23:14:53 2016 for BOSS_7.0.2 by  doxygen 1.4.7