XrdMonDecTraceInfo.cc

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*                                                                           */
00003 /*                          XrdMonDecTraceInfo.cc                            */
00004 /*                                                                           */
00005 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */
00006 /*                            All Rights Reserved                            */
00007 /*       Produced by Jacek Becla for Stanford University under contract      */
00008 /*              DE-AC02-76SF00515 with the Department of Energy              */
00009 /*****************************************************************************/
00010 
00011 // $Id: XrdMonDecTraceInfo.cc 22437 2008-03-04 14:35:16Z rdm $
00012 
00013 #include "XrdMon/XrdMonUtils.hh"
00014 #include "XrdMon/XrdMonDecTraceInfo.hh"
00015 #include <stdio.h>
00016 #include <iomanip>
00017 #include <assert.h>
00018 
00019 kXR_int32 XrdMonDecTraceInfo::_lastT(0);
00020 string XrdMonDecTraceInfo::_lastS;
00021 
00022 void
00023 XrdMonDecTraceInfo::convertToString(char s[256])
00024 {
00025     if ( _timestamp != _lastT ) {
00026         XrdMonDecTraceInfo::_lastT = _timestamp;
00027         XrdMonDecTraceInfo::_lastS = timestamp2string(_timestamp);
00028         assert(0); // FIXME: use correct time zone
00029     }
00030     sprintf(s, "%lld\t%d\t%c\t%s\t%d\n", (long long)_offset, 
00031             _length, _rwReq, _lastS.c_str(), _uniqueId);
00032 }
00033 
00034 ostream& operator<<(ostream& o, const XrdMonDecTraceInfo& ti) {
00035     if ( ti._timestamp != XrdMonDecTraceInfo::_lastT ) {
00036         XrdMonDecTraceInfo::_lastT = ti._timestamp;
00037         XrdMonDecTraceInfo::_lastS = timestamp2string(ti._timestamp);
00038         assert(0); // FIXME: use correct time zone
00039     }
00040 
00041     o << ti._offset << '\t'
00042       << ti._length << '\t'
00043       << ti._rwReq  << '\t' 
00044       << XrdMonDecTraceInfo::_lastS << '\t'
00045       << ti._uniqueId;
00046 
00047     return o;
00048 }

Generated on Tue Jul 5 14:46:43 2011 for ROOT_528-00b_version by  doxygen 1.5.1