xrootd
XrdMonDecTraceInfo.hh
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* */
3 /* XrdMonDecTraceInfo.hh */
4 /* */
5 /* (c) 2004 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 XRDMONDECTRACEINFO_HH
14 #define XRDMONDECTRACEINFO_HH
15 
16 #include "XrdMon/XrdMonCommon.hh"
17 
18 #include "XrdSys/XrdSysHeaders.hh"
19 
20 using std::ostream;
21 
23 public:
26  : _offset(o), _length(l), _rwReq(rw), _timestamp(t), _uniqueId(o) {}
27 
28  kXR_int32 timestamp() const {return _timestamp;} // for verification
29  bool isRead() const { return _rwReq == 'r'; }
30  length_t length() const { return _length; }
31  void setUniqueId(dictid_t id) { _uniqueId = id; }
32 
33  void convertToString(char s[256]);
34 
35 private:
38  char _rwReq;
41 
42  static kXR_int32 _lastT; // cache last, likely to be the same for many
43  static string _lastS; // traces, conversion to string not cheap
44 
45  friend ostream& operator<<(ostream& o, const XrdMonDecTraceInfo& t);
46 };
47 
48 // size: 8 + 4 + 1 + 4 --> aligned to 32
49 
50 #endif /* XRDMONDECTRACEINFO_HH */