// $Id: IDbiSqlContext.cxx,v 1.1 2011/01/18 05:49:20 finch Exp $ #include "IDbiSqlContext.hxx" #include #include using std::endl; ClassImp(COMET::IDbiSqlContext) // Definition of static data members // ********************************* // Definition of member functions (alphabetical order) // *************************************************** //..................................................................... COMET::IDbiSqlContext::IDbiSqlContext(const std::string& ctxt) : COMET::IDbiString(ctxt), fIntervalType(kUndefined), fDetType(COMET::DbiDetector::kUnknown), fSimType(COMET::DbiSimFlag::kUnknown) { // // Purpose: Default constructor // // Contact: N. West // COMETTrace( "Creating COMET::IDbiSqlContext" << " "); } //..................................................................... COMET::IDbiSqlContext::IDbiSqlContext(IntervalType interval, COMET::IVldTimeStamp start, COMET::IVldTimeStamp end, COMET::DbiDetector::Detector_t det, COMET::DbiSimFlag::SimFlag_t sim) : fIntervalType(interval), fTimeStart(start), fTimeEnd(end), fDetType(det), fSimType(sim) { // // Purpose: Main constructor // // Contact: N. West // COMETTrace( "Creating COMET::IDbiSqlContext" << " "); switch (interval) { case kBefore: (*this) << "TIMEEND <= \'" << start.AsString("s") << '\''; break; case kAfter: (*this) << "TIMESTART >= \'" << end.AsString("s") << '\''; break; case kMisses: (*this) << "TIMESTART >= \'" << end.AsString("s") << '\'' << " or TIMEEND <= \'" << start.AsString("s") << '\''; break; case kThroughout: (*this) << "TIMESTART <= \'" << start.AsString("s") << '\'' << " and TIMEEND >= \'" << end.AsString("s") << '\''; break; case kWithin: (*this) << "TIMESTART >= \'" << start.AsString("s") << '\'' << " and TIMEEND <= \'" << end.AsString("s") << '\''; break; case kOverlaps: (*this) << "TIMESTART < \'" << end.AsString("s") << '\'' << " and TIMEEND > \'" << start.AsString("s") << '\''; break; case kStarts: (*this) << "TIMESTART >= \'" << start.AsString("s") << '\'' << " and TIMESTART < \'" << end.AsString("s") << '\''; break; case kEnds: (*this) << "TIMEEND > \'" << start.AsString("s") << '\'' << " and TIMEEND <= \'" << end.AsString("s") << '\''; break; default: (*this) << " 1 = 0 "; //An impossible condition (hopefully) } (*this) << " and DetectorMask & " << static_cast(fDetType) << " and SimMask & " << static_cast(fSimType); } //..................................................................... COMET::IDbiSqlContext::~IDbiSqlContext() { // // // Purpose: Destructor // // Contact: N. West // COMETTrace( "Destroying COMET::IDbiSqlContext" << " "); } /* Template for New Member Function //..................................................................... COMET::IDbiSqlContext:: { // // // Purpose: // // Arguments: // xxxxxxxxx in yyyyyy // // Return: // // Contact: N. West // // Specification:- // ============= // // o // Program Notes:- // ============= // None. } */