Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

StatsMgr.h

Go to the documentation of this file.
00001 #ifndef STATSMGR_H 00002 #define STATSMGR_H 00003 00004 #include "Statistics.h" 00005 #include "RWlock.h" 00006 00007 00013 class StatsMgr 00014 { 00015 public: 00021 Statistics copyStats() ; 00022 00038 TSStats copyTSStats( 00039 StatisticsName name, 00040 int32 window_size = 0, 00041 TimeSec precision = 0, 00042 TimeStamp time_stamp = 0 00043 ) 00044 throw( Statistics::Error ); 00045 00063 TSStats copyTSStats( 00064 StatisticsName name, 00065 IDVect ids, 00066 int32 window_size = 0, 00067 TimeSec precision = 0, 00068 TimeStamp time_stamp = 0 00069 ) 00070 throw( Statistics::Error ); 00071 00089 FixLenTimeSeries copyStatistics( 00090 StatisticsName name, 00091 IDType id, 00092 int32 window_size = 0, 00093 TimeSec precision = 0, 00094 TimeStamp time_stamp = 0 00095 ) 00096 throw( Statistics::Error, TSStats::Error ); 00097 00109 void addTSStats ( 00110 StatisticsName name, 00111 int32 window_size, 00112 TimeSec precision, 00113 const IDVect &ids 00114 ); 00115 00116 bool hasTSStats ( StatisticsName name ); 00117 00126 void addEmptyStatistics ( 00127 StatisticsName name, 00128 IDType id 00129 ); 00130 00139 void deleteStatistics ( 00140 StatisticsName name, 00141 IDType id 00142 ); 00143 00147 void readLock() { _lock.readlock(); } 00148 00152 void readUnlock() { _lock.readunlock(); } 00153 00157 void writeLock() { _lock.writelock(); } 00158 00162 void writeUnlock() { _lock.writeunlock(); } 00163 00164 00170 const Statistics &getStats() const 00171 { return( _stats ); 00172 } 00173 00174 00180 Statistics &getStats() 00181 { return( _stats ); 00182 } 00183 00184 00185 private: 00186 /* 00187 * The data structure contains all statistics 00188 */ 00189 Statistics _stats; 00190 00191 /* 00192 * The RWLock that used to protect _stats 00193 */ 00194 RWLock _lock; 00195 }; 00196 00202 ostream &operator<< ( ostream &os, StatsMgr &stats_mgr ); 00203 00204 #endif // STATSMGR_H

Generated on Fri Nov 12 15:15:22 2004 for Borealis by doxygen 1.3.8