From 1d47a14c14bec17f87faa385e97b5479e182fbab Mon Sep 17 00:00:00 2001 From: Peter Barnes Date: Mon, 11 May 2020 20:12:51 +0000 Subject: [PATCH] Tag uses of NS_DEPRECATED by release --- src/buildings/helper/buildings-helper.h | 2 +- src/buildings/model/mobility-building-info.h | 2 +- src/core/doc/deprecated-example.h | 2 +- src/core/model/deprecated.h | 23 +++++++++++++++----- src/core/model/random-variable-stream.cc | 15 ------------- src/core/model/random-variable-stream.h | 7 ------ src/core/model/type-id.cc | 8 ------- src/core/model/type-id.h | 16 -------------- src/network/utils/data-rate.cc | 6 ----- src/network/utils/data-rate.h | 13 ----------- src/wscript | 3 +++ 11 files changed, 23 insertions(+), 74 deletions(-) diff --git a/src/buildings/helper/buildings-helper.h b/src/buildings/helper/buildings-helper.h index 64576b619..2119b8835 100644 --- a/src/buildings/helper/buildings-helper.h +++ b/src/buildings/helper/buildings-helper.h @@ -58,7 +58,7 @@ public: * \c MobilityBuildingInfo class. * */ - NS_DEPRECATED + NS_DEPRECATED_3_31 static void MakeMobilityModelConsistent (); /** * \brief Make the given mobility model consistent, by determining whether diff --git a/src/buildings/model/mobility-building-info.h b/src/buildings/model/mobility-building-info.h index e78fba9ce..e645dd127 100644 --- a/src/buildings/model/mobility-building-info.h +++ b/src/buildings/model/mobility-building-info.h @@ -81,7 +81,7 @@ public: * will satisfy the need to determine if a node is inside or outside * a building. */ - NS_DEPRECATED + NS_DEPRECATED_3_31 bool IsOutdoor (void); /** diff --git a/src/core/doc/deprecated-example.h b/src/core/doc/deprecated-example.h index 61e288081..4a949c122 100644 --- a/src/core/doc/deprecated-example.h +++ b/src/core/doc/deprecated-example.h @@ -30,7 +30,7 @@ * \deprecated This method will go away in future versions of ns-3. * See instead TheNewWay() */ -NS_DEPRECATED +NS_DEPRECATED_3_XX void SomethingUseful (void); /* * Do something more useful. diff --git a/src/core/model/deprecated.h b/src/core/model/deprecated.h index cfb7b7ff7..4f5b66cd3 100644 --- a/src/core/model/deprecated.h +++ b/src/core/model/deprecated.h @@ -39,13 +39,10 @@ * * For example, * \snippet src/core/doc/deprecated-example.h doxygen snippet + * + * To ease future maintenance please use the versioned forms: + * `NS_DEPRECATED_3_XX`, not the generic `NS_DEPRECATED` */ -/** - * \ingroup core - * \def NS_DEPRECATED_3_31 - * Tag for things deprecated in version ns-3.31. - */ - #if defined(__GNUC__) /* Test for GCC >= 4.1 */ #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) @@ -65,8 +62,22 @@ #define NS_DEPRECATED #endif +/** + * \ingroup core + * \def NS_DEPRECATED_3_31 + * Tag for things deprecated in version ns-3.31. + */ #ifdef NS_DEPRECATED #define NS_DEPRECATED_3_31 NS_DEPRECATED #endif +/** + * \ingroup core + * \def NS_DEPRECATED_3_30 + * Tag for things deprecated in version ns-3.30. + */ +#ifdef NS_DEPRECATED +#define NS_DEPRECATED_3_30 NS_DEPRECATED +#endif + #endif /* NS3_DEPRECATED_H */ diff --git a/src/core/model/random-variable-stream.cc b/src/core/model/random-variable-stream.cc index dbe86f023..aeb949a9a 100644 --- a/src/core/model/random-variable-stream.cc +++ b/src/core/model/random-variable-stream.cc @@ -483,21 +483,6 @@ ParetoRandomVariable::ParetoRandomVariable () NS_UNUSED (m_mean); } -double -ParetoRandomVariable::GetMean (void) const -{ - NS_LOG_FUNCTION (this); - - double mean = std::numeric_limits::infinity (); - - if (m_shape > 1) - { - mean = m_shape * m_scale / (m_shape - 1); - } - - return mean; -} - double ParetoRandomVariable::GetScale (void) const { diff --git a/src/core/model/random-variable-stream.h b/src/core/model/random-variable-stream.h index 9247032d0..f7531f5b6 100644 --- a/src/core/model/random-variable-stream.h +++ b/src/core/model/random-variable-stream.h @@ -652,13 +652,6 @@ public: */ ParetoRandomVariable (); - /** - * \brief Returns the mean parameter for the Pareto distribution returned by this RNG stream. - * \return The mean parameter for the Pareto distribution returned by this RNG stream. - */ - NS_DEPRECATED - double GetMean (void) const; - /** * \brief Returns the scale parameter for the Pareto distribution returned by this RNG stream. * \return The scale parameter for the Pareto distribution returned by this RNG stream. diff --git a/src/core/model/type-id.cc b/src/core/model/type-id.cc index 86c8cffab..d1727fa06 100644 --- a/src/core/model/type-id.cc +++ b/src/core/model/type-id.cc @@ -1107,14 +1107,6 @@ TypeId::GetTraceSource (std::size_t i) const return IidManager::Get ()->GetTraceSource (m_tid, i); } -TypeId -TypeId::AddTraceSource (std::string name, - std::string help, - Ptr accessor) -{ - return AddTraceSource (name, help, accessor, "(not yet documented)"); -} - TypeId TypeId::AddTraceSource (std::string name, std::string help, diff --git a/src/core/model/type-id.h b/src/core/model/type-id.h index f6a549a14..c2d3cb7f4 100644 --- a/src/core/model/type-id.h +++ b/src/core/model/type-id.h @@ -427,22 +427,6 @@ public: SupportLevel supportLevel = SUPPORTED, const std::string &supportMsg = ""); - /** - * Record a new TraceSource. - * - * \param [in] name The name of the new trace source - * \param [in] help Some help text which describes the purpose of this - * trace source. - * \param [in] accessor A pointer to a TraceSourceAccessor which can be - * used to connect/disconnect sinks to this trace source. - * \returns this TypeId instance. - * \deprecated - */ - NS_DEPRECATED - TypeId AddTraceSource (std::string name, - std::string help, - Ptr accessor); - /** * Record a new TraceSource. * diff --git a/src/network/utils/data-rate.cc b/src/network/utils/data-rate.cc index f3bf98b7f..5b65a4921 100644 --- a/src/network/utils/data-rate.cc +++ b/src/network/utils/data-rate.cc @@ -226,12 +226,6 @@ bool DataRate::operator != (const DataRate& rhs) const return m_bps!=rhs.m_bps; } -double DataRate::CalculateTxTime (uint32_t bytes) const -{ - NS_LOG_FUNCTION (this << bytes); - return static_cast(bytes)*8/m_bps; -} - Time DataRate::CalculateBytesTxTime (uint32_t bytes) const { NS_LOG_FUNCTION (this << bytes); diff --git a/src/network/utils/data-rate.h b/src/network/utils/data-rate.h index 2f20ca1ef..a128fedfb 100644 --- a/src/network/utils/data-rate.h +++ b/src/network/utils/data-rate.h @@ -178,19 +178,6 @@ public: */ Time CalculateBitsTxTime (uint32_t bits) const; - /** - * \brief Calculate transmission time - * - * Calculates the transmission time at this data rate - * \param bytes The number of bytes (not bits) for which to calculate - * \return The transmission time in seconds for the number of bytes specified - * - * \deprecated This method will go away in future versions of ns-3. - * See instead CalculateBytesTxTime() - */ - NS_DEPRECATED - double CalculateTxTime (uint32_t bytes) const; - /** * Get the underlying bitrate * \return The underlying bitrate in bits per second diff --git a/src/wscript b/src/wscript index 2569b2408..0bfb408fb 100644 --- a/src/wscript +++ b/src/wscript @@ -276,6 +276,9 @@ def ns3_python_bindings(bld): defines = list(pymod.env['DEFINES']) defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H']) defines.extend(['NS_DEPRECATED_3_31=', 'NS3_DEPRECATED_H']) + defines.extend(['NS_DEPRECATED_3_30=', 'NS3_DEPRECATED_H']) + defines.extend(['NS_DEPRECATED_3_27=', 'NS3_DEPRECATED_H']) + defines.extend(['NS_DEPRECATED_3_26=', 'NS3_DEPRECATED_H']) if Utils.unversioned_sys_platform()== 'win32': try: defines.remove('_DEBUG') # causes undefined symbols on win32