CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
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.

Macros

#define BOOST_NO_STRINGSTREAM   1 /*FIXME should come from boost config */
 

Functions

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

Macro Definition Documentation

◆ BOOST_NO_STRINGSTREAM

#define BOOST_NO_STRINGSTREAM   1 /*FIXME should come from boost config */

Definition at line 4 of file BesRndmGenSvc.cxx.

Function Documentation

◆ interpretSeeds()

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

Definition at line 15 of file BesRndmGenSvc.cxx.

16 {
17 bool status(false);
18 seed.clear();
19 //split the space-separated string in 3 words:
20 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
21 boost::char_separator<char> sep(" ");
22 tokenizer tokens(buffer, sep);
23 if (status = (distance(tokens.begin(), tokens.end()) == 32)) {
24 tokenizer::iterator token(tokens.begin());
25 stream = *token++;
26 try {
27 for(int i=0; i<31; i++) {
28 long tmp = boost::lexical_cast<long>(*token++);
29 seed.push_back(tmp);
30 }
31 } catch (boost::bad_lexical_cast e) {
32 status = false;
33 }
34 }
35 return status;
36}

Referenced by BesRndmGenSvc::initialize().