TSK_DBI_Context.cxx File Reference

#include "TSK_DBI_Context.hxx"
#include <ctime>
Include dependency graph for TSK_DBI_Context.cxx:

Go to the source code of this file.

Functions

 ClassImp (TSK_DBI_Context) TSK_DBI_Context
std::ostream & operator<< (std::ostream &s, const TSK_DBI_Context &c)

Function Documentation

ClassImp ( TSK_DBI_Context   ) 

Definition at line 6 of file TSK_DBI_Context.cxx.

00008                                   {}

std::ostream& operator<< ( std::ostream &  s,
const TSK_DBI_Context c 
)

Definition at line 55 of file TSK_DBI_Context.cxx.

References TSK_DBI_Context::GetEvent(), TSK_DBI_Context::GetRun(), TSK_DBI_Context::GetSpill(), TSK_DBI_Context::GetSubRun(), TSK_DBI_Context::GetTimeStamp(), TSK_DBI_Context::Invalid, and TSK_DBI_Context::IsMC().

00055                                                                 {
00056     s << "<";
00057     bool valid = false;
00058     if (c.GetRun()!=TSK_DBI_Context::Invalid) {
00059         if (valid) s << " ";
00060         s << "R: " << c.GetRun();
00061         valid = true;
00062     }
00063     if (c.GetSubRun()!=TSK_DBI_Context::Invalid) {
00064         if (valid) s << " ";
00065         s << "SR: " << c.GetSubRun();
00066         valid = true;
00067     }
00068     if (c.GetEvent()!=TSK_DBI_Context::Invalid) {
00069         if (valid) s << " ";
00070         s << "E: " << c.GetEvent();
00071         valid = true;
00072     }
00073     if (c.GetSpill()!=TSK_DBI_Context::Invalid) {
00074         if (valid) s << " ";
00075         s << "S: " << c.GetSpill();
00076         valid = true;
00077     }
00078     if (c.GetTimeStamp()!=TSK_DBI_Context::Invalid) {
00079         if (valid) s << " ";
00080         std::time_t t = c.GetTimeStamp();
00081         char buf[64];
00082         std::strftime(buf,sizeof(buf),"%y/%m/%d %X %Z",std::gmtime(&t));
00083         s << "T: " << buf;
00084         valid = true;
00085     }
00086     if (valid) {
00087         if (c.IsMC()) s << " MC";
00088         else s << " DET";
00089     }
00090     else {
00091         s << "Invalid Context";
00092     }
00093     s << ">";
00094     return s;
00095 }

Here is the call graph for this function:


Generated on 11 Aug 2013 for SKDatabase by  doxygen 1.6.1