[Doxygen] Better documentation for NS_DEPRECATED
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Fri, 10 Jul 2015 18:13:14 -0700
changeset 11529 1c19d4a2be0f
parent 11528 18fe8ee3acbe
child 11530 65ddfcaae79a
[Doxygen] Better documentation for NS_DEPRECATED
doc/doxygen.conf
src/core/doc/deprecated-example.h
src/core/model/deprecated.h
src/core/model/type-id.h
src/network/utils/data-rate.h
--- a/doc/doxygen.conf	Wed Jul 08 17:36:16 2015 -0700
+++ b/doc/doxygen.conf	Fri Jul 10 18:13:14 2015 -0700
@@ -857,6 +857,7 @@
                          src/click/examples \
                          src/config-store/examples \
                          src/core/examples \
+			 src/core/doc \
                          src/csma/examples \
                          src/csma-layout/examples \
                          src/dsdv/examples \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/doc/deprecated-example.h	Fri Jul 10 18:13:14 2015 -0700
@@ -0,0 +1,38 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2015 Lawrence Livermore National Laboratory
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Authors: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
+ */
+
+/* 
+ * This is an example included in the doxygen-generated documentation
+ * for NS_DEPRECATED.
+ */
+
+// [doxygen snippet]
+/*
+ * Do something useful.
+ *
+ * \deprecated This method will go away in future versions of ns-3.
+ * See instead TheNewWay()
+ */
+void SomethingUseful (void); 
+/*
+ * Do something more useful.
+ */
+void TheNewWay (void);
+// [doxygen snippet]
--- a/src/core/model/deprecated.h	Wed Jul 08 17:36:16 2015 -0700
+++ b/src/core/model/deprecated.h	Fri Jul 10 18:13:14 2015 -0700
@@ -36,7 +36,11 @@
  *
  * When deprecating a feature, please update the documentation
  * with information for users on how to update their code.
+ *
+ * For example,
+ * \snippet src/core/doc/deprecated-example.h doxygen snippet
  */
+
 #if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ > 1)
 #define NS_DEPRECATED __attribute__ ((deprecated))
 #else
--- a/src/core/model/type-id.h	Wed Jul 08 17:36:16 2015 -0700
+++ b/src/core/model/type-id.h	Fri Jul 10 18:13:14 2015 -0700
@@ -331,6 +331,9 @@
    * \param callback fully qualified typedef name for the callback signature.
    *        Generally this should begin with the "ns3::" namespace qualifier.
    * \returns this TypeId instance.
+   *
+   * \deprecated This method will go away in future versions of ns-3.
+   * See instead AddTraceSource(std::string,std::string,Ptr<const TraceSourceAccessor>,std::string)
    */
   TypeId AddTraceSource (std::string name,
                          std::string help,
--- a/src/network/utils/data-rate.h	Wed Jul 08 17:36:16 2015 -0700
+++ b/src/network/utils/data-rate.h	Fri Jul 10 18:13:14 2015 -0700
@@ -184,6 +184,9 @@
    * 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()
    */
   double CalculateTxTime (uint32_t bytes) const NS_DEPRECATED;