xrootd
XrdMonHeader.hh
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* */
3 /* XrdMonHeader.hh */
4 /* */
5 /* (c) 2005 by the Board of Trustees of the Leland Stanford, Jr., University */
6 /* All Rights Reserved */
7 /* Produced by Jacek Becla for Stanford University under contract */
8 /* DE-AC02-76SF00515 with the Department of Energy */
9 /*****************************************************************************/
10 
11 // $Id$
12 
13 #ifndef XRDMONHEADER_HH
14 #define XRDMONHEADER_HH
15 
16 #include "XrdMon/XrdMonCommon.hh"
17 #include "XrdMon/XrdMonTypes.hh"
19 #include "XrdSys/XrdSysHeaders.hh"
20 
21 #include <sys/time.h>
22 #include <vector>
23 using std::ostream;
24 using std::vector;
25 
26 class XrdMonHeader {
27 public:
28  packet_t packetType() const { return _header.code; }
29  sequen_t seqNo() const { return _header.pseq; }
30  packetlen_t packetLen() const { return _header.plen; }
31  kXR_int32 stod() const { return _header.stod; }
32  bool stodChanged(senderid_t senderId) const;
33 
34  void decode(const char* packet);
35 
36 private:
38 
39  static vector<kXR_int32> _prevStod; // prevStod for each senderId
40 
41  friend ostream& operator<<(ostream& o,
42  const XrdMonHeader& header);
43 };
44 
45 #endif /* XRDMONHEADER_HH */
46