00001 /*****************************************************************************/ 00002 /* */ 00003 /* XrdMonSndStageEntry.hh */ 00004 /* */ 00005 /* (c) 2005 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$ 00012 #ifndef STAGEENTRY_HH 00013 #define STAGEENTRY_HH 00014 00015 #include "XrdMon/XrdMonTypes.hh" 00016 #include "XrdSys/XrdSysHeaders.hh" 00017 00018 #include <string> 00019 using std::ostream; 00020 using std::string; 00021 00022 // <user>.<pid>:<fd>@<host>\n&sz=bytes&tm=secs 00023 class XrdMonSndStageEntry { 00024 public: 00025 struct CompactEntry { 00026 kXR_int32 id; 00027 string others; // <user>.<pid>:<fd>@<host>\n&sz=bytes&tm=secs 00028 kXR_int16 size() const {return 4 + others.size();} 00029 }; 00030 00031 XrdMonSndStageEntry(string u, 00032 kXR_int16 pid, 00033 kXR_int16 fd, 00034 string host, 00035 string path, 00036 kXR_int32 bytes, 00037 kXR_int32 secs, 00038 kXR_int32 tod, 00039 kXR_int32 id); 00040 00041 CompactEntry code(); 00042 00043 private: 00044 string _user; 00045 kXR_int16 _pid; 00046 kXR_int16 _fd; 00047 string _host; 00048 string _path; 00049 kXR_int32 _bytes; 00050 kXR_int32 _secs; 00051 kXR_int32 _tod; 00052 00053 kXR_int32 _myId; 00054 00055 friend ostream& operator<<(ostream& o, 00056 const XrdMonSndStageEntry& m); 00057 }; 00058 00059 #endif /* STAGEENTRY_HH */