BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
DatabaseRecord.h
Go to the documentation of this file.
1#ifndef DatabaseRecord_h
2#define DatabaseRecord_h
3
4#include <map>
5#include <string>
6#include <vector>
7#include <cstdlib>
8
9class DatabaseRecord : public std::map<std::string, char*>
10{
11 public:
13
15 {
17 }
18
19 void clear(){
21 };
22
24 {
25 DatabaseRecord::iterator it;
26 for(it=this->begin(); it != this->end(); it++)
27 {
28 if((*it).second!=NULL)
29 {
30 delete[] (*it).second;
31 (*it).second = NULL;
32 }
33 }
34 erase(this->begin(),this->end());
35 }
36
37 int GetInt(std::string key)
38 {
39 DatabaseRecord::iterator it = find(key);
40 if(it==end())
41 return 0;
42 return atoi((*it).second);
43 }
44
45
46 double GetDouble(std::string key)
47 {
48 DatabaseRecord::iterator it = find(key);
49 if(it==end())
50 return 0;
51 return atof((*it).second);
52 }
53
54 long GetLong(std::string key)
55 {
56 DatabaseRecord::iterator it = find(key);
57 if(it==end())
58 return 0;
59 return atol((*it).second);
60 }
61
62 std::string GetString(std::string key)
63 {
64 // std::string str1;
65 DatabaseRecord::iterator it = find(key);
66 if(it==end())
67 return 0;
68 std::string str1((*it).second);
69 return str1;
70
71 }
72};
73
74class DatabaseRecordVector : public std::vector <DatabaseRecord*>
75{
76 public:
79 {
80 clear();
81 }
82
83 void clear(){
84 DatabaseRecordVector::iterator it;
85 for(it=this->begin(); it != this->end(); it++)
86 {
87 (*it)->DeleteObject();
88 }
89 erase(this->begin(),this->end());
90 }
91};
92
93#endif
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition: Taupair.h:42
double GetDouble(std::string key)
int GetInt(std::string key)
long GetLong(std::string key)
std::string GetString(std::string key)