TDbiSqlContext.cxx

Go to the documentation of this file.
00001 // $Id: TDbiSqlContext.cxx,v 1.1 2011/01/18 05:49:20 finch Exp $
00002 
00003 #include "TDbiSqlContext.hxx"
00004 #include <TSK_DBI_Log.hxx>
00005 #include <MsgFormat.h>
00006 using std::endl;
00007 
00008 ClassImp(TDbiSqlContext)
00009 
00010 
00011 //   Definition of static data members
00012 //   *********************************
00013 
00014 
00015 // Definition of member functions (alphabetical order)
00016 // ***************************************************
00017 
00018 //.....................................................................
00019 
00020 TDbiSqlContext::TDbiSqlContext(const std::string& ctxt) :
00021 TDbiString(ctxt),
00022 fIntervalType(kUndefined),
00023 fDetType(DbiDetector::kUnknown),
00024 fSimType(DbiSimFlag::kUnknown)
00025 {
00026 //
00027 //  Purpose:  Default constructor
00028 //
00029 //  Contact:   N. West
00030 //
00031 
00032 
00033   SK_DBI_Trace( "Creating TDbiSqlContext" << "  ");
00034 
00035 }
00036 //.....................................................................
00037 
00038 TDbiSqlContext::TDbiSqlContext(IntervalType interval,
00039                              TVldTimeStamp start,
00040                              TVldTimeStamp end,
00041                              DbiDetector::Detector_t det,
00042                              DbiSimFlag::SimFlag_t sim) :
00043 fIntervalType(interval),
00044 fTimeStart(start),
00045 fTimeEnd(end),
00046 fDetType(det),
00047 fSimType(sim)
00048 {
00049 //
00050 //  Purpose:  Main constructor
00051 //
00052 //  Contact:   N. West
00053 //
00054 
00055 
00056   SK_DBI_Trace( "Creating TDbiSqlContext" << "  ");
00057 
00058   switch (interval) {
00059 
00060   case kBefore:
00061     (*this) <<     "TIMEEND <= \'"   << start.AsString("s") << '\'';
00062     break;
00063 
00064   case kAfter:
00065     (*this) <<     "TIMESTART >= \'" << end.AsString("s")   << '\'';
00066     break;
00067 
00068   case kMisses:
00069     (*this) <<     "TIMESTART >= \'" << end.AsString("s")   << '\''
00070             << " or TIMEEND <= \'"   << start.AsString("s") << '\'';
00071     break;
00072 
00073   case kThroughout:
00074     (*this) <<     "TIMESTART <= \'" << start.AsString("s") << '\''
00075             << " and TIMEEND >= \'"  << end.AsString("s")   << '\'';
00076     break;
00077 
00078   case kWithin:
00079     (*this) <<     "TIMESTART >= \'" << start.AsString("s") << '\''
00080             << " and TIMEEND <= \'"  << end.AsString("s")   << '\'';
00081     break;
00082 
00083   case kOverlaps:
00084     (*this) <<     "TIMESTART < \'"  << end.AsString("s")   << '\''
00085             << " and TIMEEND > \'"   << start.AsString("s") << '\'';
00086     break;
00087 
00088   case kStarts:
00089     (*this) <<     "TIMESTART >= \'" << start.AsString("s") << '\''
00090             << " and TIMESTART < \'" << end.AsString("s")   << '\'';
00091     break;
00092 
00093   case kEnds:
00094     (*this) <<     "TIMEEND > \'"    << start.AsString("s") << '\''
00095             << " and TIMEEND <=  \'" << end.AsString("s")   << '\'';
00096     break;
00097 
00098   default:
00099     (*this) << " 1 = 0 "; //An impossible condition (hopefully)
00100   }
00101 
00102   (*this) << " and DetectorMask & " << static_cast<unsigned int>(fDetType)
00103           << " and SimMask & "      << static_cast<unsigned int>(fSimType);
00104 }
00105 
00106 
00107 //.....................................................................
00108 
00109 TDbiSqlContext::~TDbiSqlContext() {
00110 //
00111 //
00112 //  Purpose: Destructor
00113 //
00114 //  Contact:   N. West
00115 //
00116 
00117 
00118   SK_DBI_Trace( "Destroying TDbiSqlContext" << "  ");
00119 
00120 }
00121 
00122 
00123 /*    Template for New Member Function
00124 
00125 //.....................................................................
00126 
00127 TDbiSqlContext:: {
00128 //
00129 //
00130 //  Purpose:
00131 //
00132 //  Arguments:
00133 //    xxxxxxxxx    in    yyyyyy
00134 //
00135 //  Return:
00136 //
00137 //  Contact:   N. West
00138 //
00139 //  Specification:-
00140 //  =============
00141 //
00142 //  o
00143 
00144 //  Program Notes:-
00145 //  =============
00146 
00147 //  None.
00148 
00149 
00150 }
00151 
00152 */
00153 
00154 

Generated on 11 Aug 2013 for SKDatabase by  doxygen 1.6.1