[Ns-developers] More gratuitous API breakage in ns-3-dev
Gustavo Carneiro
gjcarneiro at gmail.com
Tue Jul 8 06:37:07 PDT 2008
I was re-syncing the ns-3-learning-bridge branch with ns-3-dev, and my
learning bridge example is not compiling any more:
../examples/csma-bridge.cc: In function 'int main(int, char**)':
../examples/csma-bridge.cc:80: error: 'class ns3::CsmaHelper' has no member
named 'SetChannelParameter'
../examples/csma-bridge.cc:81: error: 'class ns3::CsmaHelper' has no member
named 'SetChannelParameter'
Investigating the matter it is in bug 232. Just a terminology change, but
it so happens that it breaks API! Come on, is it so hard to provide
compatibility for this, something like below. You could remove the
compatibility APIs after a couple of ns-3 releases. It's very easy if the
deprecated APIs are correctly marked like in my patch.
This is just gratuitous API breakage and it makes me really sad about NS-3
future. I must express my concern that if following ns-3-dev is made too
difficult then people will tend to not use ns-3-dev din their evelopment
and, consequently, will be unable to contribute code back to it.
diff -r 73e90de6eb47 src/helper/csma-helper.h
--- a/src/helper/csma-helper.h Tue Jul 08 14:18:50 2008 +0100
+++ b/src/helper/csma-helper.h Tue Jul 08 14:31:41 2008 +0100
@@ -78,6 +78,17 @@
* by CsmaHelper::Install
*/
void SetChannelAttribute (std::string n1, const AttributeValue &v1);
+
+ /**
+ * \param n1 the name of the attribute to set
+ * \param v1 the value of the attribute to set
+ *
+ * Set these attributes on each ns3::CsmaChannel created
+ * by CsmaHelper::Install
+ *
+ * \deprecated renamed to SetChannelAttribute since NS 3.2.
+ */
+ void SetChannelParameter (std::string n1, const AttributeValue &v1) {
SetChannelAttribute (n1, v1); }
/**
* \param filename filename prefix to use for pcap files.
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
More information about the Ns-developers
mailing list