BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtSymTable.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtSymTable.cc
12//
13// Description: Class to hold the symbols that are defined
14// in the DECAY files.
15// Modification history:
16//
17// RYD May 8, 1997 Module created
18//
19//------------------------------------------------------------------------
20//
21#include "EvtGenBase/EvtPatches.hh"
22#include <iostream>
23#include <fstream>
24#include <stdlib.h>
25#include <ctype.h>
26#include "EvtGenBase/EvtSymTable.hh"
27#include "EvtGenBase/EvtReport.hh"
28#include <string>
29using std::endl;
30using std::fstream;
31
32std::map<std::string,std::string> EvtSymTable::_symMap;
33
34
36
38
39}
40
41void EvtSymTable::Define(const std::string& symname,std::string d) {
42
43 if ( _symMap.find(symname)!=_symMap.end() ) {
44 report(INFO,"EvtGen") << "Symbol:"<<symname.c_str()<<
45 " redefined, old value:"<<_symMap[symname].c_str()<<" new value:"<<d.c_str()<<endl;
46 _symMap[symname]=d;
47 return;
48 }
49
50 _symMap[symname]=d;
51 return;
52}
53
54//double EvtSymTable::Get(const std::string& symname,int& ierr) {
55std::string EvtSymTable::Get(const std::string& symname,int& ierr) {
56
57 ierr=0;
58
59 if ( _symMap.find(symname)!=_symMap.end() ) return _symMap[symname];
60
61 // If no matching symbol found just return the string
62
63 return symname;
64}
65
ostream & report(Severity severity, const char *facility)
static void Define(const std::string &name, std::string d)
static std::string Get(const std::string &name, int &ierr)