10 std::map<std::string,Int_t>::iterator
11 tablePtr = fgTimegateTable.find(tableName);
12 if ( tablePtr == fgTimegateTable.end()
15 cout <<
"-I- FairDb:: Returning time gate " << fgTimegateTable[tableName]
16 <<
" for " << tableName << endl;
17 return fgTimegateTable[tableName];
27 if ( isTemporary ) { sql +=
"temporary "; }
31 sql +=
" SEQNO integer not null primary key,";
32 sql +=
" TIMESTART datetime not null,";
33 sql +=
" TIMEEND datetime not null,";
34 sql +=
" DETECTORMASK tinyint,";
35 sql +=
" SIMMASK tinyint,";
36 sql +=
" TASK integer,";
37 sql +=
" AGGREGATENO integer,";
38 sql +=
" CREATIONDATE datetime not null,";
39 sql +=
" INSERTDATE datetime not null ) ";
66 static string lo =
"1970-01-01 00:00:00";
67 static string hi =
"2038-01-19 03:14:07";
72 date defaultDate = {nowDate/10000, nowDate/100%100, nowDate%100,0,0,0};
73 date input = defaultDate;
75 istringstream
in(sqlDateTime);
76 in >> input.year >> dummy >> input.month >> dummy >> input.day
77 >> input.hour >> dummy >> input.min >> dummy >> input.sec;
79 if ( ok ) { *ok = kTRUE; }
80 if ( sqlDateTime < lo || sqlDateTime > hi ) {
81 if ( ok ) { *ok = kFALSE; }
83 static int bad_date_count = 0;
84 if ( ++bad_date_count <= 20 ) {
85 const char* last = (bad_date_count == 20) ?
"..Last Message.. " :
"";
87 cout<<
"-I- FairDB:: Bad date string: " << sqlDateTime
95 <<
"\n Outside range " << lo
96 <<
" to " << hi << last << endl;
104 input.hour,input.min,input.sec);
111 if ( timeGate > 15 && timeGate <= 100*24*60*60 ) {
112 fgTimegateTable[tableName] = timeGate;
113 cout <<
"-I- FairDb:: Setting time gate " << timeGate
114 <<
" for " << tableName << endl;
116 cout <<
"-I- FairDb:: Ignoring invalid time gate setting "
118 <<
" for " << tableName << endl;