BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
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 "EvtSymTable.hh"
22#include "EvtPatches.hh"
23#include "EvtReport.hh"
24#include <ctype.h>
25#include <fstream>
26#include <iostream>
27#include <stdlib.h>
28#include <string>
29using std::endl;
30using std::fstream;
31
32std::map<std::string, std::string> EvtSymTable::_symMap;
33
35
37
38void EvtSymTable::Define( const std::string& symname, std::string d ) {
39
40 if ( _symMap.find( symname ) != _symMap.end() )
41 {
42 report( INFO, "EvtGen" ) << "Symbol:" << symname.c_str()
43 << " redefined, old value:" << _symMap[symname].c_str()
44 << " new value:" << d.c_str() << endl;
45 _symMap[symname] = d;
46 return;
47 }
48
49 _symMap[symname] = d;
50 return;
51}
52
53// double EvtSymTable::Get(const std::string& symname,int& ierr) {
54std::string EvtSymTable::Get( const std::string& symname, int& ierr ) {
55
56 ierr = 0;
57
58 if ( _symMap.find( symname ) != _symMap.end() ) return _symMap[symname];
59
60 // If no matching symbol found just return the string
61
62 return symname;
63}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ INFO
Definition EvtReport.hh:52
static void Define(const std::string &name, std::string d)
static std::string Get(const std::string &name, int &ierr)