xrootd
XrdMonSndTraceCache.hh
Go to the documentation of this file.
1 /*****************************************************************************/
2 /* */
3 /* XrdMonSndTraceCache.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 XRDMONSNDTRACECACHE_HH
14 #define XRDMONSNDTRACECACHE_HH
15 
16 #include "XrdMon/XrdMonCommon.hh"
17 #include "XrdMon/XrdMonSndDebug.hh"
19 #include <vector>
20 using std::vector;
21 
22 // The class responsible for caching data before it is sent
23 
25 
26 public:
27  static const unsigned int PACKETSIZE;
28  static const unsigned int NODATAELEMS;
29 
31 
32  bool bufferFull() const {
33  return _entries.size() >= NODATAELEMS-3; // save 3 spots for time entries
34  }
35 
36  int add(const XrdMonSndTraceEntry& de);
37  const vector<XrdMonSndTraceEntry>& getVector() { return _entries; }
38  void clear() { _entries.clear(); }
39 
40 private:
41  vector<XrdMonSndTraceEntry> _entries;
42 };
43 
44 #endif /* XRDMONSNDTRACECACHE_HH */