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

lstat.h

00001 
00008 #ifndef LSTAT_H
00009 #define LSTAT_H
00010 
00011 #include <list>
00015 #include "ev.h"
00016 
00020 class LStat
00021 {
00022 private:
00023   static  list<LStat*> Statistics_;
00024   bool    fulldump_;
00025   double  n_;         
00026   double  maximum_;   
00027   double  minimum_;   
00028   double  m_;         
00029   double  variance_;  
00030   char*   name_;      
00031 
00032 protected: //Available only to derived classes.
00033   inline void SetN(double x)   {n_=x;};
00034   inline void SetMax(double x) {maximum_=x;};
00035   inline void SetMin(double x) {minimum_=x;};
00036   inline void SetVar(double x) {variance_=x;};
00037   inline void SetMean(double x){m_=x;};
00038   void        SetFullDump (bool d);
00039   
00040 public:
00046   LStat (char* n=0);
00051   virtual ~LStat (void);
00052 
00057   virtual void accum (double x); 
00061   double num (void);
00065   double maxval (void);
00069   double minval (void);
00073   double mean (void);
00077   double var (void);
00081   double sDev (void);
00085   double rMeanSq (void);
00090   void dumpStats (void);
00094   virtual void   reset(void);
00098   static void   resetAll(void);
00099 };
00100 
00104 class TStat : public LStat 
00105 {
00106 private:
00107   timeunits prevt_;  //Time instant of last sample
00108   double    prevv_;  //Value of last sample.
00109   EvSim* Sim_;       //Pointer to the simulator object, for 
00110   //clock recovery purposes
00111 
00112 public:
00119   TStat (char* n, EvSim* Sim);
00124   ~TStat(void);
00129   virtual void   accum (double x);
00133   virtual void   reset(void);
00134 };
00135 #endif
00136 

Generated on Fri Jan 19 15:35:17 2007 by  doxygen 1.4.2