#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 BOOST_NO_STRINGSTREAM 1 |
Definition at line 4 of file BesRndmGenSvc.cxx.
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 }