xrootd

XrdMonSndDictEntry.hh

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*                                                                           */
00003 /*                          XrdMonSndDictEntry.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 
00013 #ifndef DICTENTRY_HH
00014 #define DICTENTRY_HH
00015 
00016 #include "XrdMon/XrdMonTypes.hh"
00017 #include "XrdSys/XrdSysHeaders.hh"
00018 
00019 #include <string>
00020 using std::ostream;
00021 using std::string;
00022 
00023 // <user>.<pid>:<fd>@<host>\npath
00024 class XrdMonSndDictEntry {
00025 public:
00026     struct CompactEntry {
00027         kXR_int32 id;
00028         string  others;  // <user>.<pid>:<fd>@<host>\n<path>
00029         kXR_int16 size() const {return 4 + others.size();}
00030     };
00031     
00032     XrdMonSndDictEntry(string u, 
00033                        kXR_int16 pid,
00034                        kXR_int16 fd,
00035                        string host,
00036                        string path,
00037                        kXR_int32 id);
00038 
00039     CompactEntry code();
00040     
00041 private:
00042     string  _user;
00043     kXR_int16 _pid;
00044     kXR_int16 _fd;
00045     string  _host;
00046     string  _path;
00047 
00048     kXR_int32 _myId;
00049 
00050     friend ostream& operator<<(ostream& o, 
00051                                const XrdMonSndDictEntry& m);
00052 };
00053 
00054 #endif /* DICTENTRY_HH */