[Sumover-dev] [svn commit] r4795 - in vic/branches/cc: rtp

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Thu May 6 14:46:34 BST 2010


Author: soohyunc
Date: Thu May  6 14:46:34 2010
New Revision: 4795

Modified:
   vic/branches/cc/cc/tfrc_rcvr.cpp
   vic/branches/cc/cc/tfrc_rcvr.h
   vic/branches/cc/cc/tfrc_sndr.cpp
   vic/branches/cc/cc/tfrc_sndr.h
   vic/branches/cc/rtp/transmitter.cpp
   vic/branches/cc/rtp/transmitter.h

Log:
added TFRC base class structure



Modified: vic/branches/cc/cc/tfrc_rcvr.cpp
==============================================================================
--- vic/branches/cc/cc/tfrc_rcvr.cpp	(original)
+++ vic/branches/cc/cc/tfrc_rcvr.cpp	Thu May  6 14:46:34 2010
@@ -31,7 +31,10 @@
  * $Id$
  */
 
-#ifndef vic_tfrc_sndr_h
-#define vic_tfrc_sndr_h
+#include "tfrc_rcvr.h"
 
-#endif
+// TfrcRcvr instance
+TfrcRcvr TfrcRcvr::instance_;
+
+TfrcRcvr::TfrcRcvr() {
+}

Modified: vic/branches/cc/cc/tfrc_rcvr.h
==============================================================================
--- vic/branches/cc/cc/tfrc_rcvr.h	(original)
+++ vic/branches/cc/cc/tfrc_rcvr.h	Thu May  6 14:46:34 2010
@@ -34,4 +34,21 @@
 #ifndef vic_tfrc_rcvr_h
 #define vic_tfrc_rcvr_h
 
+#include "tfrc_sndr.h"
+
+class TfrcRcvr {
+public:
+	TfrcRcvr();
+
+	// TfrcRcvr instance
+	static inline TfrcRcvr& instance() { return instance_; }
+
+protected:
+
+	static TfrcRcvr instance_;
+
+private:
+
+};
+
 #endif

Modified: vic/branches/cc/cc/tfrc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfrc_sndr.cpp	(original)
+++ vic/branches/cc/cc/tfrc_sndr.cpp	Thu May  6 14:46:34 2010
@@ -38,3 +38,9 @@
 
 #include "tfrc_sndr.h"
 #include "formula.h"
+
+// TfrcSndr instance
+TfrcSndr TfrcSndr::instance_;
+
+TfrcSndr::TfrcSndr() {
+}

Modified: vic/branches/cc/cc/tfrc_sndr.h
==============================================================================
--- vic/branches/cc/cc/tfrc_sndr.h	(original)
+++ vic/branches/cc/cc/tfrc_sndr.h	Thu May  6 14:46:34 2010
@@ -34,4 +34,29 @@
 #ifndef vic_tfrc_sndr_h
 #define vic_tfrc_sndr_h
 
+#include "bitmap.h"
+#include "cc_common.h"
+#include "cc_timer.h"
+
+class TfrcSndr;
+class Transmitter;
+
+// TFRC sender class
+class TfrcSndr {
+public:
+	// constructor
+	TfrcSndr();
+	virtual ~TfrcSndr() {};
+
+	// TfrcSndr instance
+	static inline TfrcSndr& instance() { return instance_; }
+
+protected:
+
+	static TfrcSndr instance_;
+
+private:
+
+};
+
 #endif

Modified: vic/branches/cc/rtp/transmitter.cpp
==============================================================================
--- vic/branches/cc/rtp/transmitter.cpp	(original)
+++ vic/branches/cc/rtp/transmitter.cpp	Thu May  6 14:46:34 2010
@@ -103,9 +103,12 @@
 	mh_.msg_iovlen = 2;
 
 	// CC related...
-	epc_ = 0;	// experimental packet counter
 	tfwc_sndr_ = TfwcSndr::instance();
 	tfwc_rcvr_ = TfwcRcvr::instance();
+	tfrc_sndr_ = TfrcSndr::instance();
+	tfrc_rcvr_ = TfrcRcvr::instance();
+	
+	epc_ = 0;	// experimental packet counter
 }
 
 /* Return time of day in seconds */

Modified: vic/branches/cc/rtp/transmitter.h
==============================================================================
--- vic/branches/cc/rtp/transmitter.h	(original)
+++ vic/branches/cc/rtp/transmitter.h	Thu May  6 14:46:34 2010
@@ -51,6 +51,8 @@
 #include "pktbuf-rtp.h"
 #include "cc/tfwc_sndr.h"
 #include "cc/tfwc_rcvr.h"
+#include "cc/tfrc_sndr.h"
+#include "cc/tfrc_rcvr.h"
 
 #define NOCC	100
 #define WBCC	101
@@ -62,6 +64,8 @@
 
 class TfwcSndr;
 class TfwcRcvr;
+class TfrcSndr;
+class TfrcRcvr;
 
 /*
  * The base object for performing the outbound path of
@@ -122,6 +126,8 @@
 
 	TfwcSndr tfwc_sndr_;
 	TfwcRcvr tfwc_rcvr_;
+	TfrcSndr tfrc_sndr_;
+	TfrcRcvr tfrc_rcvr_;
 
 protected:
 	void update(int nbytes);



More information about the Sumover-dev mailing list