BOSS 7.1.1
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 18 of file BesRndmGenSvc.cxx.

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

Referenced by BesRndmGenSvc::initialize().