00001 /*****************************************************************************/ 00002 /* */ 00003 /* XrdMonSndTraceCache.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: XrdMonSndTraceCache.hh 22437 2008-03-04 14:35:16Z rdm $ 00012 00013 #ifndef XRDMONSNDTRACECACHE_HH 00014 #define XRDMONSNDTRACECACHE_HH 00015 00016 #include "XrdMon/XrdMonCommon.hh" 00017 #include "XrdMon/XrdMonSndDebug.hh" 00018 #include "XrdMon/XrdMonSndTraceEntry.hh" 00019 #include <vector> 00020 using std::vector; 00021 00022 // The class responsible for caching data before it is sent 00023 00024 class XrdMonSndTraceCache { 00025 00026 public: 00027 static const unsigned int PACKETSIZE; 00028 static const unsigned int NODATAELEMS; 00029 00030 XrdMonSndTraceCache(); 00031 00032 bool bufferFull() const { 00033 return _entries.size() >= NODATAELEMS-3; // save 3 spots for time entries 00034 } 00035 00036 int add(const XrdMonSndTraceEntry& de); 00037 const vector<XrdMonSndTraceEntry>& getVector() { return _entries; } 00038 void clear() { _entries.clear(); } 00039 00040 private: 00041 vector<XrdMonSndTraceEntry> _entries; 00042 }; 00043 00044 #endif /* XRDMONSNDTRACECACHE_HH */