std C/C++ patch #10

David Scott Page page at cs.utexas.edu
Mon Apr 29 18:43:52 EDT 2002


Hi,

Parts of this one seem to have slipped away...

I moved the typedef RateEWMAX back into the private section, since
it didn't seem anything outside of its class access it.

The friend declarations are necessary since Counter and Stats are both
private and access each other.

--
Scott Page

-------------------------------------- 8< -----------------------------------
diff -Naur click-20020427/elements/ip/ipratemon.hh click-20020427a/elements/ip/ipratemon.hh
--- click-20020427/elements/ip/ipratemon.hh	Fri Apr 26 18:34:57 2002
+++ click-20020427a/elements/ip/ipratemon.hh	Sun Apr 28 03:38:50 2002
@@ -94,11 +94,15 @@
 
   int llrpc(unsigned, void *);
 
-  typedef RateEWMAX<5, 10, 2, IPRateMonitor_HalfSecondsTimer> MyEWMA;
-  
  private:
 
+  typedef RateEWMAX<5, 10, 2, IPRateMonitor_HalfSecondsTimer> MyEWMA;
+
+  struct Counter;
+  friend struct Counter;
   struct Stats;
+  friend struct Stats;
+
   struct Counter {
     // fwd_and_rev_rate.average[0] is forward rate
     // fwd_and_rev_rate.average[1] is reverse rate
@@ -125,7 +129,6 @@
 protected:
   
   // HACK! Functions for interaction between fold() and ~Stats()
-  friend struct Stats;
   void set_prev(Stats *s)                       { _prev_deleted = s; }
   void set_next(Stats *s)                       { _next_deleted = s; }
   void set_first(Stats *s)                      { _first = s; }



More information about the click mailing list