Deprecate AddTraceSource without callback signature.
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Thu, 04 Dec 2014 10:02:36 -0800
changeset 11087 486e1b0c1df6
parent 11086 65914b1ed5b3
child 11088 50e89dc6d8b1
Deprecate AddTraceSource without callback signature.
CHANGES.html
src/core/model/type-id.cc
src/core/model/type-id.h
--- a/CHANGES.html	Thu Dec 04 10:02:01 2014 -0800
+++ b/CHANGES.html	Thu Dec 04 10:02:36 2014 -0800
@@ -76,10 +76,17 @@
   <li> The attribute 'Recievers' in class YansWifiPhy was misspelled, so
        this has been corrected to 'Receivers'.
   </li>
+  <li> We have now documented the callback function signatures
+       for all TracedSources, using an extra (fourth) argument to
+       TypeId::AddTraceSource to pass the fully-qualified name
+       of the signature typedef.  To ensure that future TraceSources
+       are similarly documented we have deprecated the three
+       argument version of AddTraceSource.
+  </li>	
 </ul>
 
 <h2>Changes to build system:</h2>
-<ul> 
+<ul>
   <li> waf was upgraded to version 1.7.16
   </li>
 </ul>
--- a/src/core/model/type-id.cc	Thu Dec 04 10:02:01 2014 -0800
+++ b/src/core/model/type-id.cc	Thu Dec 04 10:02:36 2014 -0800
@@ -641,7 +641,7 @@
   Singleton<IidManager>::Get ()->SetGroupName (m_tid, groupName);
   return *this;
 }
-TypeId
+TypeId 
 TypeId::SetSize (std::size_t size)
 {
   NS_LOG_FUNCTION (this << size);
@@ -806,8 +806,16 @@
 TypeId 
 TypeId::AddTraceSource (std::string name,
                         std::string help,
+                        Ptr<const TraceSourceAccessor> accessor)
+{
+  return AddTraceSource (name, help, accessor, "(not yet documented)");
+}
+
+TypeId 
+TypeId::AddTraceSource (std::string name,
+                        std::string help,
                         Ptr<const TraceSourceAccessor> accessor,
-                        std::string callback /* = "(not yet documented)" */)
+                        std::string callback)
 {
   NS_LOG_FUNCTION (this << name << help << accessor);
   Singleton<IidManager>::Get ()->AddTraceSource (m_tid, name, help, accessor, callback);
--- a/src/core/model/type-id.h	Thu Dec 04 10:02:01 2014 -0800
+++ b/src/core/model/type-id.h	Thu Dec 04 10:02:36 2014 -0800
@@ -25,6 +25,7 @@
 #include "trace-source-accessor.h"
 #include "attribute-helper.h"
 #include "callback.h"
+#include "deprecated.h"
 #include "hash.h"
 #include <string>
 #include <stdint.h>
@@ -46,7 +47,7 @@
  *
  * \internal
  *  See the discussion in IidManager about hash chaining of TypeId's.
-  */
+ */
 class TypeId
 {
 public:
@@ -327,8 +328,23 @@
    */
   TypeId AddTraceSource (std::string name,
                          std::string help,
+                         Ptr<const TraceSourceAccessor> accessor)
+    NS_DEPRECATED;
+  
+  /**
+   * \param name the name of the new trace source
+   * \param help some help text which describes the purpose of this
+   *        trace source.
+   * \param accessor a pointer to a TraceSourceAccessor which can be
+   *        used to connect/disconnect sinks to this trace source.
+   * \param callback fully qualified typedef name for the callback signature.
+   *        Generally this should begin with the "ns3::" namespace qualifier.
+   * \returns this TypeId instance.
+   */
+  TypeId AddTraceSource (std::string name,
+                         std::string help,
                          Ptr<const TraceSourceAccessor> accessor,
-                         std::string callback = "(not yet documented)" );
+                         std::string callback);
 
   TypeId HideFromDocumentation (void);