5 #include <onlmon/OnlMonBase.h>
6 #include <onlmon/OnlMonServer.h>
26 delete varmap.begin()->second;
33 std::cout <<
"OnlMonDB Name: " <<
ThisName << std::endl;
34 std::map<const std::string, OnlMonDBVar *>::const_iterator iter;
35 for (iter =
varmap.begin(); iter !=
varmap.end(); ++iter)
37 iter->second->Print();
45 transform(cpstring.begin(), cpstring.end(), cpstring.begin(), (int (*)(int)) tolower);
46 std::map<const std::string, OnlMonDBVar *>::const_iterator iter =
varmap.find(cpstring);
49 std::cout <<
"Variable " << varname <<
" allready registered in DB" << std::endl;
61 vararray[2] = varqual;
62 return SetVar(varname, vararray);
68 transform(cpstring.begin(), cpstring.end(), cpstring.begin(), (int (*)(int)) tolower);
69 std::map<const std::string, OnlMonDBVar *>::iterator iter =
varmap.find(cpstring);
72 iter->second->SetVar(var);
75 std::cout << __PRETTY_FUNCTION__ <<
" Could not find Variable " << varname <<
" in DB list" << std::endl;
97 std::cout <<
"Data Base not initialized, fix your code." << std::endl;
98 std::cout <<
"You need to call DBInit() after you registered your variables" << std::endl;
104 printf(
"error in dbcommit, ret code %d\n", iret);
108 std::map<const std::string, OnlMonDBVar *>::iterator iter;
109 for (iter =
varmap.begin(); iter !=
varmap.end(); ++iter)
111 iter->second->resetupdated();
118 static int ifirst = 1;
120 static time_t ticks = 0;
124 std::cout <<
"Data Base not initialized, fix your code." << std::endl;
125 std::cout <<
"You need to call DBInit() after you registered your variables" << std::endl;
130 ticks =
time(
nullptr);
131 ticks -= 2 * 30 * 24 * 60 * 60;
142 std::cout <<
"error in dbcommit" << std::endl;
146 std::map<const std::string, OnlMonDBVar *>::iterator iter;
147 for (iter =
varmap.begin(); iter !=
varmap.end(); ++iter)
149 iter->second->resetupdated();
160 int iret =
db->
GetVar(begin, end, varname, timestp, runnumber, var, varerr);
166 std::map<const std::string, OnlMonDBVar *>::iterator iter;
167 for (iter =
varmap.begin(); iter !=
varmap.end(); ++iter)
169 iter->second->resetupdated();