Changeset 20887

Show
Ignore:
Timestamp:
10/30/07 15:11:37 (1 year ago)
Author:
patrick
Message:

Improve const correctness in vpr::BandwidthIOStatsStrategy and
vpr::SampleLimitedStatCollector?<T,bool>. Bumped the version to 2.1.8.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/vapor/ChangeLog

    r20816 r20887  
    11DATE       AUTHOR   CHANGE 
    22---------- -------- ----------------------------------------------------------- 
     32007-10-30 patrick  Improved const correctness in the statistics collection 
     4                    classes vpr::BandwidthIOStatsStrategy and 
     5                    vpr::SampleLimitedStatCollector<T,bool>. 
     6                    NEW VERSION: 2.1.8 
    372007-09-16 patrick  Removed polymorphism from vpr::BaseThread and vpr::Thread. 
    48                    NEW VERSION: 2.1.7 
  • juggler/trunk/modules/vapor/VERSION

    r20816 r20887  
     12.1.8-0 @10/30/2007 20:15:00 UTC@ 
    122.1.7-0 @09/16/2007 01:55:00 UTC@ 
    232.1.6-0 @09/16/2007 00:55:00 UTC@ 
  • juggler/trunk/modules/vapor/vpr/IO/Stats/BandwidthIOStatsStrategy.h

    r20260 r20887  
    7979   //@} 
    8080 
    81    vpr::SampleLimitedStatCollector<vpr::Uint32, true>& readStats() 
     81   const vpr::SampleLimitedStatCollector<vpr::Uint32, true>& readStats() const 
    8282   { 
    8383      return mReadStats; 
    8484   } 
    8585 
    86    vpr::SampleLimitedStatCollector<vpr::Uint32, true>& writeStats() 
     86   const vpr::SampleLimitedStatCollector<vpr::Uint32, true>& writeStats() const 
    8787   { 
    8888      return mWriteStats; 
  • juggler/trunk/modules/vapor/vpr/Util/SampleLimitedStatCollector.h

    r20261 r20887  
    104104 
    105105   /** Return Mean (value/second). */ 
    106    double getMean()
    107    double getInstAverage()
    108    double getSTA()
     106   double getMean() const
     107   double getInstAverage() const
     108   double getSTA() const
    109109   double getMaxSTA() const 
    110110   { 
     
    112112   } 
    113113 
    114    void print(std::ostream& out)
     114   void print(std::ostream& out) const
    115115 
    116116private: 
     
    132132template <class TYPE, bool TimeBased> 
    133133void SampleLimitedStatCollector<TYPE, TimeBased>::print(std::ostream& out) 
     134   const 
    134135{ 
    135136   out << "type: " << typeid(TYPE).name() << "   time based:" 
     
    145146       << std::endl 
    146147       << " --- data --- time --- " << std::endl; 
    147  
    148    for ( typename std::vector< std::pair<TYPE,vpr::Interval> >::iterator i = mSampleBuffer.begin(); 
    149          i!= mSampleBuffer.end(); 
    150          ++i ) 
     148   typedef typename std::vector< std::pair<TYPE,vpr::Interval> >::const_iterator 
     149      iter_type; 
     150   for ( iter_type i = mSampleBuffer.begin(); i != mSampleBuffer.end(); ++i ) 
    151151   { 
    152152      out << (*i).first << "   " << (*i).second.msec() << "ms\n"; 
     
    202202 
    203203template <class TYPE, bool TimeBased> 
    204 double SampleLimitedStatCollector<TYPE, TimeBased>::getMean() 
     204double SampleLimitedStatCollector<TYPE, TimeBased>::getMean() const 
    205205{ 
    206206   if(0 == mCurTotal) 
     
    231231 
    232232template <class TYPE, bool TimeBased> 
    233 double SampleLimitedStatCollector<TYPE, TimeBased>::getInstAverage() 
     233double SampleLimitedStatCollector<TYPE, TimeBased>::getInstAverage() const 
    234234{ 
    235235   double inst_average(0.0); 
     
    264264 
    265265template <class TYPE, bool TimeBased> 
    266 double SampleLimitedStatCollector<TYPE, TimeBased>::getSTA() 
     266double SampleLimitedStatCollector<TYPE, TimeBased>::getSTA() const 
    267267{ 
    268268   // Compute -- STA BANDWIDTH