Merge
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Tue, 18 Aug 2015 16:59:27 -0700
changeset 11607 55e71a5cf604
parent 11595 18af0e64eee7 (current diff)
parent 11606 98fa74311b21 (diff)
child 11608 79f3e06b9420
Merge
src/test/ns3tcp/ns3tcp-loss-test-suite.cc
src/test/ns3tcp/ns3tcp-state-test-suite.cc
src/test/wscript
src/wifi/model/wifi-remote-station-manager.h
--- a/doc/doxygen.warnings.report.sh	Tue Aug 18 16:17:36 2015 -0700
+++ b/doc/doxygen.warnings.report.sh	Tue Aug 18 16:59:27 2015 -0700
@@ -25,21 +25,22 @@
 {
     cat <<-EOF
 	
-	Usage: $me [-eithv] [-f <log-file> | -l | -s] [-m <module> | -F <regex>]
+	Usage: $me [-eithv] [-s <log-file> | -l | -w] [-m <module>] [-f <regex>] [-F <regex>]
 	
 	Run doxygen to generate all errors; report error counts
 	by module and file.
 	
 	-i  Skip build and print-introspected-doxygen.
 	
-	-f  Skip doxygen run; use existing <log-file>.
-	-s  Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
+	-s  Skip doxygen run; use existing <log-file>.
+	-w  Skip doxygen run; use existing warnings log doc/$WARNINGSLOGFILE
 	-l  Skip doxygen run; use the normal doxygen log doc/$STANDARDLOGFILE
 		
 	-e  Filter out warnings from */examples/*
 	-t  Filter out warnings from */test/*
 	-m  Only include files matching src/<module>
-	-F  Only include files matching the <regex> 
+	-f  Only include files matching the <regex>
+	-F  Exclude files matching the <regex>
 
 	-v  Show the doxygen run output
 	-h  Print this usage message
@@ -120,41 +121,44 @@
 filter_examples=0
 filter_test=0
 filter_module=""
-filter_regex=""
+filter_in=""
+filter_out=""
 
 echo
 echo "$me:"
 
-while getopts :eitm:F:lF:svh option ; do
+while getopts :ef:F:hilm:s:tvw option ; do
 
     case $option in
 	
 	(e)  filter_examples=1        ;;
 
-	(i)  skip_intro=1              ;;
+	(f)  filter_in="$OPTARG"      ;;
+
+	(F)  filter_out="$OPTARG"     ;;
+
+	(h)  usage                    ;;
 	
-	(t)  filter_test=1            ;;
+	(i)  skip_intro=1             ;;
+	
+	(l)  use_standard=1           ;;
 
 	(m)  filter_module="$OPTARG"  ;;
 
-	(F)  filter_regex="$OPTARG"   ;;
-
-	(l)  use_standard=1            ;;
-
-	(f)  use_filearg=1
+	(s)  use_filearg=1
 	     logfile_arg="$OPTARG"
 	     ;;
 
-	(s)  use_filearg=1
-	     logfile_arg="$DIR/$WARNINGSLOGFILE"
-	     ;;
+	(t)  filter_test=1            ;;
 
 	(v)  verbosity=1
 	     exec 6>&1
 	     ;;
 
-	(h)  usage ;;
-	
+	(w)  use_filearg=1
+	     logfile_arg="$DIR/$WARNINGSLOGFILE"
+	     ;;
+	     
 	(:)  echo "$me: Missing argument to -$OPTARG" ; usage ;;
 	
 	(\?) echo "$me: Invalid option: -$OPTARG"     ; usage ;;
@@ -220,16 +224,16 @@
 # Log filters --------------------------
 #
 
-# Filter regular expression for -m and -F
+# Filter in regular expression for -m and -f
 filter_inRE=""
 if [ "$filter_module" != "" ] ; then
     filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}src/$filter_module"
 fi
-if [ "$filter_regex" != "" ] ; then
-    filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_regex"
+if [ "$filter_in" != "" ] ; then
+    filter_inRE="${filter_inRE:-}${filter_inRE:+\\|}$filter_in"
 fi
 
-# Filter regular expression for -e and -t
+# Filter out regular expression for -e, -t and -F
 filter_outRE=""
 if [ $filter_examples -eq 1 ]; then
     filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/examples/"
@@ -237,7 +241,11 @@
 if [ $filter_test -eq 1 ]; then
     filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}/test/"
 fi
+if [ "$filter_out" != "" ] ; then
+    filter_outRE="${filter_outRE:-}${filter_outRE:+\\|}$filter_out"
+fi
 
+#  Show the resulting filters
 if [ "${filter_inRE:-}" != "" ] ; then
     echo "Filtering in \"$filter_inRE\""
 fi
--- a/doc/tutorial/source/tracing.rst	Tue Aug 18 16:17:36 2015 -0700
+++ b/doc/tutorial/source/tracing.rst	Tue Aug 18 16:59:27 2015 -0700
@@ -255,7 +255,7 @@
 <http://www.parashift.com/c++-faq/pointers-to-members.html>`_ before
 writing code like this!)  What you get from this is a variable named
 simply ``pfi`` that is initialized to the value 0.  If you want to
-initialize this pointer to something meaningful, you have to have a
+initialize this pointer to something meaningful, you need to have a
 function with a matching signature.  In this case, you could provide a
 function that looks like::
 
@@ -370,7 +370,7 @@
         .AddTraceSource ("MyInteger",
                          "An integer value to trace.",
                          MakeTraceSourceAccessor (&MyObject::m_myInt),
-                         "ns3::Traced::Value::Int32Callback")
+                         "ns3::TracedValueCallback::Int32")
         ;
       return tid;
     }
@@ -399,11 +399,11 @@
 drives the callback process.  Any time the underlying value is changed
 the TracedValue mechanism will provide both the old and the new value
 of that variable, in this case an ``int32_t`` value.  The trace
-sink function for this TracedValue will need the signature
+sink function ``traceSink`` for this TracedValue will need the signature
 
 ::
 
-  void (* TracedValueCallback)(const int32_t oldValue, const int32_t newValue);
+  void (* traceSink)(int32_t oldValue, int32_t newValue);
 
 All trace sinks hooking this trace source must have this signature.
 We'll discuss below how you can determine the required callback
@@ -866,7 +866,7 @@
 The callback signature is given as a link to the relevant ``typedef``,
 where we find
 
-  ``typedef void (* CourseChangeCallback)(const std::string context, Ptr<const MobilityModel> * model);``
+  ``typedef void (* CourseChangeCallback)(std::string context, Ptr<const MobilityModel> * model);``
 					  
   **TracedCallback** signature for course change notifications.
 
@@ -932,7 +932,7 @@
 arguments::
 
   void
-  CourseChange (const std::string context, Ptr<const MobilityModel> model)
+  CourseChange (std::string context, Ptr<const MobilityModel> model)
   {
     ...
   }
@@ -942,7 +942,7 @@
 come up with::
 
   static void
-  CourseChange (const std::string path, Ptr<const MobilityModel> model)
+  CourseChange (std::string path, Ptr<const MobilityModel> model)
   {
     ...
   }
@@ -1204,11 +1204,12 @@
 ``TracedValue`` it will provide both the old and the new value of that
 variable, in this case an ``int32_t`` value.  By inspection of the
 ``TracedValue`` declaration, we know the trace sink function will have
-arguments ``(const int32_t oldValue, const int32_t newValue)``.  The
+arguments ``(int32_t oldValue, int32_t newValue)``.  The
 return type for a ``TracedValue`` callback function is always
-``void``, so the expected callback signature will be::
-
-  void (* TracedValueCallback)(const int32_t oldValue, const int32_t newValue);
+``void``, so the expected callback signature for the sink function
+``traceSink`` will be::
+
+  void (* traceSink)(int32_t oldValue, int32_t newValue);
 
 The ``.AddTraceSource`` in the ``GetTypeId`` method provides the
 "hooks" used for connecting the trace source to the outside world
@@ -1217,7 +1218,7 @@
 system, a help string, and the address of the TracedValue class data
 member.
 
-The final string argument, "ns3::Traced::Value::Int32" in the example,
+The final string argument, "ns3::TracedValueCallback::Int32" in the example,
 is the name of a ``typedef`` for the callback function signature.  We
 require these signatures to be defined, and give the fully qualified
 type name to ``AddTraceSource``, so the API documentation can link a
@@ -1271,12 +1272,12 @@
 
   * **CongestionWindow**: The TCP connnection's congestion window
 
-    Callback signature:  **ns3::Traced::Value::Uint322Callback**
+    Callback signature:  **ns3::TracedValueCallback::Uint32**
 
 Clicking on the callback ``typedef`` link we see the signature
 you now know to expect::
 
-    typedef void(* ns3::Traced::Value::Int32Callback)(const int32_t oldValue, const int32_t newValue)
+    typedef void(* ns3::TracedValueCallback::Int32)(int32_t oldValue, int32_t newValue)
 
 You should now understand this code completely.  If we have a pointer
 to the ``TcpNewReno``, we can ``TraceConnect`` to the
--- a/examples/tutorial/fourth.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/examples/tutorial/fourth.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -39,7 +39,7 @@
       .AddTraceSource ("MyInteger",
                        "An integer value to trace.",
                        MakeTraceSourceAccessor (&MyObject::m_myInt),
-                       "ns3::TracedValue::Int32Callback")
+                       "ns3::TracedValueCallback::Int32")
     ;
     return tid;
   }
--- a/src/applications/model/application-packet-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/applications/model/application-packet-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -45,11 +45,11 @@
                       "The packet plus its socket address that serve "
                       "as the output for this probe",
                       MakeTraceSourceAccessor (&ApplicationPacketProbe::m_output),
-                      "ns3::Packet::PacketAddressTracedCallback")
+                      "ns3::Packet::AddressTracedCallback")
     .AddTraceSource ( "OutputBytes",
                       "The number of bytes in the packet",
                       MakeTraceSourceAccessor (&ApplicationPacketProbe::m_outputBytes),
-                      "ns3::Packet::PacketSizeTracedCallback")
+                      "ns3::Packet::SizeTracedCallback")
   ;
   return tid;
 }
--- a/src/applications/model/packet-sink.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/applications/model/packet-sink.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -58,7 +58,7 @@
     .AddTraceSource ("Rx",
                      "A packet has been received",
                      MakeTraceSourceAccessor (&PacketSink::m_rxTrace),
-                     "ns3::Packet::PacketAddressTracedCallback")
+                     "ns3::Packet::AddressTracedCallback")
   ;
   return tid;
 }
--- a/src/click/model/ipv4-l3-click-protocol.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/click/model/ipv4-l3-click-protocol.h	Tue Aug 18 16:59:27 2015 -0700
@@ -264,8 +264,11 @@
 
   Ptr<Node> m_node;
 
+  /** \todo Remove; this TracedCallback is never invoked. */
   TracedCallback<const Ipv4Header &, Ptr<const Packet>, uint32_t> m_sendOutgoingTrace;
+  /** \todo Remove: this TracedCallback is never invoked. */
   TracedCallback<const Ipv4Header &, Ptr<const Packet>, uint32_t> m_unicastForwardTrace;
+  /** \todo This TracedCallback is invoked but not accessible. */
   TracedCallback<const Ipv4Header &, Ptr<const Packet>, uint32_t> m_localDeliverTrace;
 
   SocketList m_sockets;
--- a/src/core/model/callback.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/callback.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -85,7 +85,7 @@
 namespace ns3 {
 
 std::string
-CallbackBase::Demangle (const std::string& mangled)
+CallbackImplBase::Demangle (const std::string& mangled)
 {
   NS_LOG_FUNCTION (mangled);
 
--- a/src/core/model/callback.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/callback.h	Tue Aug 18 16:59:27 2015 -0700
@@ -148,6 +148,37 @@
    * \return \c true if we are equal
    */
   virtual bool IsEqual (Ptr<const CallbackImplBase> other) const = 0;
+  /** Get the type as a string. */
+  virtual std::string GetTypeid (void) const = 0;
+
+protected:
+  /**
+   * \param [in] mangled The mangled string
+   * \return The demangled form of mangled
+   */
+  static std::string Demangle (const std::string& mangled);
+  /**
+   * Helper to get the C++ typeid as a string.
+   *
+   * \tparam T The type of the argument.
+   * \param t The object.
+   * \returns The result of applying typeid to the argument.
+   */
+  template <typename T>
+  static std::string GetCppTypeid (void)
+  {
+    std::string typeName;
+    try
+      {
+        typeName = typeid (T).name ();
+        typeName = Demangle (typeName);
+      }
+    catch (const std::bad_typeid &e)
+      {
+        typeName = e.what ();
+      }
+    return typeName;
+  }
 };
 
 /**
@@ -169,6 +200,17 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (void) = 0;      //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with one argument. */
 template <typename R, typename T1>
@@ -176,6 +218,18 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1) = 0;        //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with two arguments. */
 template <typename R, typename T1, typename T2>
@@ -183,6 +237,19 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2) = 0;    //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with three arguments. */
 template <typename R, typename T1, typename T2, typename T3>
@@ -190,6 +257,20 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2, T3) = 0;  //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () + "," +
+      GetCppTypeid<T3> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with four arguments. */
 template <typename R, typename T1, typename T2, typename T3, typename T4>
@@ -197,6 +278,21 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2, T3, T4) = 0;  //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () + "," +
+      GetCppTypeid<T3> () + "," +
+      GetCppTypeid<T4> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with five arguments. */
 template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5>
@@ -204,6 +300,22 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2, T3, T4, T5) = 0;  //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () + "," +
+      GetCppTypeid<T3> () + "," +
+      GetCppTypeid<T4> () + "," +
+      GetCppTypeid<T5> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with six arguments. */
 template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
@@ -211,6 +323,23 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2, T3, T4, T5, T6) = 0;  //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () + "," +
+      GetCppTypeid<T3> () + "," +
+      GetCppTypeid<T4> () + "," +
+      GetCppTypeid<T5> () + "," +
+      GetCppTypeid<T6> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with seven arguments. */
 template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
@@ -218,6 +347,24 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2, T3, T4, T5, T6, T7) = 0;  //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () + "," +
+      GetCppTypeid<T3> () + "," +
+      GetCppTypeid<T4> () + "," +
+      GetCppTypeid<T5> () + "," +
+      GetCppTypeid<T6> () + "," +
+      GetCppTypeid<T7> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with eight arguments. */
 template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
@@ -225,6 +372,25 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2, T3, T4, T5, T6, T7, T8) = 0;  //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () + "," +
+      GetCppTypeid<T3> () + "," +
+      GetCppTypeid<T4> () + "," +
+      GetCppTypeid<T5> () + "," +
+      GetCppTypeid<T6> () + "," +
+      GetCppTypeid<T7> () + "," +
+      GetCppTypeid<T8> () +
+      ">";
+    return id;
+  }
 };
 /** CallbackImpl class with nine arguments. */
 template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
@@ -232,6 +398,26 @@
 public:
   virtual ~CallbackImpl () {}
   virtual R operator() (T1, T2, T3, T4, T5, T6, T7, T8, T9) = 0;  //!< Abstract operator
+  virtual std::string GetTypeid (void) const
+  {
+    return DoGetTypeid ();
+  }
+  static std::string DoGetTypeid (void)
+  {
+    static std::string id = "CallbackImpl<" +
+      GetCppTypeid<R> () + "," +
+      GetCppTypeid<T1> () + "," +
+      GetCppTypeid<T2> () + "," +
+      GetCppTypeid<T3> () + "," +
+      GetCppTypeid<T4> () + "," +
+      GetCppTypeid<T5> () + "," +
+      GetCppTypeid<T6> () + "," +
+      GetCppTypeid<T7> () + "," +
+      GetCppTypeid<T8> () + "," +
+      GetCppTypeid<T9> () +
+      ">";
+    return id;
+  }
 };
 /**@}*/
 
@@ -915,12 +1101,6 @@
    */
   CallbackBase (Ptr<CallbackImplBase> impl) : m_impl (impl) {}
   Ptr<CallbackImplBase> m_impl;         //!< the pimpl
-
-  /**
-   * \param [in] mangled The mangled string
-   * \return The demangled form of mangled
-   */
-  static std::string Demangle (const std::string& mangled);
 };
 
 /**
@@ -1216,8 +1396,8 @@
    *
    * \param [in] other Callback
    */
-  void Assign (const CallbackBase &other) {
-    DoAssign (other.GetImpl ());
+  bool Assign (const CallbackBase &other) {
+    return DoAssign (other.GetImpl ());
   }
 private:
   /** \return The pimpl pointer */
@@ -1231,7 +1411,8 @@
    * \return \c true if other can be dynamic_cast to my type
    */
   bool DoCheckType (Ptr<const CallbackImplBase> other) const {
-    if (other != 0 && dynamic_cast<const CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> *> (PeekPointer (other)) != 0)
+    if (other != 0 &&
+        dynamic_cast<const CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> *> (PeekPointer (other)) != 0)
       {
         return true;
       }
@@ -1249,17 +1430,18 @@
    *
    * \param [in] other Callback Ptr to adopt from
    */
-  void DoAssign (Ptr<const CallbackImplBase> other) {
+  bool DoAssign (Ptr<const CallbackImplBase> other) {
     if (!DoCheckType (other))
       {
-        const CallbackImplBase * otherRaw = PeekPointer (other);
-        Ptr<CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> > expected;
-        CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,T9> * expectedRaw = PeekPointer (expected);
-        NS_FATAL_ERROR ("Incompatible types. (feed to \"c++filt -t\" if needed)" << std::endl <<
-                        "got=" << Demangle ( typeid (*otherRaw).name () ) << std::endl <<
-                        "expected=" << Demangle ( typeid (*expectedRaw).name () ));
+        std::string othTid = other->GetTypeid ();
+        std::string myTid = CallbackImpl<R,T1,T2,T3,T4,T5,T6,T7,T8,T9>::DoGetTypeid ();
+        NS_FATAL_ERROR_CONT ("Incompatible types. (feed to \"c++filt -t\" if needed)" << std::endl <<
+                        "got=" << othTid << std::endl <<
+                        "expected=" << myTid);
+        return false;
       }
     m_impl = const_cast<CallbackImplBase *> (PeekPointer (other));
+    return true;
   }
 };
 
@@ -1740,7 +1922,8 @@
 {
   if (value.CheckType (m_value))
     {
-      value.Assign (m_value);
+      if (!value.Assign (m_value))
+        NS_FATAL_ERROR_NO_MSG ();
       return true;
     }
   return false;
--- a/src/core/model/fatal-error.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/fatal-error.h	Tue Aug 18 16:59:27 2015 -0700
@@ -52,57 +52,113 @@
  * on the attempt to execute the flush() function.
  */
 
+/**
+ * \ingroup fatal
+ *
+ * \brief Fatal error reporting implementation.
+ *
+ * When this macro is hit at runtime the error details will
+ * printed to \c stderr, including the supplied \c msg,
+ * and the file name and line number.  Optionally, if \c fatal is true,
+ * the macro will invoke \c std::terminate().  If \c fatal is false,
+ * the invoking function should return an error code to its caller,
+ * which is expected to call NS_FATAL_ERROR to cause termination.
+ *
+ * \param [in] msg The error message to print, if not empty.
+ * \param [in] fatal Call \c std::terminate() if true.
+ *
+ * This macro is enabled unconditionally in all builds,
+ * including debug and optimized builds.
+ */
+#define NS_FATAL_ERROR_IMPL_NO_MSG(fatal) \
+  do                                                      \
+    {                                                     \
+      std::cerr << "file=" << __FILE__ << ", line=" <<    \
+        __LINE__ << std::endl;                            \
+      ::ns3::FatalImpl::FlushStreams ();                  \
+      if (fatal) std::terminate ();                       \
+    }                                                     \
+  while (false)
+
+
+#define NS_FATAL_ERROR_IMPL(msg,fatal) \
+  do                                                    \
+    {                                                   \
+      std::cerr << "msg=\"" << msg << "\", ";           \
+      NS_FATAL_ERROR_IMPL_NO_MSG (fatal);               \
+    }                                                   \
+  while (false)
+
 
 /**
  * \ingroup fatal
  *
- * \brief Fatal error handling
+ * \brief Report a fatal error and terminate.
  *
  * When this macro is hit at runtime, details of filename
- * and line number is printed to stderr, and the program
- * is halted by calling std::terminate(). This will
+ * and line number are printed to \c stderr, and the program
+ * is halted by calling \c std::terminate(). This will
  * trigger any clean up code registered by
- * std::set_terminate (NS3 default is a stream-flushing
+ * \c std::set_terminate (NS3 default is a stream-flushing
  * code), but may be overridden.
  *
  * This macro is enabled unconditionally in all builds,
  * including debug and optimized builds.
  */
-#define NS_FATAL_ERROR_NO_MSG()                           \
-  do                                                      \
-    {                                                     \
-      std::cerr << "file=" << __FILE__ << ", line=" <<    \
-      __LINE__ << std::endl;                            \
-      ::ns3::FatalImpl::FlushStreams ();                  \
-      std::terminate ();                                  \
-    }                                                     \
-  while (false)
+#define NS_FATAL_ERROR_NO_MSG()       NS_FATAL_ERROR_IMPL_NO_MSG (true)
 
 /**
  * \ingroup fatal
  *
- * \brief Fatal error handling
+ * \brief Report a fatal error, deferring termination.
+ *
+ * When this macro is hit at runtime, details of filename
+ * and line number are printed to \c stderr, however the program
+ * is _not_ halted.  It is expected that the function using this
+ * macro will return an error code, and its caller will
+ * invoke NS_FATAL_ERROR(msg) triggering std::terminate().
+ *
+ * This macro is enabled unconditionally in all builds,
+ * including debug and optimized builds.
+ */
+#define NS_FATAL_ERROR_NO_MSG_CONT()  NS_FATAL_ERROR_IMPL_NO_MSG (false)
+
+/**
+ * \ingroup fatal
+ *
+ * \brief Report a fatal error with a message and terminate.
  *
  * \param [in] msg message to output when this macro is hit.
  *
  * When this macro is hit at runtime, the user-specified
- * error message is printed to stderr, followed by a call
+ * error message are printed to \c stderr, followed by a call
  * to the NS_FATAL_ERROR_NO_MSG() macro which prints the
- * details of filename and line number to stderr. The
- * program will be halted by calling std::terminate(),
+ * details of filename and line number to \c stderr. The
+ * program will be halted by calling \c std::terminate(),
  * triggering any clean up code registered by
- * std::set_terminate (NS3 default is a stream-flushing
+ * \c std::set_terminate (NS3 default is a stream-flushing
  * code, but may be overridden).
  *
  * This macro is enabled unconditionally in all builds,
  * including debug and optimized builds.
  */
-#define NS_FATAL_ERROR(msg)                             \
-  do                                                    \
-    {                                                   \
-      std::cerr << "msg=\"" << msg << "\", ";           \
-      NS_FATAL_ERROR_NO_MSG ();                          \
-    }                                                   \
-  while (false)
+#define NS_FATAL_ERROR(msg)           NS_FATAL_ERROR_IMPL (msg, true)
+
+/**
+ * \ingroup fatal
+ *
+ * \brief Report a fatal error with a message, deferring termination.
+ *
+ * When this macro is hit at runtime, details of filename
+ * and line number are printed to \c stderr, however the program
+ * is _not_ halted.  It is expected that the function using this
+ * macro will return an error code, and its caller will
+ * invoke NS_FATAL_ERROR(msg) triggering \c std::terminate().
+ *
+ * This macro is enabled unconditionally in all builds,
+ * including debug and optimized builds.
+ */
+#define NS_FATAL_ERROR_CONT(msg)      NS_FATAL_ERROR_IMPL (msg, false)
+
 
 #endif /* FATAL_ERROR_H */
--- a/src/core/model/nstime.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/nstime.h	Tue Aug 18 16:59:27 2015 -0700
@@ -531,15 +531,6 @@
    */
   TimeWithUnit As (const enum Unit unit) const;
 
-  /**
-   * TracedValue callback signature for Time
-   *
-   * \param [in] oldValue Original value of the traced variable
-   * \param [in] newValue New value of the traced variable
-   */
-  typedef void (* TracedValueCallback)(const Time oldValue,
-                                       const Time newValue);
-  
 private:
   /** How to convert between other units and the current unit. */
   struct Information
@@ -717,6 +708,17 @@
 
 };  // class Time
 
+namespace TracedValueCallback {
+  
+  /**
+   * TracedValue callback signature for Time
+   *
+   * \param [in] oldValue Original value of the traced variable
+   * \param [in] newValue New value of the traced variable
+   */
+  typedef void (* Time)(Time oldValue, Time newValue);
+  
+}  // namespace TracedValueCallback
 
 /// Force static initialization of Time
 static bool NS_UNUSED_GLOBAL (g_TimeStaticInit) = Time::StaticInit ();
--- a/src/core/model/object.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/object.h	Tue Aug 18 16:59:27 2015 -0700
@@ -275,9 +275,9 @@
    * to understand that this copy constructor will _not_
    * copy aggregated Objects, _i.e_, if your Object instance
    * is already aggregated to another Object and if you invoke
-   * this copy constructor, the new )bject instance will be
+   * this copy constructor, the new Object instance will be
    * a pristine standalone Object instance not aggregated to
-   * any other )bject. It is thus _your_ responsability
+   * any other Object. It is thus _your_ responsibility
    * as a caller of this method to do what needs to be done
    * (if it is needed) to ensure that the Object stays in a
    * valid state.
--- a/src/core/model/traced-callback.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/traced-callback.h	Tue Aug 18 16:59:27 2015 -0700
@@ -264,7 +264,8 @@
 TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::ConnectWithoutContext (const CallbackBase & callback)
 {
   Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> cb;
-  cb.Assign (callback);
+  if (!cb.Assign (callback))
+    NS_FATAL_ERROR_NO_MSG();
   m_callbackList.push_back (cb);
 }
 template<typename T1, typename T2,
@@ -275,7 +276,8 @@
 TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Connect (const CallbackBase & callback, std::string path)
 {
   Callback<void,std::string,T1,T2,T3,T4,T5,T6,T7,T8> cb;
-  cb.Assign (callback);
+  if (!cb.Assign (callback))
+    NS_FATAL_ERROR ("when connecting to " << path);
   Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> realCb = cb.Bind (path);
   m_callbackList.push_back (realCb);
 }
@@ -307,7 +309,8 @@
 TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Disconnect (const CallbackBase & callback, std::string path)
 {
   Callback<void,std::string,T1,T2,T3,T4,T5,T6,T7,T8> cb;
-  cb.Assign (callback);
+  if (!cb.Assign (callback))
+    NS_FATAL_ERROR ("when disconnecting from " << path);
   Callback<void,T1,T2,T3,T4,T5,T6,T7,T8> realCb = cb.Bind (path);
   DisconnectWithoutContext (realCb);
 }
--- a/src/core/model/traced-value.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/traced-value.h	Tue Aug 18 16:59:27 2015 -0700
@@ -56,13 +56,44 @@
  *        values used by the various model components.
  *
  * Additional callback function signatures defined elsewhere:
- *   - Time::TracedValueCallback
- *   - ns3::SequenceNumber32TracedValueCallback
+ *   - TracedValueCallback::Time
+ *   - TracedValueCallback::SequenceNumber32
+ *   - TracedValueCallback::LrWpanMacState
+ *   - TracedValueCallback::LrWpanPhyEnumeration
  */
 
 /**
  * \ingroup tracing
  *
+ * \brief TracedValue Callback function types.
+ */
+namespace TracedValueCallback {
+
+  /**
+   * \name TracedValueCallback Signatures for POD.
+   * @{
+   */
+  /**
+   *  TracedValue Callback signature for POD.
+   *
+   * \param [in] oldValue original value of the traced variable
+   * \param [in] newValue new value of the traced variable
+   */
+  typedef void (* Bool)  (bool     oldValue, bool     newValue);
+  typedef void (* Int8)  (int8_t   oldValue, int8_t   newValue);
+  typedef void (* Uint8) (uint8_t  oldValue, uint8_t  newValue);
+  typedef void (* Int16) (int16_t  oldValue, int16_t  newValue);
+  typedef void (* Uint16)(uint16_t oldValue, uint16_t newValue);
+  typedef void (* Int32) (int32_t  oldValue, int32_t  newValue);
+  typedef void (* Uint32)(uint32_t oldValue, uint32_t newValue);
+  typedef void (* Double)(double   oldValue, double   newValue);
+  /**@}*/
+}  // namespace TracedValueCallback
+
+  
+/**
+ * \ingroup tracing
+ *
  * \brief Trace classes with value semantics
  *
  * If you want to trace the change of value of a class or
@@ -225,23 +256,6 @@
   }
   /**@}*/
 
-  /**
-   *  TracedValue Callback signature for POD.
-   *
-   * \param [in] oldValue original value of the traced variable
-   * \param [in] newValue new value of the traced variable
-   * @{
-   */
-  typedef void (* BoolCallback)  (const bool     oldValue, const bool     newValue);
-  typedef void (* Int8Callback)  (const int8_t   oldValue, const int8_t   newValue);
-  typedef void (* Uint8Callback) (const uint8_t  oldValue, const uint8_t  newValue);
-  typedef void (* Int16Callback) (const int16_t  oldValue, const int16_t  newValue);
-  typedef void (* Uint16Callback)(const uint16_t oldValue, const uint16_t newValue);
-  typedef void (* Int32Callback) (const int32_t  oldValue, const int32_t  newValue);
-  typedef void (* Uint32Callback)(const uint32_t oldValue, const uint32_t newValue);
-  typedef void (* DoubleCallback)(const double   oldValue, const double   newValue);
-  /**@}*/
-
 private:
   /** The underlying value. */
   T m_v;
--- a/src/core/model/type-traits.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/model/type-traits.h	Tue Aug 18 16:59:27 2015 -0700
@@ -20,302 +20,581 @@
 #ifndef TYPE_TRAITS_H
 #define TYPE_TRAITS_H
 
+#include "ptr.h"
+
 /**
- * \file
- * \ingroup object
- * TypeTraits introspection template.
+ *  \file
+ *  \ingroup object
+ *  TypeTraits introspection template.
  */
 
-/** Type trait reference values */
+/**
+ * \ingroup object
+ *  Inspect a type to deduce its features.
+ *  \tparam T \deduced The type to inspect.
+ */
 template <typename T>
 struct TypeTraits
 {
 private:
-  struct NullType {};                             //!< Null value type traits
-  template <typename U> struct UnConst            //!< Non-const type
-  {
-    typedef U Result;                             //!< Non-const result type
-  };
-  template <typename U> struct UnConst<const U>   //!< Non-const template type traits
+  /** Null value type traits. */
+  struct NullType {};
+  /**
+   *  Not a const type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct UnConst
   {
-    typedef U Result;                             //!< Non-const result type
+    typedef U Result;                             /**< Non-const type.       */
   };
-  template <typename U> struct ReferenceTraits    //!< Non-reference type traits
+  /**
+   *  Const type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct UnConst<const U>
   {
-    enum { IsReference = 0                        /**< Non-reference value */ };
-    typedef U ReferencedType;                     //!< Non-referenced result type
+    typedef U Result;                             /**< Non-const type.       */
   };
-  template <typename U> struct ReferenceTraits<U&>//!< Reference type traits
-  {
-    enum { IsReference = 1                        /**< Reference value */ };
-    typedef U ReferencedType;                     //!< Referenced result type
-  };
-  template <typename U> struct PointerTraits      //!< Non-pointer type traits
+  /**
+   *  Not a reference type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct ReferenceTraits
   {
-    enum { IsPointer = 0};                        //!< Non-pointer value
-    typedef U PointeeType;                        //!< Non-pointer result type
+    /** Value. */  enum { IsReference = 0         /**< Not a reference type. */ };
+    typedef U ReferencedType;                     /**< Base type.            */
   };
-  template <typename U> struct PointerTraits<U *> //!< Pointer type traits
+  /**
+   *  Reference type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct ReferenceTraits<U&>
   {
-    enum { IsPointer = 1};                        //!< Pointer value
-    typedef U PointeeType;                        //!< Pointer result type
+    /** Value. */  enum { IsReference = 1         /**< Reference type.       */ };
+    typedef U ReferencedType;                     /**< Base type.            */
+  };
+  /**
+   *  Not a pointer type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct PointerTraits
+  {
+    /** Value. */  enum { IsPointer = 0,          /**< Not a pointer type.   */
+                          IsPtr = 0               /**< Not a Ptr type.       */};
+    typedef U PointeeType;                        /**< Base type.            */
   };
-  template <typename U> struct FunctionPtrTraits  //!< Non-function pointer type traits
+  /**
+   *  Pointer type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct PointerTraits<U *>
   {
-    enum { IsFunctionPointer = 0};                //!< Non-function pointer value
-    typedef NullType ReturnType;                  //!< Non-function pointer result type
+    /** Value. */  enum { IsPointer = 1,          /**< Pointer type.         */
+                          IsPtr = 0               /**< Not a Ptr type.       */};
+    typedef U PointeeType;                        /**< Pointee type.         */
+  };  
+  /**
+   *  Ptr type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct PointerTraits<ns3::Ptr<U> >
+  {
+    /** Value. */  enum { IsPointer = 0,          /**< Not a pointer type.   */
+                          IsPtr = 1               /**< Ptr type.             */};
+    typedef U PointeeType;                        /**< Pointee type.         */
   };
-  template <typename U> 
-  struct FunctionPtrTraits <U (*)(void)>          //!< Function pointer type traits
+  /**
+   * Base type, after removing \c &, \c * and \c const.
+   * \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct Base
   {
-    enum { IsFunctionPointer = 1};                //!< Function pointer value
-    enum { nArgs = 0};                            //!< Number of arguments
-    typedef U ReturnType;                         //!< Return type
+    typedef U Type;                               /**< Base type.            */
+  };
+  /**
+   * Base type, after removing \c &.
+   * \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct Base <U &>
+  {
+    typedef typename Base<U>::Type Type;          /**< Base type.            */
   };
-  template <typename U, typename V1> 
-  struct FunctionPtrTraits <U (*)(V1)>            //!< Function pointer type traits
-  {						                                   
-    enum { IsFunctionPointer = 1};                //!< Function pointer value	   
-    enum { nArgs = 1};				  //!< Number of arguments	   
-    typedef U ReturnType;			  //!< Return type
-    typedef V1 Arg1Type;                          //!< First argument type
+  /**
+   * Base type, after removing \c *.
+   * \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct Base <U *>
+  {
+    typedef typename Base<U>::Type  Type;         /**< Base type.            */
+  };
+  /**
+   * Base type, after removing \c const.
+   * \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct Base <const U >
+  {
+    typedef typename Base<U>::Type  Type;         /**< Base type.            */
   };
-  template <typename U, typename V1, typename V2> 
-  struct FunctionPtrTraits <U (*)(V1,V2)>         //!< Function pointer type traits
-  {						                                   
-    enum { IsFunctionPointer = 1};		  //!< Function pointer value	   
-    enum { nArgs = 2};				  //!< Number of arguments	   
-    typedef U ReturnType;			  //!< Return type
-    typedef V1 Arg1Type;			  //!< First argument type	   
-    typedef V2 Arg2Type;                          //!< Second argument type
+  /**
+   * Base type of a Ptr.
+   * \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct PtrBase
+  {
+    typedef U Type;                               /**< Base type.            */
+  };
+  /**
+   * Base type of a Ptr.
+   * \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct PtrBase <ns3::Ptr<U> >
+  {
+    typedef U Type;                               /**< Base type.            */
+  };
+  /**
+   *  Not a function pointer type.
+   *  \tparam U \deduced The type being inspected.
+   */
+  template <typename U> struct FunctionPtrTraits
+  {
+    /** Value. */  enum { IsFunctionPointer = 0   /**< Not a function pointer. */ };
+    typedef NullType ReturnType;                  /**< Return type.            */
   };
-  template <typename U, typename V1, typename V2,
-            typename V3> 
-  struct FunctionPtrTraits <U (*)(V1,V2,V3)>      //!< Function pointer type traits
-  {						                                   
-    enum { IsFunctionPointer = 1};		  //!< Function pointer value	   
-    enum { nArgs = 3};				  //!< Number of arguments	   
-    typedef U ReturnType;			  //!< Return type
-    typedef V1 Arg1Type;			  //!< First argument type	   
-    typedef V2 Arg2Type;			  //!< Second argument type	   
-    typedef V3 Arg3Type;                          //!< Third argument type
+  /**
+   *  Function pointer type.
+   *  \tparam U \deduced Return type.
+   */
+  template <typename U>
+  struct FunctionPtrTraits <U (*)(void)>
+  {
+    /** Value. */  enum { IsFunctionPointer = 1   /**< Function pointer.     */ };
+    /** Value. */  enum { nArgs = 0               /**< Number of arguments.  */ };
+    typedef U ReturnType;                         /**< Return type.          */
+  };
+  /**
+   *  Function pointer type.
+   *  \tparam U \deduced Return type.
+   *  \tparam V1 \deduced Argument type.
+   */
+  template <typename U,
+            typename V1>
+  struct FunctionPtrTraits <U (*)(V1)>
+  {
+    /** Value. */  enum { IsFunctionPointer = 1   /**< Function pointer.     */ };
+    /** Value. */  enum { nArgs = 1               /**< Number of arguments.  */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef V1 Arg1Type;                          /**< First argument type.  */
   };
-  template <typename U, typename V1, typename V2,
-            typename V3, typename V4> 
-  struct FunctionPtrTraits <U (*)(V1,V2,V3,V4)>   //!< Function pointer type traits
-  {						                                   
-    enum { IsFunctionPointer = 1};		  //!< Function pointer value	   
-    enum { nArgs = 4};				  //!< Number of arguments	   
-    typedef U ReturnType;			  //!< Return type
-    typedef V1 Arg1Type;			  //!< First argument type	   
-    typedef V2 Arg2Type;			  //!< Second argument type	   
-    typedef V3 Arg3Type;			  //!< Third argument type	   
-    typedef V4 Arg4Type;                          //!< Fourth argument type
+  /**
+   *  Function pointer type.
+   *  \tparam U \deduced Return type.
+   *  \tparam V1 \deduced Argument type.
+   *  \tparam V2 \deduced Argument type.
+   */
+  template <typename U,
+            typename V1, typename V2>
+  struct FunctionPtrTraits <U (*)(V1,V2)>
+  {
+    /** Value. */  enum { IsFunctionPointer = 1   /**< Function pointer.     */ };
+    /** Value. */  enum { nArgs = 2               /**< Number of arguments.  */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef V1 Arg1Type;                          /**< First argument type.  */
+    typedef V2 Arg2Type;                          /**< Second argument type. */
   };
-  template <typename U, typename V1, typename V2,
-            typename V3, typename V4,
-            typename V5> 
-  struct FunctionPtrTraits <U (*)(V1,V2,V3,V4,V5)>//!< Function pointer type traits
-  {						                                   
-    enum { IsFunctionPointer = 1};		  //!< Function pointer value	   
-    enum { nArgs = 5};				  //!< Number of arguments	   
-    typedef U ReturnType;			  //!< Return type
-    typedef V1 Arg1Type;			  //!< First argument type	   
-    typedef V2 Arg2Type;			  //!< Second argument type	   
-    typedef V3 Arg3Type;			  //!< Third argument type	   
-    typedef V4 Arg4Type;			  //!< Fourth argument type	   
-    typedef V5 Arg5Type;                          //!< Fifth argument type
+  /**
+   *  Function pointer type.
+   *  \tparam U \deduced Return type.
+   *  \tparam V1 \deduced Argument type.
+   *  \tparam V2 \deduced Argument type.
+   *  \tparam V3 \deduced Argument type.
+   */
+  template <typename U,
+            typename V1, typename V2, typename V3>
+  struct FunctionPtrTraits <U (*)(V1,V2,V3)>
+  {
+    /** Value. */  enum { IsFunctionPointer = 1   /**< Function pointer.     */ };
+    /** Value. */  enum { nArgs = 3               /**< Number of arguments.  */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef V1 Arg1Type;                          /**< First argument type.  */
+    typedef V2 Arg2Type;                          /**< Second argument type. */
+    typedef V3 Arg3Type;                          /**< Third argument type.  */
   };
-  template <typename U, typename V1, typename V2,
-            typename V3, typename V4,
-            typename V5, typename V6> 
-  struct FunctionPtrTraits <U (*)(V1,V2,V3,V4,V5,V6)>  //!< Function pointer type traits
-  {						                                        
-    enum { IsFunctionPointer = 1};		       //!< Function pointer value	   
-    enum { nArgs = 6};				       //!< Number of arguments	   
-    typedef U ReturnType;			       //!< Return type
-    typedef V1 Arg1Type;			       //!< First argument type	   
-    typedef V2 Arg2Type;			       //!< Second argument type	   
-    typedef V3 Arg3Type;			       //!< Third argument type	   
-    typedef V4 Arg4Type;			       //!< Fourth argument type	   
-    typedef V5 Arg5Type;			       //!< Fifth argument type	   
-    typedef V6 Arg6Type;                               //!< Sixth argument type
-  };
-  template <typename U> struct PtrToMemberTraits  //!< Pointer to member type traits
+  /**
+   *  Function pointer type.
+   *  \tparam U \deduced Return type.
+   *  \tparam V1 \deduced Argument type.
+   *  \tparam V2 \deduced Argument type.
+   *  \tparam V3 \deduced Argument type.
+   *  \tparam V4 \deduced Argument type.
+   */
+  template <typename U,
+            typename V1, typename V2, typename V3,
+            typename V4>
+  struct FunctionPtrTraits <U (*)(V1,V2,V3,V4)>
   {
-    enum { IsPointerToMember = 0};                //!< Non-pointer to member value
+    /** Value. */  enum { IsFunctionPointer = 1   /**< Function pointer.     */ };
+    /** Value. */  enum { nArgs = 4               /**< Number of arguments.  */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef V1 Arg1Type;                          /**< First argument type.  */
+    typedef V2 Arg2Type;                          /**< Second argument type. */
+    typedef V3 Arg3Type;                          /**< Third argument type.  */
+    typedef V4 Arg4Type;                          /**< Fourth argument type. */
   };
-  template <typename U, typename V> 
-  struct PtrToMemberTraits <U (V::*) (void)>      //!< Pointer to member type traits
+  /**
+   *  Function pointer type.
+   *  \tparam U \deduced Return type.
+   *  \tparam V1 \deduced Argument type.
+   *  \tparam V2 \deduced Argument type.
+   *  \tparam V3 \deduced Argument type.
+   *  \tparam V4 \deduced Argument type.
+   *  \tparam V5 \deduced Argument type.
+   */
+  template <typename U,
+            typename V1, typename V2, typename V3,
+            typename V4, typename V5>
+  struct FunctionPtrTraits <U (*)(V1,V2,V3,V4,V5)>
   {
-    enum { IsPointerToMember = 1};                //!< Pointer to member value
-    enum { nArgs = 0};                            //!< Number of arguments
-    typedef U ReturnType;                         //!< Return type
+    /** Value. */  enum { IsFunctionPointer = 1   /**< Function pointer.     */ };
+    /** Value. */  enum { nArgs = 5               /**< Number of arguments.  */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef V1 Arg1Type;                          /**< First argument type.  */
+    typedef V2 Arg2Type;                          /**< Second argument type. */
+    typedef V3 Arg3Type;                          /**< Third argument type.  */
+    typedef V4 Arg4Type;                          /**< Fourth argument type. */
+    typedef V5 Arg5Type;                          /**< Fifth argument type.  */
   };
-  template <typename U, typename V> 
-  struct PtrToMemberTraits <U (V::*) (void) const>//!< Pointer to const member type traits
-  {						                                    
-    enum { IsPointerToMember = 1};		  //!< Pointer to member value	    
-    enum { nArgs = 0};				  //!< Number of arguments	    
-    typedef U ReturnType;			  //!< Return type		    
+  /**
+   *  Function pointer type.
+   *  \tparam U \deduced Return type.
+   *  \tparam V1 \deduced Argument type.
+   *  \tparam V2 \deduced Argument type.
+   *  \tparam V3 \deduced Argument type.
+   *  \tparam V4 \deduced Argument type.
+   *  \tparam V5 \deduced Argument type.
+   *  \tparam V6 \deduced Argument type.
+   */
+  template <typename U,
+            typename V1, typename V2, typename V3,
+            typename V4, typename V5, typename V6>
+  struct FunctionPtrTraits <U (*)(V1,V2,V3,V4,V5,V6)>
+  {
+    /** Value. */  enum { IsFunctionPointer = 1   /**< Function pointer.     */ };
+    /** Value. */  enum { nArgs = 6               /**< Number of arguments.  */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef V1 Arg1Type;                          /**< First argument type.  */
+    typedef V2 Arg2Type;                          /**< Second argument type. */
+    typedef V3 Arg3Type;                          /**< Third argument type.  */
+    typedef V4 Arg4Type;                          /**< Fourth argument type. */
+    typedef V5 Arg5Type;                          /**< Fifth argument type.  */
+    typedef V6 Arg6Type;                          /**< Sixth argument type.  */
   };
-  template <typename U, typename V,typename W1> 
-  struct PtrToMemberTraits <U (V::*) (W1)>        //!< Pointer to member type traits
-  {						                                    
-    enum { IsPointerToMember = 1};		  //!< Pointer to member value	    
-    enum { nArgs = 1};				  //!< Number of arguments	    
-    typedef U ReturnType;			  //!< Return type		    
-    typedef W1 Arg1Type;                          //!< First argument type
+  /**
+   *  Not a pointer to member type.
+   *  \tparam U \deduced Return type.
+   */
+  template <typename U> struct PtrToMemberTraits
+  {
+    /** Value. */  enum { IsPointerToMember = 0   /**< Not a pointer to member.    */ };
   };
-  template <typename U, typename V,typename W1> 
-  struct PtrToMemberTraits <U (V::*) (W1) const>  //!< Pointer to const member type traits
-  {						                                    	  
-    enum { IsPointerToMember = 1};		  //!< Pointer to member value	    	  
-    enum { nArgs = 1};				  //!< Number of arguments	    	  
-    typedef U ReturnType;			  //!< Return type		    	  
-    typedef W1 Arg1Type;                          //!< First argument type
+  /**
+   *  Pointer to member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   */
+  template <typename U,  typename V>
+  struct PtrToMemberTraits <U (V::*) (void)>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 0               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.                */
+  };
+  /**
+   *  Pointer to const member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   */
+  template <typename U,  typename V>
+  struct PtrToMemberTraits <U (V::*) (void) const>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 0               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.                */
   };
-  template <typename U, typename V,typename W1, typename W2> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2)>     //!< Pointer to member type traits
-  {						                                    
-    enum { IsPointerToMember = 1};		  //!< Pointer to member value	    
-    enum { nArgs = 2};				  //!< Number of arguments	    
-    typedef U ReturnType;			  //!< Return type		    
-    typedef W1 Arg1Type;			  //!< First argument type	    
-    typedef W2 Arg2Type;			  //!< Second argument type	    
+  /**
+   *  Pointer to member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1>
+  struct PtrToMemberTraits <U (V::*) (W1)>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 1               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
   };
-  template <typename U, typename V,typename W1, typename W2> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2) const>  //!< Pointer to const member type traits
-  {						                                       	  
-    enum { IsPointerToMember = 1};		     //!< Pointer to member value	    	  
-    enum { nArgs = 2};				     //!< Number of arguments	    	  
-    typedef U ReturnType;			     //!< Return type		    	  
-    typedef W1 Arg1Type;			     //!< First argument type		  
-    typedef W2 Arg2Type;			     //!< Second argument type		  
+  /**
+   *  Pointer to const member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1>
+  struct PtrToMemberTraits <U (V::*) (W1) const>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 1               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3)>  //!< Pointer to member type traits
-  {						                                    
-    enum { IsPointerToMember = 1};		  //!< Pointer to member value	    
-    enum { nArgs = 3};				  //!< Number of arguments	    
-    typedef U ReturnType;			  //!< Return type		    
-    typedef W1 Arg1Type;			  //!< First argument type	    
-    typedef W2 Arg2Type;			  //!< Second argument type	    
-    typedef W3 Arg3Type;			  //!< Third argument type	    
+  /**
+   *  Pointer to member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2>
+  struct PtrToMemberTraits <U (V::*) (W1,W2)>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 2               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+  };
+  /**
+   *  Pointer to const member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2>
+  struct PtrToMemberTraits <U (V::*) (W1,W2) const>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 2               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3) const>  //!< Pointer to const member type traits
-  {							                                  	     
-    enum { IsPointerToMember = 1};			//!< Pointer to member value	     
-    enum { nArgs = 3};					//!< Number of arguments	    	     
-    typedef U ReturnType;				//!< Return type		    	     
-    typedef W1 Arg1Type;				//!< First argument type		     
-    typedef W2 Arg2Type;				//!< Second argument type		     
-    typedef W3 Arg3Type;				//!< Third argument type		     
+  /**
+   *  Pointer to member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3)>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 3               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3, typename W4> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4)>  //!< Pointer to member type traits
-  {						                                       
-    enum { IsPointerToMember = 1};		     //!< Pointer to member value	    
-    enum { nArgs = 4};				     //!< Number of arguments	    
-    typedef U ReturnType;			     //!< Return type		    
-    typedef W1 Arg1Type;			     //!< First argument type	    
-    typedef W2 Arg2Type;			     //!< Second argument type	    
-    typedef W3 Arg3Type;			     //!< Third argument type	    
-    typedef W4 Arg4Type;			     //!< Fourth argument type	    
+  /**
+   *  Pointer to const member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3) const>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 3               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3, typename W4> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4) const>  //!< Pointer to const member type traits
-  {							                                     	
-    enum { IsPointerToMember = 1};			   //!< Pointer to member value	     	
-    enum { nArgs = 4};					   //!< Number of arguments	    	
-    typedef U ReturnType;				   //!< Return type		    	
-    typedef W1 Arg1Type;				   //!< First argument type		
-    typedef W2 Arg2Type;				   //!< Second argument type		
-    typedef W3 Arg3Type;				   //!< Third argument type		
-    typedef W4 Arg4Type;				   //!< Fourth argument type		
+  /**
+   *  Pointer to member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   *  \tparam W4 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3,
+            typename W4>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4)>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 4               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
+    typedef W4 Arg4Type;                          /**< Fourth argument type. */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3, typename W4,
-            typename W5> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5)>  //!< Pointer to member type traits
-  {							                                  
-    enum { IsPointerToMember = 1};			//!< Pointer to member value      
-    enum { nArgs = 5};					//!< Number of arguments	       
-    typedef U ReturnType;				//!< Return type		       
-    typedef W1 Arg1Type;				//!< First argument type	       
-    typedef W2 Arg2Type;				//!< Second argument type	       
-    typedef W3 Arg3Type;				//!< Third argument type	       
-    typedef W4 Arg4Type;				//!< Fourth argument type	       
-    typedef W5 Arg5Type;				//!< Fifth argument type	       
+  /**
+   *  Pointer to const member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   *  \tparam W4 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3,
+            typename W4>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4) const>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 4               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
+    typedef W4 Arg4Type;                          /**< Fourth argument type. */
+  };
+  /**
+   *  Pointer to member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   *  \tparam W4 \deduced Argument type.
+   *  \tparam W5 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3,
+            typename W4, typename W5>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5)>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 5               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
+    typedef W4 Arg4Type;                          /**< Fourth argument type. */
+    typedef W5 Arg5Type;                          /**< Fifth argument type.  */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3, typename W4,
-            typename W5> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5) const>  //!< Pointer to const member type traits
-  {							                                        	   
-    enum { IsPointerToMember = 1};			      //!< Pointer to member value	     	   
-    enum { nArgs = 5};					      //!< Number of arguments	    	   
-    typedef U ReturnType;				      //!< Return type		    	   
-    typedef W1 Arg1Type;				      //!< First argument type		   
-    typedef W2 Arg2Type;				      //!< Second argument type		   
-    typedef W3 Arg3Type;				      //!< Third argument type		   
-    typedef W4 Arg4Type;				      //!< Fourth argument type		   
-    typedef W5 Arg5Type;				      //!< Fifth argument type		   
+  /**
+   *  Pointer to const member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   *  \tparam W4 \deduced Argument type.
+   *  \tparam W5 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3,
+            typename W4, typename W5>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5) const>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 5               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
+    typedef W4 Arg4Type;                          /**< Fourth argument type. */
+    typedef W5 Arg5Type;                          /**< Fifth argument type.  */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3, typename W4,
-            typename W5, typename W6> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6)>  //!< Pointer to member type traits
-  {							                                     
-    enum { IsPointerToMember = 1};			   //!< Pointer to member value      
-    enum { nArgs = 6};					   //!< Number of arguments	  
-    typedef U ReturnType;				   //!< Return type		  
-    typedef W1 Arg1Type;				   //!< First argument type	  
-    typedef W2 Arg2Type;				   //!< Second argument type	  
-    typedef W3 Arg3Type;				   //!< Third argument type	  
-    typedef W4 Arg4Type;				   //!< Fourth argument type	  
-    typedef W5 Arg5Type;				   //!< Fifth argument type	  
-    typedef W6 Arg6Type;				   //!< Sixth argument type	  
+  /**
+   *  Pointer to member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   *  \tparam W4 \deduced Argument type.
+   *  \tparam W5 \deduced Argument type.
+   *  \tparam W6 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3,
+            typename W4, typename W5, typename W6>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6)>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 6               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
+    typedef W4 Arg4Type;                          /**< Fourth argument type. */
+    typedef W5 Arg5Type;                          /**< Fifth argument type.  */
+    typedef W6 Arg6Type;                          /**< Sixth argument type.  */
   };
-  template <typename U, typename V,
-            typename W1, typename W2,
-            typename W3, typename W4,
-            typename W5, typename W6> 
-  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6) const>  //!< Pointer to const member type traits
-  {								                                         
-    enum { IsPointerToMember = 1};				 //!< Pointer to member value	      
-    enum { nArgs = 6};						 //!< Number of arguments	    	      
-    typedef U ReturnType;					 //!< Return type		    	      
-    typedef W1 Arg1Type;					 //!< First argument type		      
-    typedef W2 Arg2Type;					 //!< Second argument type		      
-    typedef W3 Arg3Type;					 //!< Third argument type		      
-    typedef W4 Arg4Type;					 //!< Fourth argument type		      
-    typedef W5 Arg5Type;					 //!< Fifth argument type		      
-    typedef W6 Arg6Type;					 //!< Sixth argument type		      
+  /**
+   *  Pointer to const member function.
+   *  \tparam U \deduced Return type.
+   *  \tparam V \deduced Class type.
+   *  \tparam W1 \deduced Argument type.
+   *  \tparam W2 \deduced Argument type.
+   *  \tparam W3 \deduced Argument type.
+   *  \tparam W4 \deduced Argument type.
+   *  \tparam W5 \deduced Argument type.
+   *  \tparam W6 \deduced Argument type.
+   */
+  template <typename U,  typename V,
+            typename W1, typename W2, typename W3,
+            typename W4, typename W5, typename W6>
+  struct PtrToMemberTraits <U (V::*) (W1,W2,W3,W4,W5,W6) const>
+  {
+    /** Value. */  enum { IsPointerToMember = 1   /**< Pointer to member function. */ };
+    /** Value. */  enum { nArgs = 6               /**< Number of arguments.        */ };
+    typedef U ReturnType;                         /**< Return type.          */
+    typedef W1 Arg1Type;                          /**< First argument type.  */
+    typedef W2 Arg2Type;                          /**< Second argument type. */
+    typedef W3 Arg3Type;                          /**< Third argument type.  */
+    typedef W4 Arg4Type;                          /**< Fourth argument type. */
+    typedef W5 Arg5Type;                          /**< Fifth argument type.  */
+    typedef W6 Arg6Type;                          /**< Sixth argument type.  */
   };
 
 public:
-  typedef typename UnConst<T>::Result NonConstType;                    //!< Non-const type
-  typedef typename ReferenceTraits<T>::ReferencedType ReferencedType;  //!< Referenced type
-  typedef typename PointerTraits<T>::PointeeType PointeeType;          //!< Pointee type
-  enum { IsPointerToMember = PtrToMemberTraits<T>::IsPointerToMember}; //!< Pointer to member predicate
-  enum { IsPointer = PointerTraits<T>::IsPointer};                     //!< Pointer predicate
-  enum { IsReference = ReferenceTraits<T>::IsReference};               //!< Reference predicate
-  enum { IsFunctionPointer = FunctionPtrTraits<T>::IsFunctionPointer}; //!< Function pointer predicate
-  typedef PtrToMemberTraits<T> PointerToMemberTraits;                  //!< Pointer to member traits type
-  typedef FunctionPtrTraits<T> FunctionPointerTraits;                  //!< Function pointer traits
+  /** Not a const type. */
+  typedef typename UnConst<T>::Result NonConstType;
+  /** Referenced type. */
+  typedef typename ReferenceTraits<T>::ReferencedType ReferencedType;
+  /** Pointee type. */
+  typedef typename PointerTraits<T>::PointeeType PointeeType;
+  /** Base type, after removing \c &, \c * and \c const. */
+  typedef typename Base<T>::Type BaseType;
+  /** Ptr base type. */
+  typedef typename PtrBase<T>::Type PtrBaseType;
+  /** Predicates. */
+  enum {
+    /** Pointer to member predicate. */
+    IsPointerToMember = PtrToMemberTraits<T>::IsPointerToMember,
+    /** Pointer predicate. */
+    IsPointer = PointerTraits<T>::IsPointer,
+    /** Ptr predicate. */
+    IsPtr = PointerTraits<T>::IsPtr,
+    /** Reference predicate. */
+    IsReference = ReferenceTraits<T>::IsReference,
+    /** Function pointer predicate. */
+    IsFunctionPointer = FunctionPtrTraits<T>::IsFunctionPointer
+  };
+  /** Pointer to member traits type. */
+  typedef PtrToMemberTraits<T> PointerToMemberTraits;
+  /** Function pointer traits. */
+  typedef FunctionPtrTraits<T> FunctionPointerTraits;
 };
 
 
--- a/src/core/test/attribute-test-suite.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/test/attribute-test-suite.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -195,7 +195,7 @@
                      MakeValueClassTestChecker ())
       .AddTraceSource ("Source1", "help test",
                        MakeTraceSourceAccessor (&AttributeObjectTest::m_intSrc1),
-                       "ns3::TracedValue::Int8Callback")
+                       "ns3::TracedValueCallback::Int8")
       .AddTraceSource ("Source2", "help text",
                        MakeTraceSourceAccessor (&AttributeObjectTest::m_cb),
                        "ns3::AttributeObjectTest::NumericTracedCallback")
@@ -283,7 +283,7 @@
   TracedValue<int8_t> m_intSrc1;
   TracedValue<int8_t> m_intSrc2;
 
-  typedef void (* NumericTracedCallback) (const double, const int, const float);
+  typedef void (* NumericTracedCallback) (double, int, float);
   TracedCallback<double, int, float> m_cb;
   TracedValue<ValueClassTest> m_valueSrc;
   Ptr<Derived> m_ptr;
--- a/src/core/test/config-test-suite.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/core/test/config-test-suite.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -98,7 +98,7 @@
                    MakeIntegerChecker<int16_t> ())
     .AddTraceSource ("Source", "XX",
                      MakeTraceSourceAccessor (&ConfigTestObject::m_trace),
-                     "ns3::TracedValue::Int16Callback")
+                     "ns3::TracedValueCallback::Int16")
   ;
   return tid;
 }
--- a/src/dsr/model/dsr-options.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/dsr/model/dsr-options.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -84,7 +84,7 @@
     .AddTraceSource ("Rx",
                      "Receive DSR packet.",
                      MakeTraceSourceAccessor (&DsrOptions::m_rxPacketTrace),
-                     "ns3::Packet::TracedCallback")
+                     "ns3::dsr::DsrOptionSRHeader::TracedCallback")
   ;
   return tid;
 }
--- a/src/dsr/model/dsr-routing.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/dsr/model/dsr-routing.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -343,7 +343,7 @@
     .AddTraceSource ("Tx",
                      "Send DSR packet.",
                      MakeTraceSourceAccessor (&DsrRouting::m_txPacketTrace),
-                     "ns3::DsrOptionSRHeader::TracedCallback")
+                     "ns3::dsr::DsrOptionSRHeader::TracedCallback")
     .AddTraceSource ("Drop",
                      "Drop DSR packet",
                      MakeTraceSourceAccessor (&DsrRouting::m_dropTrace),
--- a/src/energy/model/basic-energy-harvester.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/energy/model/basic-energy-harvester.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -55,11 +55,11 @@
   .AddTraceSource ("HarvestedPower",
                    "Harvested power by the BasicEnergyHarvester.",
                    MakeTraceSourceAccessor (&BasicEnergyHarvester::m_harvestedPower),
-                   "ns3::TracedValue::DoubleCallback")
+                   "ns3::TracedValueCallback::Double")
   .AddTraceSource ("TotalEnergyHarvested",
                    "Total energy harvested by the harvester.",
                    MakeTraceSourceAccessor (&BasicEnergyHarvester::m_totalEnergyHarvestedJ),
-                   "ns3::TracedValue::DoubleCallback")
+                   "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/energy/model/basic-energy-source.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/energy/model/basic-energy-source.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -69,7 +69,7 @@
     .AddTraceSource ("RemainingEnergy",
                      "Remaining energy at BasicEnergySource.",
                      MakeTraceSourceAccessor (&BasicEnergySource::m_remainingEnergyJ),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/energy/model/li-ion-energy-source.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/energy/model/li-ion-energy-source.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -106,7 +106,7 @@
     .AddTraceSource ("RemainingEnergy",
                      "Remaining energy at BasicEnergySource.",
                      MakeTraceSourceAccessor (&LiIonEnergySource::m_remainingEnergyJ),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/energy/model/rv-battery-model.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/energy/model/rv-battery-model.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -83,7 +83,7 @@
     .AddTraceSource ("RvBatteryModelBatteryLevel",
                      "RV battery model battery level.",
                      MakeTraceSourceAccessor (&RvBatteryModel::m_batteryLevel),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
     .AddTraceSource ("RvBatteryModelBatteryLifetime",
                      "RV battery model battery lifetime.",
                      MakeTraceSourceAccessor (&RvBatteryModel::m_lifetime),
--- a/src/energy/model/simple-device-energy-model.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/energy/model/simple-device-energy-model.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -40,7 +40,7 @@
     .AddTraceSource ("TotalEnergyConsumption",
                      "Total energy consumption of the radio device.",
                      MakeTraceSourceAccessor (&SimpleDeviceEnergyModel::m_totalEnergyConsumption),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/fd-net-device/model/fd-net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/fd-net-device/model/fd-net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -387,6 +387,8 @@
    * The trace source fired when the phy layer drops a packet as it tries
    * to transmit it.
    *
+   * \todo Remove: this TracedCallback is never invoked.
+   *
    * \see class CallBackTraceSource
    */
   TracedCallback<Ptr<const Packet> > m_phyTxDropTrace;
--- a/src/internet/model/codel-queue.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/codel-queue.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -184,23 +184,23 @@
     .AddTraceSource ("Count",
                      "CoDel count",
                      MakeTraceSourceAccessor (&CoDelQueue::m_count),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("DropCount",
                      "CoDel drop count",
                      MakeTraceSourceAccessor (&CoDelQueue::m_dropCount),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("LastCount",
                      "CoDel lastcount",
                      MakeTraceSourceAccessor (&CoDelQueue::m_lastCount),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("DropState",
                      "Dropping state",
                      MakeTraceSourceAccessor (&CoDelQueue::m_dropping),
-                     "ns3::TracedValue::BoolCallback")
+                     "ns3::TracedValueCallback::Bool")
     .AddTraceSource ("BytesInQueue",
                      "Number of bytes in the queue",
                      MakeTraceSourceAccessor (&CoDelQueue::m_bytesInQueue),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("Sojourn",
                      "Time in the queue",
                      MakeTraceSourceAccessor (&CoDelQueue::m_sojourn),
@@ -208,7 +208,7 @@
     .AddTraceSource ("DropNext",
                      "Time until next packet drop",
                      MakeTraceSourceAccessor (&CoDelQueue::m_dropNext),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
   ;
 
   return tid;
--- a/src/internet/model/ipv4-l3-protocol.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/ipv4-l3-protocol.h	Tue Aug 18 16:59:27 2015 -0700
@@ -245,8 +245,7 @@
    * \param [in] interface
    */
   typedef void (* SentTracedCallback)
-    (const Ipv4Header & header, const Ptr<const Packet> packet,
-     const uint32_t interface);
+    (const Ipv4Header & header, Ptr<const Packet> packet, uint32_t interface);
    
   /**
    * TracedCallback signature for packet transmission or reception events.
@@ -254,10 +253,11 @@
    * \param [in] packet The packet.
    * \param [in] ipv4
    * \param [in] interface
+   * \deprecated The non-const \c Ptr<Ipv4> argument is deprecated
+   * and will be changed to \c Ptr<const Ipv4> in a future release.
    */
   typedef void (* TxRxTracedCallback)
-    (const Ptr<const Packet> packet, const Ptr<const Ipv4> ipv4, 
-     const uint32_t interface);
+    (Ptr<const Packet> packet, Ptr<Ipv4> ipv4, uint32_t interface);
 
   /**
    * TracedCallback signature for packet drop events.
@@ -267,11 +267,13 @@
    * \param [in] reason The reason the packet was dropped.
    * \param [in] ipv4
    * \param [in] interface
+   * \deprecated The non-const \c Ptr<Ipv4> argument is deprecated
+   * and will be changed to \c Ptr<const Ipv4> in a future release.
    */
   typedef void (* DropTracedCallback)
-    (const Ipv4Header & header, const Ptr<const Packet> packet,
-     const DropReason reason, const Ptr<const Ipv4> ipv4,
-     const uint32_t interface);
+    (const Ipv4Header & header, Ptr<const Packet> packet,
+     DropReason reason, Ptr<Ipv4> ipv4,
+     uint32_t interface);
    
 protected:
 
@@ -456,11 +458,17 @@
 
   // The following two traces pass a packet with an IP header
   /// Trace of transmitted packets
+  /// \deprecated The non-const \c Ptr<Ipv4> argument is deprecated
+  /// and will be changed to \c Ptr<const Ipv4> in a future release.
   TracedCallback<Ptr<const Packet>, Ptr<Ipv4>,  uint32_t> m_txTrace;
   /// Trace of received packets
+  /// \deprecated The non-const \c Ptr<Ipv4> argument is deprecated
+  /// and will be changed to \c Ptr<const Ipv4> in a future release.
   TracedCallback<Ptr<const Packet>, Ptr<Ipv4>, uint32_t> m_rxTrace;
   // <ip-header, payload, reason, ifindex> (ifindex not valid if reason is DROP_NO_ROUTE)
   /// Trace of dropped packets
+  /// \deprecated The non-const \c Ptr<Ipv4> argument is deprecated
+  /// and will be changed to \c Ptr<const Ipv4> in a future release.
   TracedCallback<const Ipv4Header &, Ptr<const Packet>, DropReason, Ptr<Ipv4>, uint32_t> m_dropTrace;
 
   Ptr<Ipv4RoutingProtocol> m_routingProtocol; //!< Routing protocol associated with the stack
--- a/src/internet/model/ipv4-packet-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/ipv4-packet-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -45,11 +45,11 @@
                       "The packet plus its IPv4 object and interface "
                       "that serve as the output for this probe",
                       MakeTraceSourceAccessor (&Ipv4PacketProbe::m_output),
-                      "ns3::Ipv4PacketProbe::TracedCallback")
+                      "ns3::Ipv4L3Protocol::TxRxTracedCallback")
     .AddTraceSource ( "OutputBytes",
                       "The number of bytes in the packet",
                       MakeTraceSourceAccessor (&Ipv4PacketProbe::m_outputBytes),
-                      "ns3::Packet::PacketSizeTracedCallback")
+                      "ns3::Packet::SizeTracedCallback")
   ;
   return tid;
 }
--- a/src/internet/model/ipv4-packet-probe.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/ipv4-packet-probe.h	Tue Aug 18 16:59:27 2015 -0700
@@ -93,17 +93,6 @@
    */
   virtual void ConnectByPath (std::string path);
 
-  /**
-   * TracedCallback signature for PacketProbe events.
-   *
-   * \param [in] packet The packet.
-   * \param [in] ipv4 
-   * \param [in] interface
-   */
-  typedef void (* TracedCallback)
-    (const Ptr<const Packet> packet, const Ptr<const Ipv4> ipv4,
-     const uint32_t interface);
-
 private:
   /**
    * \brief Method to connect to an underlying ns3::TraceSource with
--- a/src/internet/model/ipv6-l3-protocol.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/ipv6-l3-protocol.h	Tue Aug 18 16:59:27 2015 -0700
@@ -395,8 +395,7 @@
    * \param [in] interface
    */
   typedef void (* SentTracedCallback)
-    (const Ipv6Header & header, const Ptr<const Packet> packet,
-     const uint32_t interface);
+    (const Ipv6Header & header, Ptr<const Packet> packet, uint32_t interface);
    
   /**
    * TracedCallback signature for packet transmission or reception events.
@@ -404,10 +403,11 @@
    * \param [in] packet The packet.
    * \param [in] ipv6
    * \param [in] interface
+   * \deprecated The non-const \c Ptr<Ipv6> argument is deprecated
+   * and will be changed to \c Ptr<const Ipv6> in a future release.
    */
   typedef void (* TxRxTracedCallback)
-    (const Ptr<const Packet> packet, const Ptr<const Ipv6> ipv6,
-     const uint32_t interface);
+    (Ptr<const Packet> packet, Ptr<Ipv6> ipv6, uint32_t interface);
 
   /**
    * TracedCallback signature for packet drop events.
@@ -417,11 +417,13 @@
    * \param [in] reason The reason the packet was dropped.
    * \param [in] ipv6
    * \param [in] interface
+   * \deprecated The non-const \c Ptr<Ipv6> argument is deprecated
+   * and will be changed to \c Ptr<const Ipv6> in a future release.
    */
   typedef void (* DropTracedCallback)
-    (const Ipv6Header & header, const Ptr<const Packet> packet,
-     const DropReason reason, const Ptr<const Ipv6> ipv6,
-     const uint32_t interface);
+    (const Ipv6Header & header, Ptr<const Packet> packet,
+     DropReason reason, Ptr<Ipv6> ipv6,
+     uint32_t interface);
    
 protected:
   /**
@@ -468,16 +470,22 @@
 
   /**
    * \brief Callback to trace TX (transmission) packets.
+   * \deprecated The non-const \c Ptr<Ipv6> argument is deprecated
+   * and will be changed to \c Ptr<const Ipv6> in a future release.
    */ 
   TracedCallback<Ptr<const Packet>, Ptr<Ipv6>, uint32_t> m_txTrace;
 
   /**
    * \brief Callback to trace RX (reception) packets.
+   * \deprecated The non-const \c Ptr<Ipv6> argument is deprecated
+   * and will be changed to \c Ptr<const Ipv6> in a future release.
    */ 
   TracedCallback<Ptr<const Packet>, Ptr<Ipv6>, uint32_t> m_rxTrace;
 
   /**
    * \brief Callback to trace drop packets.
+   * \deprecated The non-const \c Ptr<Ipv6> argument is deprecated
+   * and will be changed to \c Ptr<const Ipv6> in a future release.
    */ 
   TracedCallback<const Ipv6Header &, Ptr<const Packet>, DropReason, Ptr<Ipv6>, uint32_t> m_dropTrace;
 
--- a/src/internet/model/ipv6-packet-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/ipv6-packet-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -46,11 +46,11 @@
                       "The packet plus its IPv6 object and interface "
                       "that serve as the output for this probe",
                       MakeTraceSourceAccessor (&Ipv6PacketProbe::m_output),
-                      "ns3::Ipv6PacketProbe::TracedCallback")
+                      "ns3::Ipv6L3Protocol::TxRxTracedCallback")
     .AddTraceSource ( "OutputBytes",
                       "The number of bytes in the packet",
                       MakeTraceSourceAccessor (&Ipv6PacketProbe::m_outputBytes),
-                      "ns3::Packet::PacketSizeTracedCallback")
+                      "ns3::Packet::SizeTracedCallback")
   ;
   return tid;
 }
--- a/src/internet/model/ipv6-packet-probe.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/ipv6-packet-probe.h	Tue Aug 18 16:59:27 2015 -0700
@@ -95,17 +95,6 @@
    */
   virtual void ConnectByPath (std::string path);
 
-  /**
-   * TracedCallback signature for PacketProbe events.
-   *
-   * \param [in] packet The packet.
-   * \param [in] ipv6 
-   * \param [in] interface
-   */
-  typedef void (* TracedCallback)
-    (const Ptr<const Packet> packet, const Ptr<const Ipv6> ipv6,
-     const uint32_t interface);
-
 private:
   /**
    * \brief Method to connect to an underlying ns3::TraceSource with
--- a/src/internet/model/nsc-tcp-socket-impl.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/nsc-tcp-socket-impl.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -58,11 +58,11 @@
     .AddTraceSource ("CongestionWindow",
                      "The TCP connection's congestion window",
                      MakeTraceSourceAccessor (&NscTcpSocketImpl::m_cWnd),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("SlowStartThreshold",
                      "TCP slow start threshold (bytes)",
                      MakeTraceSourceAccessor (&NscTcpSocketImpl::m_ssThresh),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("State",
                      "TCP state",
                      MakeTraceSourceAccessor (&NscTcpSocketImpl::m_state),
--- a/src/internet/model/tcp-socket-base.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/tcp-socket-base.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -141,7 +141,7 @@
     .AddTraceSource ("RWND",
                      "Remote side's flow control window",
                      MakeTraceSourceAccessor (&TcpSocketBase::m_rWnd),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("HighestRxSequence",
                      "Highest sequence number received from peer",
                      MakeTraceSourceAccessor (&TcpSocketBase::m_highRxMark),
@@ -153,11 +153,11 @@
     .AddTraceSource ("CongestionWindow",
                      "The TCP connection's congestion window",
                      MakeTraceSourceAccessor (&TcpSocketBase::m_cWnd),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
     .AddTraceSource ("SlowStartThreshold",
                      "TCP slow start threshold (bytes)",
                      MakeTraceSourceAccessor (&TcpSocketBase::m_ssThresh),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
   ;
   return tid;
 }
--- a/src/internet/model/tcp-westwood.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/internet/model/tcp-westwood.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -64,7 +64,7 @@
                     MakeEnumChecker(TcpWestwood::WESTWOOD, "Westwood",TcpWestwood::WESTWOODPLUS, "WestwoodPlus"))
       .AddTraceSource("EstimatedBW", "The estimated bandwidth",
                     MakeTraceSourceAccessor(&TcpWestwood::m_currentBW),
-                      "ns3::TracedValue::DoubleCallback");
+                      "ns3::TracedValueCallback::Double");
   return tid;
 }
 
--- a/src/lr-wpan/model/lr-wpan-mac.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lr-wpan/model/lr-wpan-mac.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -111,6 +111,10 @@
                      "packet sniffer attached to the device",
                      MakeTraceSourceAccessor (&LrWpanMac::m_promiscSnifferTrace),
                      "ns3::Packet::TracedCallback")
+    .AddTraceSource ("MacStateValue",
+                     "The state of LrWpan Mac",
+                     MakeTraceSourceAccessor (&LrWpanMac::m_lrWpanMacState),
+                     "ns3::TracedValueCallback::LrWpanMacState")
     .AddTraceSource ("MacState",
                      "The state of LrWpan Mac",
                      MakeTraceSourceAccessor (&LrWpanMac::m_macStateLogger),
--- a/src/lr-wpan/model/lr-wpan-mac.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lr-wpan/model/lr-wpan-mac.h	Tue Aug 18 16:59:27 2015 -0700
@@ -26,6 +26,7 @@
 
 #include <ns3/object.h>
 #include <ns3/traced-callback.h>
+#include <ns3/traced-value.h>
 #include <ns3/mac16-address.h>
 #include <ns3/mac64-address.h>
 #include <ns3/sequence-number.h>
@@ -74,6 +75,20 @@
   SET_PHY_TX_ON          //!< SET_PHY_TX_ON
 } LrWpanMacState;
 
+namespace TracedValueCallback {
+
+/**
+ * \ingroup lr-wpan
+ * TracedValue callback signature for LrWpanMacState.
+ *
+ * \param [in] oldValue original value of the traced variable
+ * \param [in] newValue new value of the traced variable
+ */
+  typedef void (* LrWpanMacState)(LrWpanMacState oldValue,
+                                  LrWpanMacState newValue);
+
+}  // namespace TracedValueCallback
+
 /**
  * \ingroup lr-wpan
  *
@@ -526,17 +541,19 @@
    * \param [in] backoffs The number of CSMA backoffs.
    */
   typedef void (* SentTracedCallback)
-    (const Ptr<const Packet> packet, const uint8_t retries,
-     const uint8_t backoffs);
+    (Ptr<const Packet> packet, uint8_t retries, uint8_t backoffs);
 
   /**
    * TracedCallback signature for LrWpanMacState change events.
    *
    * \param [in] oldValue The original state value.
    * \param [in] newValue The new state value.
+   * \deprecated The LrWpanMacState is now accessible as the
+   * TracedValue \c MacStateValue. The \c MacState TracedCallback will
+   * be removed in a future release.
    */
   typedef void (* StateTracedCallback)
-    (const LrWpanMacState oldState, const LrWpanMacState newState);
+    (LrWpanMacState oldState, LrWpanMacState newState);
   
 protected:
   // Inherited from Object.
@@ -717,7 +734,9 @@
    * A trace source that fires when the LrWpanMac changes states.
    * Parameters are the old mac state and the new mac state.
    *
-   * \todo This should be a TracedValue
+   * \deprecated This TracedCallback is deprecated and will be
+   * removed in a future release,  Instead, use the \c MacStateValue
+   * TracedValue.
    */
   TracedCallback<LrWpanMacState, LrWpanMacState> m_macStateLogger;
 
@@ -747,7 +766,7 @@
   /**
    * The current state of the MAC layer.
    */
-  LrWpanMacState m_lrWpanMacState;
+  TracedValue<LrWpanMacState> m_lrWpanMacState;
 
   /**
    * The current association status of the MAC layer.
--- a/src/lr-wpan/model/lr-wpan-phy.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lr-wpan/model/lr-wpan-phy.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -77,6 +77,10 @@
     .SetParent<SpectrumPhy> ()
     .SetGroupName ("LrWpan")
     .AddConstructor<LrWpanPhy> ()
+    .AddTraceSource ("TrxStateValue",
+                     "The state of the transceiver",
+                     MakeTraceSourceAccessor (&LrWpanPhy::m_trxState),
+                     "ns3::TracedValueCallback::LrWpanPhyEnumeration")
     .AddTraceSource ("TrxState",
                      "The state of the transceiver",
                      MakeTraceSourceAccessor (&LrWpanPhy::m_trxStateLogger),
@@ -106,7 +110,7 @@
                      "completely received from the channel medium "
                      "by the device",
                      MakeTraceSourceAccessor (&LrWpanPhy::m_phyRxEndTrace),
-                     "ns3::LrWpanPhy::RxEndTracedCallback")
+                     "ns3::Packet::SinrTracedCallback")
     .AddTraceSource ("PhyRxDrop",
                      "Trace source indicating a packet has been "
                      "dropped by the device during reception",
--- a/src/lr-wpan/model/lr-wpan-phy.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lr-wpan/model/lr-wpan-phy.h	Tue Aug 18 16:59:27 2015 -0700
@@ -26,6 +26,7 @@
 
 #include <ns3/spectrum-phy.h>
 #include <ns3/traced-callback.h>
+#include <ns3/traced-value.h>
 #include <ns3/event-id.h>
 
 namespace ns3 {
@@ -118,6 +119,19 @@
   IEEE_802_15_4_PHY_UNSPECIFIED = 0xc // all cases not covered by ieee802.15.4
 } LrWpanPhyEnumeration;
 
+namespace TracedValueCallback
+{
+/**
+ * \ingroup lr-wpan
+ * TracedValue callback signature for LrWpanPhyEnumeration.
+ *
+ * \param [in] oldValue original value of the traced variable
+ * \param [in] newValue new value of the traced variable
+ */
+  typedef void (* LrWpanPhyEnumeration)(LrWpanPhyEnumeration oldValue,
+                                        LrWpanPhyEnumeration newValue);
+}  // namespace TracedValueCallback
+
 /**
  * \ingroup lr-wpan
  *
@@ -468,20 +482,13 @@
    * \param [in] time The time of the state change.
    * \param [in] oldState The old state.
    * \param [in] newState The new state.
+   * \deprecated The LrWpanPhyEnumeration state is now accessible as the
+   * TracedValue \c TrxStateValue.  The \c TrxState TracedCallback will
+   * be removed in a future release.
    */
   typedef void (* StateTracedCallback)
-    (const Time time,
-     const LrWpanPhyEnumeration oldState, const LrWpanPhyEnumeration newState);
+    (Time time, LrWpanPhyEnumeration oldState, LrWpanPhyEnumeration newState);
 
-  /**
-   * TracedCallback signature for end receive events.
-   *
-   * \param [in] packet The packet.
-   * \param [in] sinr The received SINR.
-   */
-  typedef void (* RxEndTracedCallback)
-    (const Ptr<const Packet> packet, const double sinr);
-    
 protected:
   /**
    * The data and symbol rates for the different PHY options.
@@ -659,6 +666,9 @@
    * The trace source fired when the phy layer changes the transceiver state.
    *
    * \see class CallBackTraceSource
+   * \deprecated The LrWpanPhyEnumeration state is now accessible as the
+   * TracedValue \c TrxStateValue.  This TracedCallback will
+   * be removed in a future release.
    */
   TracedCallback<Time, LrWpanPhyEnumeration, LrWpanPhyEnumeration> m_trxStateLogger;
 
@@ -706,7 +716,7 @@
   /**
    * The current transceiver state.
    */
-  LrWpanPhyEnumeration m_trxState;
+  TracedValue<LrWpanPhyEnumeration> m_trxState;
 
   /**
    * The next pending state to applied after the current action of the PHY is
--- a/src/lte/model/lte-common.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-common.h	Tue Aug 18 16:59:27 2015 -0700
@@ -132,6 +132,7 @@
    *  TracedCallback signature.
    *
    * \param [in] params Value of the PhyTransmissionionStatParameters.
+   * \todo The argument should be passed by const reference, since it's large.
    */
   typedef void (* TracedCallback)(const PhyTransmissionStatParameters params);
   
@@ -156,6 +157,7 @@
    *  TracedCallback signature.
    *
    * \param [in] params Value of the PhyReceptionStatParameters.
+   * \todo The argument should be passed by const reference, since it's large.
    */
   typedef void (* TracedCallback)(const PhyReceptionStatParameters params);
   
--- a/src/lte/model/lte-enb-mac.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-enb-mac.h	Tue Aug 18 16:59:27 2015 -0700
@@ -132,9 +132,9 @@
    * \param [in] tbs1Size
    */
   typedef void (* DlSchedulingTracedCallback)
-    (const uint32_t frame, const uint32_t subframe, const uint16_t rnti,
-     const uint8_t mcs0, const uint16_t tbs0Size,
-     const uint8_t mcs1, const uint16_t tbs1Size);
+    (uint32_t frame, uint32_t subframe,  uint16_t rnti,
+     uint8_t mcs0, uint16_t tbs0Size,
+     uint8_t mcs1, uint16_t tbs1Size);
 
   /**
    *  TracedCallback signature for UL scheduling events.
@@ -146,8 +146,8 @@
    * \param [in] tbsSize
    */
   typedef void (* UlSchedulingTracedCallback)
-    (const uint32_t frame, const uint32_t subframe, const uint16_t rnti,
-     const uint8_t mcs, const uint16_t tbsSize);
+    (uint32_t frame, uint32_t subframe, uint16_t rnti,
+     uint8_t mcs, uint16_t tbsSize);
   
 private:
 
@@ -252,12 +252,14 @@
    * Frame number, Subframe number, RNTI, MCS of TB1, size of TB1,
    * MCS of TB2 (0 if not present), size of TB2 (0 if not present)
    */
-  TracedCallback<uint32_t, uint32_t, uint16_t, uint8_t, uint16_t, uint8_t, uint16_t> m_dlScheduling;
+  TracedCallback<uint32_t, uint32_t, uint16_t,
+                 uint8_t, uint16_t, uint8_t, uint16_t> m_dlScheduling;
   /**
    * Trace information regarding UL scheduling
    * Frame number, Subframe number, RNTI, MCS of TB, size of TB
    */
-  TracedCallback<uint32_t, uint32_t, uint16_t, uint8_t, uint16_t> m_ulScheduling;
+  TracedCallback<uint32_t, uint32_t, uint16_t,
+                 uint8_t, uint16_t> m_ulScheduling;
   
   uint8_t m_macChTtiDelay; // delay of MAC, PHY and channel in terms of TTIs
 
--- a/src/lte/model/lte-enb-phy.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-enb-phy.h	Tue Aug 18 16:59:27 2015 -0700
@@ -291,17 +291,18 @@
    * \param [in] sinrLinear
    */
   typedef void (* ReportUeSinrTracedCallback)
-    (const uint16_t cellId, const uint16_t rnti, const double sinrLinear);
+    (uint16_t cellId, uint16_t rnti, double sinrLinear);
 
   /**
    * TracedCallback signature for the linear average of SRS SINRs.
    *
    * \param [in] cellId
    * \param [in] spectrumValue
+   * \deprecated The non-const \c Ptr<SpectrumValue> argument is deprecated
+   * and will be changed to \c Ptr<const SpectrumValue> in a future release.
    */
   typedef void (* ReportInterferenceTracedCallback)
-    (const uint16_t cellId, const Ptr<const SpectrumValue> spectrumValue);
-
+    (uint16_t cellId, Ptr<SpectrumValue> spectrumValue);
 
 private:
 
@@ -416,6 +417,8 @@
    * The `ReportInterference` trace source. Reporting the interference per PHY
    * RB (TS 36.214 section 5.2.2, measured on DATA). Exporting cell ID and
    * interference linear power per RB basis.
+   * \deprecated The non-const \c Ptr<SpectrumValue> argument is deprecated
+   * and will be changed to \c Ptr<const SpectrumValue> in a future release.
    */
   TracedCallback<uint16_t, Ptr<SpectrumValue> > m_reportInterferenceTrace;
   /**
--- a/src/lte/model/lte-enb-rrc.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-enb-rrc.h	Tue Aug 18 16:59:27 2015 -0700
@@ -314,8 +314,8 @@
    * \param [in] newState
    */
   typedef void (* StateTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti,
-     const State oldState, const State newState);
+    (uint64_t imsi, uint16_t cellId, uint16_t rnti,
+     State oldState, State newState);
 
 private:
 
@@ -827,7 +827,7 @@
    * \param [in] rnti
    */
   typedef void (* NewUeContextTracedCallback)
-    (const uint16_t cellId, const uint16_t rnti);
+    (uint16_t cellId, uint16_t rnti);
 
   /**
    * TracedCallback signature for connection and handover end events.
@@ -837,7 +837,7 @@
    * \param [in] rnti
    */
   typedef void (* ConnectionHandoverTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti);
+    (uint64_t imsi, uint16_t cellId, uint16_t rnti);
   
   /**
    * TracedCallback signature for handover start events.
@@ -848,8 +848,7 @@
    * \param [in] targetCid
    */
   typedef void (* HandoverStartTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti,
-     const uint16_t targetCid);
+    (uint64_t imsi, uint16_t cellId, uint16_t rnti, uint16_t targetCid);
 
   /**
    * TracedCallback signature for receive measurement report events.
@@ -858,10 +857,12 @@
    * \param [in] cellId
    * \param [in] rnti
    * \param [in] report
+   * \todo The \c LteRrcSap::MeasurementReport argument should be
+   * changed to a const reference since the argument is large.
    */
   typedef void (* ReceiveReportTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti,
-     const LteRrcSap::MeasurementReport report);
+    (uint64_t imsi, uint16_t cellId, uint16_t rnti,
+     LteRrcSap::MeasurementReport report);
   
 private:
 
--- a/src/lte/model/lte-pdcp.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-pdcp.h	Tue Aug 18 16:59:27 2015 -0700
@@ -120,7 +120,7 @@
    * \param [in] size Packet size.
    */
   typedef void (* PduTxTracedCallback)
-    (const uint16_t rnti, const uint8_t lcid, const uint32_t size);
+    (uint16_t rnti, uint8_t lcid, uint32_t size);
 
   /**
    * TracedCallback signature for PDU receive event.
--- a/src/lte/model/lte-rlc.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-rlc.h	Tue Aug 18 16:59:27 2015 -0700
@@ -109,7 +109,7 @@
    * \param [in] bytes The number of bytes to transmit
    */
   typedef void (* NotifyTxTracedCallback)
-    (const uint16_t rnti, const uint8_t lcid, const uint32_t bytes);
+    (uint16_t rnti, uint8_t lcid, uint32_t bytes);
 
   /**
    * TracedCallback signature for
@@ -121,8 +121,7 @@
    * \param [in] delay Delay since sender timestamp, in ns.
    */
   typedef void (* ReceiveTracedCallback)
-    (const uint16_t rnti, const uint8_t lcid,
-     const uint32_t bytes, const uint64_t delay);
+    (uint16_t rnti, uint8_t lcid, uint32_t bytes, uint64_t delay);
 
   /// \todo MRE What is the sense to duplicate all the interfaces here???
   // NB to avoid the use of multiple inheritance
--- a/src/lte/model/lte-spectrum-phy.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-spectrum-phy.h	Tue Aug 18 16:59:27 2015 -0700
@@ -453,8 +453,8 @@
   TracedCallback<Ptr<const PacketBurst> > m_phyTxStartTrace;
   TracedCallback<Ptr<const PacketBurst> > m_phyTxEndTrace;
   TracedCallback<Ptr<const PacketBurst> > m_phyRxStartTrace;
-  TracedCallback<Ptr<const Packet> > m_phyRxEndOkTrace;
-  TracedCallback<Ptr<const Packet> > m_phyRxEndErrorTrace;
+  TracedCallback<Ptr<const Packet> >      m_phyRxEndOkTrace;
+  TracedCallback<Ptr<const Packet> >      m_phyRxEndErrorTrace;
 
   LtePhyRxDataEndErrorCallback   m_ltePhyRxDataEndErrorCallback;
   LtePhyRxDataEndOkCallback      m_ltePhyRxDataEndOkCallback;
--- a/src/lte/model/lte-ue-phy.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-ue-phy.h	Tue Aug 18 16:59:27 2015 -0700
@@ -244,8 +244,7 @@
    * \param [in] newState
    */
   typedef void (* StateTracedCallback)
-    (const uint16_t cellId, const uint16_t rnti,
-     const State oldState, const State newState);
+    (uint16_t cellId, uint16_t rnti, State oldState, State newState);
 
   /**
    * TracedCallback signature for cell RSRP and SINR report.
@@ -256,8 +255,7 @@
    * \param [in] sinr
    */
   typedef void (* RsrpSinrTracedCallback)
-    (const uint16_t cellId, const uint16_t rnti,
-     const double rsrp, const double sinr);
+    (uint16_t cellId, uint16_t rnti, double rsrp, double sinr);
 
   /**
    * TracedCallback signature for cell RSRP and RSRQ.
@@ -269,8 +267,8 @@
    * \param [in] isServingCell
    */
   typedef void (* RsrpRsrqTracedCallback)
-    (const uint16_t rnti, const uint16_t cellId,
-     const double rsrp, const double rsrq, const bool isServingCell);
+    (uint16_t rnti, uint16_t cellId, double rsrp, double rsrq,
+     bool isServingCell);
 
 private:
 
--- a/src/lte/model/lte-ue-power-control.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-ue-power-control.h	Tue Aug 18 16:59:27 2015 -0700
@@ -95,7 +95,7 @@
    * \param [in] power The current TX power.
    */
   typedef void (* TxPowerTracedCallback)
-    (const uint16_t cellId, const uint16_t rnti, const double power);
+    (uint16_t cellId, uint16_t rnti, double power);
 
 private:
   void SetSubChannelMask (std::vector <int> mask);
--- a/src/lte/model/lte-ue-rrc.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/model/lte-ue-rrc.h	Tue Aug 18 16:59:27 2015 -0700
@@ -254,7 +254,7 @@
    * \param [in] cellId
    */
   typedef void (* CellSelectionTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId);
+    (uint64_t imsi, uint16_t cellId);
 
   /**
    * TracedCallback signature for imsi, cellId and rnti events.
@@ -264,7 +264,7 @@
    * \param [in] rnti
    */
   typedef void (* ImsiCidRntiTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti);
+    (uint64_t imsi, uint16_t cellId, uint16_t rnti);
 
   /**
    * TracedCallback signature for MIBRecieved, Sib1Received and
@@ -276,8 +276,7 @@
    * \param [in] otherCid
    */
   typedef void (* MibSibHandoverTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti,
-     const uint16_t otherCid);
+    (uint64_t imsi, uint16_t cellId, uint16_t rnti, uint16_t otherCid);
 
   /**
    * TracedCallback signature for state transition events.
@@ -289,8 +288,8 @@
    * \param [in] newState
    */
   typedef void (* StateTracedCallback)
-    (const uint64_t imsi, const uint16_t cellId, const uint16_t rnti,
-     const State oldState, const State newState);
+    (uint64_t imsi, uint16_t cellId, uint16_t rnti,
+     State oldState, State newState);
 
 
 private:
--- a/src/lte/test/lte-ffr-simple.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/lte/test/lte-ffr-simple.h	Tue Aug 18 16:59:27 2015 -0700
@@ -68,6 +68,14 @@
   friend class MemberLteFfrSapProvider<LteFfrSimple>;
   friend class MemberLteFfrRrcSapProvider<LteFfrSimple>;
 
+  /**
+   * TracedCallback signature for change of PdschConfigDedicated.
+   *
+   * \param [in] rnti
+   * \param [in] pdschPa PdschConfiDedicated.pa
+   */
+  typedef void (* PdschTracedCallback)(uint16_t rnti, uint8_t pdschPa);
+
 protected:
   // inherited from Object
   virtual void DoInitialize ();
@@ -120,8 +128,6 @@
 
   LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated;
 
-  typedef void (* PdschTracedCallback)(uint16_t, uint8_t);
-
   TracedCallback<uint16_t, uint8_t> m_changePdschConfigDedicatedTrace;
 
 
--- a/src/mesh/helper/mesh-stack-installer.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/mesh/helper/mesh-stack-installer.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2015, LLNL
+ * 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
--- a/src/mesh/model/dot11s/peer-management-protocol.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/mesh/model/dot11s/peer-management-protocol.h	Tue Aug 18 16:59:27 2015 -0700
@@ -166,11 +166,11 @@
   /**
    * TracedCallback signature for link open/close events.
    *
-   * \param [in] myIface MAC address of my interface.
-   * \param [in] peerIface MAC address of peer interface.
+   * \param [in] src MAC address of source interface.
+   * \param [in] dst MAC address of destination interface.
    */
   typedef void (* LinkOpenCloseTracedCallback)
-    (const Mac48Address myIface, const Mac48Address peerIface);
+    (Mac48Address src, const Mac48Address dst);
    
 
 private:
--- a/src/mobility/model/mobility-model.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/mobility/model/mobility-model.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -47,7 +47,7 @@
     .AddTraceSource ("CourseChange", 
                      "The value of the position and/or velocity vector changed",
                      MakeTraceSourceAccessor (&MobilityModel::m_courseChangeTrace),
-                     "ns3::MobilityModel::CourseChangeTracedCallback")
+                     "ns3::MobilityModel::TracedCallback")
   ;
   return tid;
 }
--- a/src/mobility/model/mobility-model.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/mobility/model/mobility-model.h	Tue Aug 18 16:59:27 2015 -0700
@@ -83,22 +83,8 @@
    *  TracedCallback signature.
    *
    * \param [in] model Value of the MobilityModel.
-   * @{
    */
-  typedef void (* TracedCallback)(const Ptr<const MobilityModel> model);
-  
-  /**
-   * TracedCallback signature for course change notifications.
-   *
-   * If the callback is connected using Config::ConnectWithoutContext()
-   * omit the \c context argument from the signature.
-   *
-   * \param [in] context The context string, supplied by the Trace source.
-   * \param [in] model The MobilityModel which is changing course.
-   */
-  typedef void (* CourseChangeTracedCallback)
-    (const std::string context, const Ptr<const MobilityModel> model);
-  
+  typedef void (* TracedCallback)(Ptr<const MobilityModel> model);
   
 protected:
   /**
--- a/src/network/model/net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/model/net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -131,6 +131,10 @@
    */
   virtual bool IsLinkUp (void) const = 0;
   /**
+   * TracedCallback signature for link changed event.
+   */
+  typedef void (* LinkChangeTracedCallback) (void);
+  /**
    * \param callback the callback to invoke
    *
    * Add a callback invoked whenever the link 
@@ -188,12 +192,12 @@
   virtual Address GetMulticast (Ipv4Address multicastGroup) const = 0;
 
   /**
-* \brief Get the MAC multicast address corresponding
-* to the IPv6 address provided.
-* \param addr IPv6 address
-* \return the MAC multicast address
-* \warning Calling this method is invalid if IsMulticast returns not true.
-*/
+   * \brief Get the MAC multicast address corresponding
+   * to the IPv6 address provided.
+   * \param addr IPv6 address
+   * \return the MAC multicast address
+   * \warning Calling this method is invalid if IsMulticast returns not true.
+   */
   virtual Address GetMulticast (Ipv6Address addr) const = 0;
 
   /**
--- a/src/network/model/packet.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/model/packet.h	Tue Aug 18 16:59:27 2015 -0700
@@ -29,6 +29,7 @@
 #include "byte-tag-list.h"
 #include "packet-tag-list.h"
 #include "nix-vector.h"
+#include "ns3/mac48-address.h"
 #include "ns3/callback.h"
 #include "ns3/assert.h"
 #include "ns3/ptr.h"
@@ -660,16 +661,25 @@
    *
    * \param [in] packet The packet.
    */
-  typedef void (* TracedCallback) (const Ptr<const Packet> packet);
+  typedef void (* TracedCallback) (Ptr<const Packet> packet);
   
   /**
-   * TracedCallback signature for packet and address.
+   * TracedCallback signature for packet and Address.
    *
    * \param [in] packet The packet.
    * \param [in] address The address.
    */
-  typedef void (* PacketAddressTracedCallback)
-    (const Ptr<const Packet> packet, const Address &address);
+  typedef void (* AddressTracedCallback)
+    (Ptr<const Packet> packet, const Address &address);
+  
+  /**
+   * TracedCallback signature for packet and Mac48Address.
+   *
+   * \param [in] packet The packet.
+   * \param [in] mac The Mac48Address.
+   */
+  typedef void (* Mac48AddressTracedCallback)
+    (Ptr<const Packet> packet, Mac48Address mac);
   
   /**
    * TracedCallback signature for changes in packet size.
@@ -677,9 +687,19 @@
    * \param [in] oldSize The previous packet's size.
    * \param [in] newSize The actual packet's size.
    */
-  typedef void (* PacketSizeTracedCallback)
-    (const uint32_t oldSize, const uint32_t newSize);
+  typedef void (* SizeTracedCallback)
+    (uint32_t oldSize, uint32_t newSize);
 
+  /**
+   * TracedCallback signature for packet and SINR.
+   *
+   * \param [in] packet The packet.
+   * \param [in] sinr The received SINR.
+   */
+  typedef void (* SinrTracedCallback)
+    (Ptr<const Packet> packet, double sinr);
+    
+  
 private:
   /**
    * \brief Constructor
--- a/src/network/utils/mac48-address.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/utils/mac48-address.h	Tue Aug 18 16:59:27 2015 -0700
@@ -134,7 +134,7 @@
    *
    * \param [in] value Current value of the Mac48Address
    */
-  typedef void (* TracedCallback)(const Mac48Address value);
+  typedef void (* TracedCallback)(Mac48Address value);
   
 private:
   /**
--- a/src/network/utils/packet-burst.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/utils/packet-burst.h	Tue Aug 18 16:59:27 2015 -0700
@@ -80,7 +80,7 @@
    *
    * \param [in] burst The PacketBurst
    */
-  typedef void (* TracedCallback)(const Ptr<const PacketBurst> burst);
+  typedef void (* TracedCallback)(Ptr<const PacketBurst> burst);
 
   
 private:
--- a/src/network/utils/packet-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/utils/packet-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -48,7 +48,7 @@
     .AddTraceSource ( "OutputBytes",
                       "The number of bytes in the packet",
                       MakeTraceSourceAccessor (&PacketProbe::m_outputBytes),
-                      "ns3::Packet::PacketSizeTracedCallback")
+                      "ns3::Packet::SizeTracedCallback")
   ;
   return tid;
 }
--- a/src/network/utils/packet-socket-client.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/utils/packet-socket-client.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -62,7 +62,7 @@
                    MakeUintegerChecker<uint32_t> ())
     .AddTraceSource ("Tx", "A packet has been sent",
                      MakeTraceSourceAccessor (&PacketSocketClient::m_txTrace),
-                     "ns3::Packet::PacketAddressTracedCallback")
+                     "ns3::Packet::AddressTracedCallback")
   ;
   return tid;
 }
--- a/src/network/utils/packet-socket-server.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/utils/packet-socket-server.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -48,7 +48,7 @@
     .AddConstructor<PacketSocketServer> ()
     .AddTraceSource ("Rx", "A packet has been received",
                      MakeTraceSourceAccessor (&PacketSocketServer::m_rxTrace),
-                     "ns3::Packet::PacketAddressTracedCallback")
+                     "ns3::Packet::AddressTracedCallback")
   ;
   return tid;
 }
--- a/src/network/utils/sequence-number.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/network/utils/sequence-number.h	Tue Aug 18 16:59:27 2015 -0700
@@ -482,6 +482,8 @@
  */
 typedef SequenceNumber<uint8_t, int8_t> SequenceNumber8;
 
+namespace TracedValueCallback {
+
 /**
  * \ingroup network
  * TracedValue callback signature for SequenceNumber32
@@ -489,8 +491,10 @@
  * \param [in] oldValue original value of the traced variable
  * \param [in] newValue new value of the traced variable
  */
-typedef void (* SequenceNumber32TracedValueCallback)(const SequenceNumber32 oldValue,
-                                                     const SequenceNumber32 newValue);
+typedef void (* SequenceNumber32)(SequenceNumber32 oldValue,
+                                  SequenceNumber32 newValue);
+
+}  // namespace TracedValueCallback
 
 } // namespace ns3
 
--- a/src/olsr/model/olsr-routing-protocol.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/olsr/model/olsr-routing-protocol.h	Tue Aug 18 16:59:27 2015 -0700
@@ -126,7 +126,7 @@
    *
    * \param [in] size Final routing table size.
    */
-  typedef void (* TableChangeTracedCallback) (const uint32_t size);
+  typedef void (* TableChangeTracedCallback) (uint32_t size);
 
 private:
   std::set<uint32_t> m_interfaceExclusions;
--- a/src/point-to-point/model/point-to-point-channel.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/point-to-point/model/point-to-point-channel.h	Tue Aug 18 16:59:27 2015 -0700
@@ -137,11 +137,13 @@
    * \param [in] rxDevice the Receiving NetDevice.
    * \param [in] duration The amount of time to transmit the packet.
    * \param [in] lastBitTime Last bit receive time (relative to now)
+   * \deprecated The non-const \c Ptr<NetDevice> argument is deprecated
+   * and will be changed to \c Ptr<const NetDevice> in a future release.
    */
   typedef void (* TxRxAnimationCallback)
-    (const Ptr<const Packet> packet,
-     const Ptr<const NetDevice> txDevice, const Ptr<const NetDevice> rxDevice,
-     const Time duration, const Time lastBitTime);
+    (Ptr<const Packet> packet,
+     Ptr<NetDevice> txDevice, Ptr<NetDevice> rxDevice,
+     Time duration, Time lastBitTime);
                     
 private:
   /** Each point to point link has exactly two net devices. */
@@ -158,12 +160,14 @@
    * packet receipt time.
    *
    * \see class CallBackTraceSource
+   * \deprecated The non-const \c Ptr<NetDevice> argument is deprecated
+   * and will be changed to \c Ptr<const NetDevice> in a future release.
    */
-  TracedCallback<Ptr<const Packet>, // Packet being transmitted
-                 Ptr<NetDevice>,    // Transmitting NetDevice
-                 Ptr<NetDevice>,    // Receiving NetDevice
-                 Time,              // Amount of time to transmit the pkt
-                 Time               // Last bit receive time (relative to now)
+  TracedCallback<Ptr<const Packet>,     // Packet being transmitted
+                 Ptr<NetDevice>,  // Transmitting NetDevice
+                 Ptr<NetDevice>,  // Receiving NetDevice
+                 Time,                  // Amount of time to transmit the pkt
+                 Time                   // Last bit receive time (relative to now)
                  > m_txrxPointToPoint;
 
   /** \brief Wire states
--- a/src/point-to-point/model/point-to-point-net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/point-to-point/model/point-to-point-net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -164,11 +164,6 @@
 
   virtual bool IsLinkUp (void) const;
 
-  /**
-   * TracedCallback signature for link changed event.
-   */
-  typedef void (* LinkChangeTracedCallback) (void);
-  
   virtual void AddLinkChangeCallback (Callback<void> callback);
 
   virtual bool IsBroadcast (void) const;
--- a/src/sixlowpan/model/sixlowpan-net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/sixlowpan/model/sixlowpan-net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -151,11 +151,13 @@
    * \param [in] packet The packet.
    * \param [in] sixNetDevice The SixLowPanNetDevice.
    * \param [in] ifindex The ifindex of the device.
+   * \deprecated The non-const \c Ptr<SixLowPanNetDevice> argument
+   * is deprecated and will be changed to \c Ptr<const SixLowPanNetDevice>
+   * in a future release.
    */
   typedef void (* RxTxTracedCallback)
-    (const Ptr<const Packet> packet,
-     const Ptr<const SixLowPanNetDevice> sixNetDevice,
-     const uint32_t ifindex);
+    (Ptr<const Packet> packet, Ptr<SixLowPanNetDevice> sixNetDevice,
+     uint32_t ifindex);
 
   /**
    * TracedCallback signature for
@@ -164,11 +166,14 @@
    * \param [in] packet The packet.
    * \param [in] sixNetDevice The SixLowPanNetDevice.
    * \param [in] ifindex The ifindex of the device.
+   * \deprecated The non-const \c Ptr<SixLowPanNetDevice> argument
+   * is deprecated and will be changed to \c Ptr<const SixLowPanNetDevice>
+   * in a future release.
    */
   typedef void (* DropTracedCallback)
-    (const DropReason reason, const Ptr<const Packet> packet,
-     const Ptr<const SixLowPanNetDevice> sixNetDevice,
-     const uint32_t ifindex);
+    (DropReason reason, Ptr<const Packet> packet,
+     Ptr<SixLowPanNetDevice> sixNetDevice,
+     uint32_t ifindex);
    
 protected:
   virtual void DoDispose (void);
@@ -234,6 +239,9 @@
    * \li Packet received (including 6LoWPAN header)
    * \li Ptr to SixLowPanNetDevice
    * \li interface index
+   * \deprecated The non-const \c Ptr<SixLowPanNetDevice> argument
+   * is deprecated and will be changed to \c Ptr<const SixLowPanNetDevice>
+   * in a future release.
    */
   TracedCallback<Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> m_txTrace;
 
@@ -244,6 +252,9 @@
    * \li Packet received (including 6LoWPAN header)
    * \li Ptr to SixLowPanNetDevice
    * \li interface index
+   * \deprecated The non-const \c Ptr<SixLowPanNetDevice> argument
+   * is deprecated and will be changed to \c Ptr<const SixLowPanNetDevice>
+   * in a future release.
    */
   TracedCallback<Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> m_rxTrace;
 
@@ -255,6 +266,9 @@
    * \li Packet dropped (including 6LoWPAN header)
    * \li Ptr to SixLowPanNetDevice
    * \li interface index
+   * \deprecated The non-const \c Ptr<SixLowPanNetDevice> argument
+   * is deprecated and will be changed to \c Ptr<const SixLowPanNetDevice>
+   * in a future release.
    */
   TracedCallback<DropReason, Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> m_dropTrace;
 
--- a/src/spectrum/model/multi-model-spectrum-channel.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/spectrum/model/multi-model-spectrum-channel.h	Tue Aug 18 16:59:27 2015 -0700
@@ -173,6 +173,11 @@
 
   double m_maxLossDb;
 
+  /**
+   * \deprecated The non-const \c Ptr<SpectrumPhy> argument
+   * is deprecated and will be changed to \c Ptr<const SpectrumPhy>
+   * in a future release.
+   */
   TracedCallback<Ptr<SpectrumPhy>, Ptr<SpectrumPhy>, double > m_pathLossTrace;
 };
 
--- a/src/spectrum/model/single-model-spectrum-channel.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/spectrum/model/single-model-spectrum-channel.h	Tue Aug 18 16:59:27 2015 -0700
@@ -109,6 +109,11 @@
 
   double m_maxLossDb;
 
+  /**
+   * \deprecated The non-const \c Ptr<SpectrumPhy> argument
+   * is deprecated and will be changed to \c Ptr<const SpectrumPhy>
+   * in a future release.
+   */
   TracedCallback<Ptr<SpectrumPhy>, Ptr<SpectrumPhy>, double > m_pathLossTrace;
 };
 
--- a/src/spectrum/model/spectrum-channel.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/spectrum/model/spectrum-channel.h	Tue Aug 18 16:59:27 2015 -0700
@@ -101,10 +101,13 @@
    * \param [in] txPhy The TX SpectrumPhy instance.
    * \param [in] rxPhy The RX SpectrumPhy instance.
    * \param [in] lossDb The loss value, in dB.
+   * \deprecated The non-const `Ptr<SpectrumValue>` is
+   * deprecated and will be changed to Ptr<const SpectrumValue>`
+   * in a future release.
    */
   typedef void (* LossTracedCallback)
-    (const Ptr<const SpectrumPhy> txPhy, const Ptr<const SpectrumPhy> rxPhy,
-     const double lossDb);
+    (Ptr<SpectrumPhy> txPhy, Ptr<SpectrumPhy> rxPhy,
+     double lossDb);
   
 };
 
--- a/src/spectrum/model/spectrum-value.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/spectrum/model/spectrum-value.h	Tue Aug 18 16:59:27 2015 -0700
@@ -507,8 +507,11 @@
    *  TracedCallback signature for SpectrumValue.
    *
    * \param [in] value Value of the traced variable.
+   * \deprecated The non-const \c Ptr<SpectrumPhy> argument
+   * is deprecated and will be changed to \c Ptr<const SpectrumPhy>
+   * in a future release.
    */
-  typedef void (* TracedCallback)(const Ptr<const SpectrumValue> value);
+  typedef void (* TracedCallback)(Ptr<SpectrumValue> value);
 
 
 private:
--- a/src/stats/examples/double-probe-example.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/examples/double-probe-example.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -66,7 +66,7 @@
     .AddTraceSource ("Counter",
                      "sample counter",
                      MakeTraceSourceAccessor (&Emitter::m_counter),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/stats/examples/file-helper-example.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/examples/file-helper-example.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -69,7 +69,7 @@
     .AddTraceSource ("Counter",
                      "sample counter",
                      MakeTraceSourceAccessor (&Emitter::m_counter),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/stats/examples/gnuplot-helper-example.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/examples/gnuplot-helper-example.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -68,7 +68,7 @@
     .AddTraceSource ("Counter",
                      "sample counter",
                      MakeTraceSourceAccessor (&Emitter::m_counter),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/stats/model/boolean-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/model/boolean-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -44,7 +44,7 @@
     .AddTraceSource ( "Output",
                       "The bool that serves as output for this probe",
                       MakeTraceSourceAccessor (&BooleanProbe::m_output),
-                      "ns3::TracedValue::BoolCallback")
+                      "ns3::TracedValueCallback::Bool")
   ;
   return tid;
 }
--- a/src/stats/model/double-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/model/double-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -44,7 +44,7 @@
     .AddTraceSource ( "Output",
                       "The double that serves as output for this probe",
                       MakeTraceSourceAccessor (&DoubleProbe::m_output),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/stats/model/time-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/model/time-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -45,7 +45,7 @@
     .AddTraceSource ("Output",
                      "The double valued (units of seconds) probe output",
                      MakeTraceSourceAccessor (&TimeProbe::m_output),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/stats/model/time-series-adaptor.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/model/time-series-adaptor.h	Tue Aug 18 16:59:27 2015 -0700
@@ -115,7 +115,7 @@
   /**
    * TracedCallback signature for output trace.
    *
-   * \param [in] now The current Time.
+   * \param [in] now The current time, in seconds.
    * \param [in] data The new data value.
    */
   typedef void (* OutputTracedCallback) (const double now, const double data);
--- a/src/stats/model/uinteger-16-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/model/uinteger-16-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -43,7 +43,7 @@
     .AddTraceSource ( "Output",
                       "The uint16_t that serves as output for this probe",
                       MakeTraceSourceAccessor (&Uinteger16Probe::m_output),
-                     "ns3::TracedValue::Uint16Callback")
+                     "ns3::TracedValueCallback::Uint16")
   ;
   return tid;
 }
--- a/src/stats/model/uinteger-32-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/model/uinteger-32-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -43,7 +43,7 @@
     .AddTraceSource ( "Output",
                       "The uint32_t that serves as output for this probe",
                       MakeTraceSourceAccessor (&Uinteger32Probe::m_output),
-                     "ns3::TracedValue::Uint32Callback")
+                     "ns3::TracedValueCallback::Uint32")
   ;
   return tid;
 }
--- a/src/stats/model/uinteger-8-probe.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/model/uinteger-8-probe.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -43,7 +43,7 @@
     .AddTraceSource ( "Output",
                       "The uint8_t that serves as output for this probe",
                       MakeTraceSourceAccessor (&Uinteger8Probe::m_output),
-                     "ns3::TracedValue::Uint8Callback")
+                     "ns3::TracedValueCallback::Uint8")
   ;
   return tid;
 }
--- a/src/stats/test/double-probe-test-suite.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/stats/test/double-probe-test-suite.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -64,7 +64,7 @@
     .SetParent<Object> ()
     .AddTraceSource ("Emitter", "XX",
                      MakeTraceSourceAccessor (&SampleEmitter::m_trace),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -132,7 +132,9 @@
   else
     {
       m_pcapFile.Open (m_pcapFilename, std::ios::in|std::ios::binary);
-      NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE, "Wrong response vectors in directory");
+      NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE,
+                           "Wrong response vectors in directory: opening " <<
+                           m_pcapFilename);
     }
 }
 
--- a/src/test/ns3tcp/ns3tcp-state-test-suite.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/test/ns3tcp/ns3tcp-state-test-suite.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -130,7 +130,9 @@
   else
     {
       m_pcapFile.Open (m_pcapFilename, std::ios::in|std::ios::binary);
-      NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE, "Wrong response vectors in directory");
+      NS_ABORT_MSG_UNLESS (m_pcapFile.GetDataLinkType () == PCAP_LINK_TYPE,
+                           "Wrong response vectors in directory: opening " <<
+                           m_pcapFilename);
     }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/traced/traced-callback-typedef-test-suite.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -0,0 +1,647 @@
+/* -*- 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
+ *
+ * Author:  Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
+ */
+
+#include "ns3/test.h"
+#include "ns3/core-module.h"
+
+#include "ns3/dsr-module.h"       // DsrOPtionSRHeader
+#include "ns3/internet-module.h"  // Ipv4, Ipv4L3Protocol, Ipv4PacketProbe
+                                  // Ipv6L3Protocol, Ipv6PacketProbe
+#include "ns3/lr-wpan-mac.h"      // LrWpanMac
+#include "ns3/lte-module.h"       // PhyReceptionStatParameters,
+                                  // PhyTransmissionStatParameters,
+                                  // LteUePowerControl
+#include "ns3/mesh-module.h"      // PeerManagementProtocol
+#include "ns3/mobility-module.h"  // MobilityModel
+#include "ns3/network-module.h"   // Packet, PacketBurst
+#include "ns3/olsr-module.h"      // olsr::RoutingProtocol
+#include "ns3/sixlowpan-module.h" // SixLowPanNetDevice
+#include "ns3/spectrum-module.h"  // SpectrumValue
+#include "ns3/stats-module.h"     // TimeSeriesAdapter
+#include "ns3/uan-module.h"       // UanPhy
+#include "ns3/wifi-module.h"      // WifiMacHeader, WifiPhyStateHelper
+
+
+#include <iostream>
+#include <sstream>
+#include <set>
+#include <string>
+
+using namespace ns3;
+
+namespace {
+
+/**
+ * Stringify the known TracedCallback type names.
+ *
+ * \tparam T \explicit The typedef name.
+ * \param [in] N The number of arguments expected.
+ * \returns The \c TracedCallback type name.
+ */
+template <typename T> inline
+std::string TypeName (int N) { return "unknown"; }
+
+#define TYPENAME(T)		  \
+  template <> inline std::string  \
+  TypeName < T >     (int N)	  \
+  {				  \
+    std::stringstream ss;	  \
+    ss << # T << "(" << N << ")"; \
+    return ss.str ();		  \
+  }
+
+/**
+ * \name Stringify known typename.
+ * @{
+ */
+TYPENAME (dsr::DsrOptionSRHeader::TracedCallback);
+TYPENAME (EpcUeNas::StateTracedCallback);
+TYPENAME (Ipv4L3Protocol::DropTracedCallback);
+TYPENAME (Ipv4L3Protocol::SentTracedCallback);
+TYPENAME (Ipv4L3Protocol::TxRxTracedCallback);
+TYPENAME (Ipv6L3Protocol::DropTracedCallback);
+TYPENAME (Ipv6L3Protocol::SentTracedCallback);
+TYPENAME (Ipv6L3Protocol::TxRxTracedCallback);
+TYPENAME (LrWpanMac::SentTracedCallback);
+TYPENAME (LrWpanMac::StateTracedCallback);
+TYPENAME (LrWpanPhy::StateTracedCallback);
+TYPENAME (LteEnbMac::DlSchedulingTracedCallback);
+TYPENAME (LteEnbMac::UlSchedulingTracedCallback);
+TYPENAME (LteEnbPhy::ReportInterferenceTracedCallback);
+TYPENAME (LteEnbPhy::ReportUeSinrTracedCallback);
+TYPENAME (LteEnbRrc::ConnectionHandoverTracedCallback);
+TYPENAME (LteEnbRrc::HandoverStartTracedCallback);
+TYPENAME (LteEnbRrc::NewUeContextTracedCallback);
+TYPENAME (LteEnbRrc::ReceiveReportTracedCallback);
+TYPENAME (LtePdcp::PduRxTracedCallback);  
+TYPENAME (LtePdcp::PduTxTracedCallback);
+TYPENAME (LteUePhy::StateTracedCallback);
+TYPENAME (LteUePhy::RsrpSinrTracedCallback);  
+TYPENAME (LteUePhy::RsrpRsrqTracedCallback);
+TYPENAME (LteUeRrc::CellSelectionTracedCallback);
+TYPENAME (LteUeRrc::StateTracedCallback);  
+TYPENAME (Mac48Address::TracedCallback);
+TYPENAME (MobilityModel::TracedCallback);
+TYPENAME (olsr::RoutingProtocol::PacketTxRxTracedCallback);
+TYPENAME (olsr::RoutingProtocol::TableChangeTracedCallback);
+TYPENAME (Packet::AddressTracedCallback);
+TYPENAME (Packet::Mac48AddressTracedCallback);
+TYPENAME (Packet::SinrTracedCallback);
+TYPENAME (Packet::SizeTracedCallback);
+TYPENAME (Packet::TracedCallback);
+TYPENAME (PacketBurst::TracedCallback);
+TYPENAME (dot11s::PeerManagementProtocol::LinkOpenCloseTracedCallback);
+TYPENAME (PhyReceptionStatParameters::TracedCallback);
+TYPENAME (PhyTransmissionStatParameters::TracedCallback);
+TYPENAME (SixLowPanNetDevice::DropTracedCallback);
+TYPENAME (SixLowPanNetDevice::RxTxTracedCallback);
+TYPENAME (SpectrumChannel::LossTracedCallback);
+TYPENAME (SpectrumValue::TracedCallback);
+TYPENAME (TimeSeriesAdaptor::OutputTracedCallback);
+TYPENAME (UanMac::PacketModeTracedCallback);
+TYPENAME (UanMacCw::QueueTracedCallback);
+TYPENAME (UanMacRc::QueueTracedCallback);
+TYPENAME (UanNetDevice::RxTxTracedCallback);
+TYPENAME (UanPhy::TracedCallback);
+TYPENAME (UeManager::StateTracedCallback);
+TYPENAME (WifiMacHeader::TracedCallback);
+TYPENAME (WifiPhyStateHelper::RxOkTracedCallback);
+TYPENAME (WifiPhyStateHelper::StateTracedCallback);
+TYPENAME (WifiPhyStateHelper::TxTracedCallback);
+TYPENAME (WifiRemoteStationManager::PowerChangeTracedCallback);
+TYPENAME (WifiRemoteStationManager::RateChangeTracedCallback);
+/** @} */
+#undef TYPENAME
+
+
+/** Record typedefs which are identical to previously declared. */
+std::set<std::string>
+Duplicates (void)
+{
+  std::set<std::string> dupes;
+
+#define dupename(T)    dupes.insert (# T)
+  
+  dupename (LteRlc::NotifyTxTracedCallback);
+  dupename (LteRlc::ReceiveTracedCallback);
+  dupename (LteUeRrc::ImsiCidRntiTracedCallback);
+  dupename (LteUeRrc::MibSibHandoverTracedCallback);
+  dupename (WifiPhyStateHelper::RxEndErrorTracedCallback);
+
+#undef dupename
+  
+  return dupes;
+}
+  
+/**
+ * Container for duplicate types.
+ */
+std::set<std::string> g_dupes = Duplicates ();
+
+  
+/**
+ * Number of arguments passed to callback.
+ *
+ * Since the sink function is outside the invoking class,
+ * which in this case is TracedCallbackTestCase, we can't use
+ * the test macros directly.  Instead, we cache success
+ * in the \c g_NArgs global value, then inspect it
+ * in the TracedValueCallbackTestCase::CheckType method.
+ */
+int g_NArgs = 0;
+
+
+/**
+ * Log that a callback was invoked.
+ *
+ * We can't actually do anything with any of the arguments,
+ * but the fact we got called is what's important.
+ *
+ * \param [in] N The number of arguments passed to the callback.
+ */
+void SinkIt (unsigned int N)
+{
+  std::cout << "with " << N << " args." << std::endl;
+  g_NArgs = N;
+}
+
+/**
+ * Sink functions.
+ * @{
+ */
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+class TracedCbSink
+{
+public:
+  static void Sink (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) { SinkIt (5); }
+};
+
+template <typename T1, typename T2, typename T3, typename T4>
+class TracedCbSink<T1, T2, T3, T4, empty>
+{
+public:
+  static void Sink (T1 a1, T2 a2, T3 a3, T4 a4) { SinkIt (4); }
+};
+
+template <typename T1, typename T2, typename T3>
+class TracedCbSink<T1, T2, T3, empty, empty>
+{
+public:
+  static void Sink (T1 a1, T2 a2, T3 a3) { SinkIt (3); }
+};
+
+template <typename T1, typename T2>
+class TracedCbSink<T1, T2, empty, empty, empty>
+{
+public:
+  static void Sink (T1 a1, T2 a2) { SinkIt (2); }
+};
+
+template <typename T1>
+class TracedCbSink< T1, empty, empty, empty, empty>
+{
+public:
+  static void Sink (T1 a1) { SinkIt (1); }
+};
+/** @} */
+
+/** Non-const non-reference type. */
+template <typename T>
+struct NonConstReferenced
+{
+  typedef typename TypeTraits< typename TypeTraits<T>::ReferencedType >::NonConstType Type;
+};
+
+}  // anonymous namespace
+
+
+class TracedCallbackTestCase : public TestCase
+{
+public:
+  TracedCallbackTestCase ();
+  virtual ~TracedCallbackTestCase () {}
+  
+private:
+  
+  /** Invoker boilerplate. */
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  class CheckerBase : public Object
+  {
+  public:
+    typename TypeTraits<T1>::BaseType m1;
+    typename TypeTraits<T2>::BaseType m2;
+    typename TypeTraits<T3>::BaseType m3;
+    typename TypeTraits<T4>::BaseType m4;
+    typename TypeTraits<T5>::BaseType m5;
+    
+    void Cleanup (int N)
+    {
+      if (g_NArgs == 0) std::cout << std::endl;
+      NS_ASSERT_MSG (g_NArgs && g_NArgs == N, "failed.");
+      g_NArgs = 0;
+    }
+  };  // CheckerBase
+  
+  /** Callback checkers. */
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  class Checker : public CheckerBase<T1, T2, T3, T4, T5>
+  {
+    TracedCallback<T1, T2, T3, T4, T5> m_cb;
+    
+  public:
+    template <typename U>
+    void Invoke (void)
+    {
+      const int N = 5;
+      U sink = TracedCbSink<T1, T2, T3, T4, T5>::Sink;
+      Callback<void, T1, T2, T3, T4, T5> cb = MakeCallback (sink);
+      
+      std::cout << TypeName<U> (N) << " invoked ";
+      m_cb.ConnectWithoutContext (cb);
+      m_cb (this->m1, this->m2, this->m3, this->m4, this->m5);
+      this->Cleanup (N);
+    }
+  };  // Checker<5>
+    
+  template <typename T1, typename T2, typename T3, typename T4>
+  class Checker<T1, T2, T3, T4, empty>
+    : public CheckerBase<T1, T2, T3, T4, empty>
+  {
+    TracedCallback<T1, T2, T3, T4> m_cb;
+    
+  public:
+    template <typename U>
+    void Invoke (void)
+    {
+      const int N = 4;
+      U sink = TracedCbSink<T1, T2, T3, T4, empty>::Sink;
+      Callback<void, T1, T2, T3, T4> cb = MakeCallback (sink);
+      
+      std::cout << TypeName<U> (N) << " invoked ";
+      m_cb.ConnectWithoutContext (cb);
+      m_cb (this->m1, this->m2, this->m3, this->m4);
+      this->Cleanup (N);
+    }
+  };  // Checker <4>
+    
+
+  template <typename T1, typename T2, typename T3>
+  class Checker<T1, T2, T3, empty, empty>
+    : public CheckerBase<T1, T2, T3, empty, empty>
+  {
+    TracedCallback<T1, T2, T3> m_cb;
+    
+  public:
+    template <typename U>
+    void Invoke (void)
+    {
+      const int N = 3;
+      U sink = TracedCbSink<T1, T2, T3, empty, empty>::Sink;
+      Callback<void, T1, T2, T3> cb = MakeCallback (sink);
+      
+      std::cout << TypeName<U> (N) << " invoked ";
+      m_cb.ConnectWithoutContext (cb);
+      m_cb (this->m1, this->m2, this->m3);
+      this->Cleanup (N);
+    }
+  };  // Checker<3>
+    
+  template <typename T1, typename T2>
+  class Checker<T1, T2, empty, empty, empty>
+    : public CheckerBase<T1, T2, empty, empty, empty>
+  {
+    TracedCallback<T1, T2> m_cb;
+    
+  public:
+    template <typename U>
+    void Invoke (void)
+    {
+      const int N = 2;
+      U sink = TracedCbSink<T1, T2, empty, empty, empty>::Sink;
+      Callback<void, T1, T2> cb = MakeCallback (sink);
+      
+      std::cout << TypeName<U> (N) << " invoked ";
+      m_cb.ConnectWithoutContext (cb);
+      m_cb (this->m1, this->m2);
+      this->Cleanup (N);
+    }
+  };  // Checker<2>
+
+  template <typename T1>
+  class Checker<T1, empty, empty, empty, empty>
+    : public CheckerBase<T1, empty, empty, empty, empty>
+  {
+    TracedCallback<T1> m_cb;
+    
+  public:
+    template <typename U>
+    void Invoke (void)
+    {
+      const int N = 1;
+      U sink = TracedCbSink<T1, empty, empty, empty, empty>::Sink;
+      Callback<void, T1> cb = MakeCallback (sink);
+      
+      std::cout << TypeName<U> (N) << " invoked ";
+      m_cb.ConnectWithoutContext (cb);
+      m_cb (this->m1);
+      this->Cleanup (N);
+    }
+  };  // Checker<1>
+
+  virtual void DoRun (void);
+
+};  // TracedCallbackTestCase
+
+TracedCallbackTestCase::TracedCallbackTestCase ()
+  : TestCase ("Check basic TracedCallback operation")
+{
+}
+
+void
+TracedCallbackTestCase::DoRun (void)
+{
+
+#define DUPE(U, T1)                                                     \
+  if (g_dupes.find ( # U ) == g_dupes.end ())                           \
+    NS_TEST_ASSERT_MSG_NE (0, 1,                                        \
+                         "expected to find " <<  # U << " in dupes.");  \
+  if (TypeName<U> (0) == TypeName<T1> (0))                              \
+    std::cout << # U << " matches " << # T1  << std::endl;              \
+  else                                                                  \
+    NS_TEST_ASSERT_MSG_EQ                                               \
+      (TypeName<U> (0), TypeName<T1> (0),                               \
+       "the typedef " << # U <<                                         \
+       " used to match the typedef " << # T1 <<                         \
+       " but no longer does.  Please add a new CHECK call.")
+
+#define CHECK(U, T1, T2, T3, T4, T5)                                    \
+    CreateObject< Checker<T1, T2, T3, T4, T5> > () -> Invoke<U> ()
+
+  CHECK (dsr::DsrOptionSRHeader::TracedCallback,
+         const dsr::DsrOptionSRHeader &,
+         empty, empty, empty, empty);
+
+  CHECK (EpcUeNas::StateTracedCallback,
+         EpcUeNas::State, EpcUeNas::State,
+         empty, empty, empty);
+
+  CHECK (Ipv4L3Protocol::DropTracedCallback,
+         const Ipv4Header &, Ptr<const Packet>,
+         Ipv4L3Protocol::DropReason, Ptr<Ipv4>, uint32_t );
+
+  CHECK (Ipv4L3Protocol::SentTracedCallback,
+         const Ipv4Header &, Ptr<const Packet>, uint32_t,
+         empty, empty);
+
+  CHECK (Ipv4L3Protocol::TxRxTracedCallback,
+         Ptr<const Packet>, Ptr<Ipv4>, uint32_t,
+         empty, empty);
+  
+  CHECK (Ipv6L3Protocol::DropTracedCallback,
+         const Ipv6Header &, Ptr<const Packet>,
+         Ipv6L3Protocol::DropReason, Ptr<Ipv6>, uint32_t
+        );
+
+  CHECK (Ipv6L3Protocol::SentTracedCallback,
+         const Ipv6Header &, Ptr<const Packet>, uint32_t,
+         empty, empty);
+
+  CHECK (Ipv6L3Protocol::TxRxTracedCallback,
+         Ptr<const Packet>, Ptr<Ipv6>, uint32_t,
+         empty, empty);
+
+  CHECK (LrWpanMac::SentTracedCallback,
+         Ptr<const Packet>, uint8_t, uint8_t,
+         empty, empty);
+
+  CHECK (LrWpanMac::StateTracedCallback,
+         LrWpanMacState, LrWpanMacState,
+         empty, empty, empty);
+
+  CHECK (LrWpanPhy::StateTracedCallback,
+         Time, LrWpanPhyEnumeration, LrWpanPhyEnumeration,
+         empty, empty);
+
+  
+  /*  Too many args :(
+  CHECK (LteEnbMac::DlSchedulingTracedCallback,
+         uint32_t, uint32_t, uint16_t,
+         uint8_t, uint16_t, uint8_t, uint16_t);
+  */
+
+  CHECK (LteEnbMac::UlSchedulingTracedCallback,
+         uint32_t, uint32_t, uint16_t, uint8_t, uint16_t);
+
+  CHECK (LteEnbPhy::ReportUeSinrTracedCallback,
+         uint16_t, uint16_t, double,
+         empty, empty);
+
+  CHECK (LteEnbPhy::ReportInterferenceTracedCallback,
+         uint16_t, Ptr<SpectrumValue>,
+         empty, empty, empty);
+
+  CHECK (LteEnbRrc::ConnectionHandoverTracedCallback,
+         uint64_t, uint16_t, uint16_t,
+         empty, empty);
+
+  CHECK (LteEnbRrc::HandoverStartTracedCallback,
+         uint64_t, uint16_t, uint16_t, uint16_t,
+         empty);
+  
+  CHECK (LteEnbRrc::NewUeContextTracedCallback,
+         uint16_t, uint16_t,
+         empty, empty, empty);
+
+  CHECK (LteEnbRrc::ReceiveReportTracedCallback,
+         uint64_t, uint16_t, uint16_t, LteRrcSap::MeasurementReport,
+         empty);
+
+  CHECK (LtePdcp::PduRxTracedCallback,
+         uint16_t, uint8_t, uint32_t, uint64_t,
+         empty);
+
+  CHECK (LtePdcp::PduTxTracedCallback,
+         uint16_t, uint8_t, uint32_t,
+         empty, empty);
+
+  DUPE  (LteRlc::NotifyTxTracedCallback, LtePdcp::PduTxTracedCallback);
+
+  DUPE  (LteRlc::ReceiveTracedCallback, LtePdcp::PduRxTracedCallback);
+
+  CHECK (LteUePhy::RsrpSinrTracedCallback,
+         uint16_t, uint16_t, double, double,
+         empty);
+         
+  CHECK (LteUePhy::RsrpRsrqTracedCallback,
+         uint16_t, uint16_t, double, double, bool);
+         
+  CHECK (LteUePhy::StateTracedCallback,
+         uint16_t, uint16_t, LteUePhy::State, LteUePhy::State,
+         empty);
+
+  DUPE   (LteUePowerControl::TxPowerTracedCallback, LteEnbPhy::ReportUeSinrTracedCallback);
+
+  CHECK (LteUeRrc::CellSelectionTracedCallback,
+         uint64_t, uint16_t,
+         empty, empty, empty);
+
+  DUPE  (LteUeRrc::ImsiCidRntiTracedCallback, LteEnbRrc::ConnectionHandoverTracedCallback);
+
+  DUPE   (LteUeRrc::MibSibHandoverTracedCallback, LteEnbRrc::HandoverStartTracedCallback);
+
+  CHECK (LteUeRrc::StateTracedCallback,
+         uint64_t, uint16_t, uint16_t, LteUeRrc::State, LteUeRrc::State);
+         
+  CHECK (Mac48Address::TracedCallback,
+         Mac48Address,
+         empty, empty, empty, empty);
+
+  CHECK (MobilityModel::TracedCallback,
+         Ptr<const MobilityModel>,
+         empty, empty, empty, empty);
+
+  CHECK (olsr::RoutingProtocol::PacketTxRxTracedCallback,
+         const olsr::PacketHeader &, const olsr::MessageList &,
+         empty, empty, empty);
+
+  CHECK (olsr::RoutingProtocol::TableChangeTracedCallback,
+         uint32_t,
+         empty, empty, empty, empty);
+
+  CHECK (Packet::AddressTracedCallback,
+         Ptr<const Packet>, const Address &,
+         empty, empty, empty);
+
+  CHECK (Packet::Mac48AddressTracedCallback,
+         Ptr<const Packet>, Mac48Address,
+         empty, empty, empty);
+
+  CHECK (Packet::SinrTracedCallback,
+         Ptr<const Packet>, double,
+         empty, empty, empty);
+
+  CHECK (Packet::SizeTracedCallback,
+         uint32_t, uint32_t,
+         empty, empty, empty);
+
+  CHECK (Packet::TracedCallback,
+         Ptr<const Packet>,
+         empty, empty, empty, empty);
+
+  CHECK (PacketBurst::TracedCallback,
+         Ptr<const PacketBurst>,
+         empty, empty, empty, empty);
+
+  CHECK (dot11s::PeerManagementProtocol::LinkOpenCloseTracedCallback,
+         Mac48Address, Mac48Address,
+         empty, empty, empty);
+         
+  CHECK (PhyReceptionStatParameters::TracedCallback,
+         PhyReceptionStatParameters,
+         empty, empty, empty, empty);
+
+  CHECK (PhyTransmissionStatParameters::TracedCallback,
+         PhyTransmissionStatParameters,
+         empty, empty, empty, empty);
+
+  CHECK (SixLowPanNetDevice::DropTracedCallback,
+         SixLowPanNetDevice::DropReason, Ptr<const Packet>,
+         Ptr<SixLowPanNetDevice>, uint32_t,
+         empty);
+
+  CHECK (SixLowPanNetDevice::RxTxTracedCallback,
+         Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t,
+         empty, empty);
+
+  CHECK (SpectrumChannel::LossTracedCallback,
+         Ptr<SpectrumPhy>, Ptr<SpectrumPhy>, double,
+         empty, empty);
+  
+  CHECK (SpectrumValue::TracedCallback,
+         Ptr<SpectrumValue>,
+         empty, empty, empty, empty);
+
+  CHECK (TimeSeriesAdaptor::OutputTracedCallback,
+         double, double,
+         empty, empty, empty);
+
+  CHECK (UanMac::PacketModeTracedCallback,
+         Ptr<const Packet>, UanTxMode,
+         empty, empty, empty);
+         
+  CHECK (UanMacCw::QueueTracedCallback,
+         Ptr<const Packet>, uint16_t,
+         empty, empty, empty);
+         
+  CHECK (UanMacRc::QueueTracedCallback,
+         Ptr<const Packet>, uint32_t,
+         empty, empty, empty);
+
+  CHECK (UanNetDevice::RxTxTracedCallback,
+         Ptr<const Packet>, UanAddress,
+         empty, empty, empty);
+         
+  CHECK (UanPhy::TracedCallback,
+         Ptr<const Packet>, double, UanTxMode,
+         empty, empty);
+
+  CHECK (UeManager::StateTracedCallback,
+         uint64_t, uint16_t, uint16_t, UeManager::State, UeManager::State);
+  
+  CHECK (WifiMacHeader::TracedCallback,
+         const WifiMacHeader &,
+         empty, empty, empty, empty);
+
+  DUPE   (WifiPhyStateHelper::RxEndErrorTracedCallback, Packet::SinrTracedCallback);
+
+  CHECK (WifiPhyStateHelper::RxOkTracedCallback,
+         Ptr<const Packet>, double, WifiMode, WifiPreamble,
+         empty);
+
+  CHECK (WifiPhyStateHelper::StateTracedCallback,
+         Time, Time, WifiPhy::State,
+         empty, empty);
+
+  CHECK (WifiPhyStateHelper::TxTracedCallback,
+         Ptr<const Packet>, WifiMode, WifiPreamble, uint8_t,
+         empty);
+
+  CHECK (WifiRemoteStationManager::PowerChangeTracedCallback,
+         uint8_t, Mac48Address,
+         empty, empty, empty);
+
+  CHECK (WifiRemoteStationManager::RateChangeTracedCallback,
+         uint32_t, Mac48Address,
+         empty, empty, empty);
+}
+
+class TracedCallbackTestSuite : public TestSuite
+{
+public:
+  TracedCallbackTestSuite ();
+};
+
+TracedCallbackTestSuite::TracedCallbackTestSuite ()
+  : TestSuite ("traced-callback", UNIT)
+{
+  AddTestCase (new TracedCallbackTestCase, TestCase::QUICK);
+}
+
+static TracedCallbackTestSuite tracedCallbackTestSuite;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/test/traced/traced-value-callback-typedef-test-suite.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -0,0 +1,240 @@
+/* -*- 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
+ *
+ * Author:  Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
+ */
+
+#include "ns3/test.h"
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"  // SequenceNumber32
+
+using namespace ns3;
+
+namespace {
+
+/**
+ * \name Stringify the known TracedValue type names.
+ *
+ * \returns The \c TracedValueCallback type name.
+ * @{
+ */
+template <typename T> inline
+std::string TypeName (void) { return "unknown"; }
+
+template <> inline std::string TypeName <bool>     (void) { return "Bool"    ; }
+template <> inline std::string TypeName <int8_t>   (void) { return "Int8_t"  ; }
+template <> inline std::string TypeName <int16_t>  (void) { return "Int16_t" ; }
+template <> inline std::string TypeName <int32_t>  (void) { return "Int32_t" ; }
+template <> inline std::string TypeName <uint8_t>  (void) { return "Uint8_t" ; }
+template <> inline std::string TypeName <uint16_t> (void) { return "Uint16_t"; }
+template <> inline std::string TypeName <uint32_t> (void) { return "Uint32_t"; }
+template <> inline std::string TypeName <double>   (void) { return "Double"  ; }
+template <> inline std::string TypeName <Time>     (void) { return "Time"    ; }
+template <> inline std::string TypeName <SequenceNumber32> (void) { return "SequenceNumber32" ; }
+/** @} */
+
+
+/**
+ * Result of callback test.
+ *
+ * Since the sink function is outside the invoking class,
+ * which in this case is TracedValueCallbackTestCase, we can't use
+ * the test macros directly.  Instead, we cache the result
+ * in the \c g_Result global value, then inspect it
+ * in the TracedValueCallbackTestCase::CheckType method.
+ */
+std::string g_Result = "";
+  
+
+/**
+ * Template for TracedValue sink functions.
+ *
+ * This generates a sink function for any underlying type.
+ *
+ * \tparam T \explicit The type of the value being traced.
+ *        Since the point of this template is to create a
+ *        sink function, the template type must be given explicitly.
+ * \param [in] oldValue The original value.
+ * \param [in] newValue The new value.
+ */
+template <typename T>
+void TracedValueCbSink (T oldValue, T newValue)
+{
+  std::cout << ": "
+            << (int64_t)oldValue << " -> "
+            << (int64_t)newValue
+            << std::endl;
+  if (oldValue != 0)
+    g_Result = "oldValue should be 0";
+  else if (newValue != 1)
+    g_Result = "newValue should be 1";
+
+}  // TracedValueCbSink<>()
+  
+/**
+ * TracedValueCbSink specialization for Time.
+ */
+template <>
+void TracedValueCbSink<Time> (Time oldValue, Time newValue)
+{
+  TracedValueCbSink <int64_t> (oldValue.GetInteger (),
+                               newValue.GetInteger ());
+}
+/**
+ * TracedValueCbSink specialization for SequenceNumber32.
+ */
+template <>  
+void TracedValueCbSink<SequenceNumber32> (SequenceNumber32 oldValue,
+                                          SequenceNumber32 newValue)
+{
+  TracedValueCbSink <int64_t> (oldValue.GetValue (), newValue.GetValue ());
+}
+
+
+}  // anonymous namespace
+
+  
+class TracedValueCallbackTestCase : public TestCase
+{
+public:
+  TracedValueCallbackTestCase ();
+  virtual ~TracedValueCallbackTestCase () {}
+
+private:
+
+  /**
+   * A class to check that the callback function typedef will
+   * actually connect to the TracedValue.
+   */
+  template <typename T>
+  class CheckTvCb : public Object
+  {
+    TracedValue<T> m_value;
+
+  public:
+    /** Constructor. */
+    CheckTvCb (void)  : m_value (0)  { }
+    
+    /** Register this type. */
+    static TypeId GetTypeId (void)
+    {
+      static TypeId tid =
+        TypeId ( ("CheckTvCb<" + TypeName<T>() + ">").c_str ())
+        .SetParent <Object> ()
+        .AddTraceSource ("value",
+                         "A value being traced.",
+                         MakeTraceSourceAccessor (&CheckTvCb<T>::m_value),
+                         ("ns3::TracedValueCallback::" + TypeName<T>()).c_str () )
+        ;
+      return tid;
+    }  // GetTypeId ()
+
+    /**
+     * Check the sink function against the actual TracedValue invocation.
+     *
+     * We connect the TracedValue to the sink.  If the types
+     * aren't compatible, the connection will fail.
+     *
+     * Just to make sure, we increment the TracedValue,
+     * which calls the sink..
+     */
+    template <typename U>
+    void Invoke (U cb)
+    {
+      bool ok = TraceConnectWithoutContext ("value", MakeCallback (cb));
+      std::cout << GetTypeId () << ": "
+                << (ok ? "connected " : "failed to connect ")
+                << GetTypeId ().GetTraceSource (0).callback
+        ;
+      // The endl is in the sink function.
+      
+      if (ok)
+        // Odd form here is to accomodate the uneven operator support
+        // of Time and SequenceNumber32.
+        m_value = m_value + (T) 1; 
+      else
+        {
+          // finish the line started above
+          std::cout << std::endl;
+
+          // and log the error
+          g_Result = "failed to connect callback";
+        }
+
+    }  // Invoke()
+
+  };  // class CheckTvCb<T>
+  
+
+  /**
+   * Check the TracedValue typedef against TracedValueCbSink<T>.
+   *
+   * We instantiate a sink function of type \c U, initialized to
+   * TracedValueCbSink<T>.  If this compiles, we've proved the
+   * sink function and the typedef agree.
+   *
+   * \tparam T \explicit The base type.
+   * \tparam U \explicit The TracedValueCallback sink typedef type.
+   */
+  template <typename T, typename U>
+  void CheckType (void)
+  {
+    U sink = TracedValueCbSink<T>;
+    CreateObject<CheckTvCb<T> > ()->Invoke (sink);
+
+    NS_TEST_ASSERT_MSG_EQ (g_Result, "", g_Result);
+    g_Result = "";
+    
+  }  // CheckType<>()
+    
+  virtual void DoRun (void);
+
+};
+
+TracedValueCallbackTestCase::TracedValueCallbackTestCase ()
+  : TestCase ("Check basic TracedValue callback operation")
+{
+}
+
+void
+TracedValueCallbackTestCase::DoRun (void)
+{
+  CheckType< bool,     TracedValueCallback::Bool   > ();
+  CheckType< int8_t,   TracedValueCallback::Int8   > ();
+  CheckType< int16_t,  TracedValueCallback::Int16  > ();
+  CheckType< int32_t,  TracedValueCallback::Int32  > ();
+  CheckType< uint8_t,  TracedValueCallback::Uint8  > ();
+  CheckType< uint16_t, TracedValueCallback::Uint16 > ();
+  CheckType< uint32_t, TracedValueCallback::Uint32 > ();
+  CheckType< double,   TracedValueCallback::Double > ();
+  CheckType< Time,     TracedValueCallback::Time   > ();
+  CheckType< SequenceNumber32, TracedValueCallback::SequenceNumber32 > ();
+}
+
+class TracedValueCallbackTestSuite : public TestSuite
+{
+public:
+  TracedValueCallbackTestSuite ();
+};
+
+TracedValueCallbackTestSuite::TracedValueCallbackTestSuite ()
+  : TestSuite ("tracedvalue-callback", UNIT)
+{
+  AddTestCase (new TracedValueCallbackTestCase, TestCase::QUICK);
+}
+
+static TracedValueCallbackTestSuite tracedValueCallbackTestSuite;
--- a/src/test/wscript	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/test/wscript	Tue Aug 18 16:59:27 2015 -0700
@@ -15,7 +15,14 @@
     if 'test' in bld.env['MODULES_NOT_BUILT']:
         return
 
-    test = bld.create_ns3_module('test', ['internet', 'mobility', 'applications', 'csma', 'bridge', 'config-store', 'point-to-point', 'csma-layout', 'flow-monitor', 'wifi'])
+    test = bld.create_ns3_module('test',
+                                 ['applications', 'bridge', 'config-store',
+                                  'csma', 'csma-layout', 'dsr',
+                                  'flow-monitor', 'internet', 'lr-wpan',
+                                  'lte', 'mesh', 'mobility', 'olsr',
+                                  'point-to-point', 'sixlowpan', 'stats',
+                                  'uan', 'wifi'])
+
     headers = bld(features='ns3header')
     headers.module = 'test'
 
@@ -32,5 +39,7 @@
         'ns3tcp/ns3tcp-socket-writer.cc',
         'ns3wifi/wifi-interference-test-suite.cc',
         'ns3wifi/wifi-msdu-aggregator-test-suite.cc',
+        'traced/traced-callback-typedef-test-suite.cc',
+        'traced/traced-value-callback-typedef-test-suite.cc',
         ]
 
--- a/src/uan/model/acoustic-modem-energy-model.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/acoustic-modem-energy-model.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -66,7 +66,7 @@
     .AddTraceSource ("TotalEnergyConsumption",
                      "Total energy consumption of the modem device.",
                      MakeTraceSourceAccessor (&AcousticModemEnergyModel::m_totalEnergyConsumption),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ;
   return tid;
 }
--- a/src/uan/model/uan-mac-cw.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/uan-mac-cw.h	Tue Aug 18 16:59:27 2015 -0700
@@ -107,7 +107,7 @@
    * \param [in] proto The protocol number.
    */
   typedef void (* QueueTracedCallback)
-    (const Ptr<const Packet> packet, const uint16_t proto);
+    (Ptr<const Packet> packet, uint16_t proto);
 
 private:
   /** Enum defining possible Phy states. */
--- a/src/uan/model/uan-mac-rc-gw.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/uan-mac-rc-gw.h	Tue Aug 18 16:59:27 2015 -0700
@@ -89,10 +89,8 @@
    * \param [in] actualX Current retry rate.
    */
   typedef void (* CycleCallback)
-    (const Time now, const Time delay,
-     const uint32_t numRts, const uint32_t totalBytes,
-     const double secs, const uint32_t ctlRate,
-     const double actualX);
+    (Time now, Time delay, uint32_t numRts, uint32_t totalBytes,
+     double secs, uint32_t ctlRate, double actualX);
 
   
 private:
--- a/src/uan/model/uan-mac-rc.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/uan-mac-rc.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -254,11 +254,11 @@
     .AddTraceSource ("Enqueue",
                      "A  (data) packet arrived at MAC for transmission.",
                      MakeTraceSourceAccessor (&UanMacRc::m_enqueueLogger),
-                     "ns3::UanMac::PacketModeTracedCallback")
+                     "ns3::UanMacRc::QueueTracedCallback")
     .AddTraceSource ("Dequeue",
                      "A  (data) packet was passed down to PHY from MAC.",
                      MakeTraceSourceAccessor (&UanMacRc::m_dequeueLogger),
-                     "ns3::UanMac::PacketModeTracedCallback")
+                     "ns3::UanMacRc::QueueTracedCallback")
     .AddTraceSource ("RX",
                      "A packet was destined for and received at this MAC layer.",
                      MakeTraceSourceAccessor (&UanMacRc::m_rxLogger),
--- a/src/uan/model/uan-mac-rc.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/uan-mac-rc.h	Tue Aug 18 16:59:27 2015 -0700
@@ -192,6 +192,15 @@
   virtual void Clear (void);
   int64_t AssignStreams (int64_t stream);
 
+  /**
+   *  TracedCallback signature for dequeue of a packet.
+   *
+   * \param [in] packet The Packet being received.
+   * \param [in] proto The protocol number.
+   */
+  typedef void (* QueueTracedCallback)
+    (Ptr<const Packet> packet, uint32_t proto);
+  
 private:
   /** MAC state. */
   enum State {
@@ -235,11 +244,11 @@
   Callback<void, Ptr<Packet>, const UanAddress& > m_forwardUpCb;
 
   /** A packet was destined for and received at this MAC layer. */
-  TracedCallback<Ptr<const Packet>, UanTxMode &> m_rxLogger;
+  TracedCallback<Ptr<const Packet>, UanTxMode > m_rxLogger;
   /** A packet arrived at the MAC for transmission. */
-  TracedCallback<Ptr<const Packet>, uint16_t > m_enqueueLogger;
+  TracedCallback<Ptr<const Packet>, uint32_t > m_enqueueLogger;
   /** A was passed down to the PHY from the MAC. */
-  TracedCallback<Ptr<const Packet>, uint16_t > m_dequeueLogger;
+  TracedCallback<Ptr<const Packet>, uint32_t > m_dequeueLogger;
 
   /** The RTS event. */
   EventId m_rtsEvent;
--- a/src/uan/model/uan-mac.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/uan-mac.h	Tue Aug 18 16:59:27 2015 -0700
@@ -123,7 +123,7 @@
    * \param [in] mode The UanTxMode.
    */
   typedef void (* PacketModeTracedCallback)
-    (const Ptr<const Packet> packet, const UanTxMode & mode);
+    (Ptr<const Packet> packet, UanTxMode mode);
 
 };  // class UanMac
 
--- a/src/uan/model/uan-net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/uan-net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -154,7 +154,7 @@
    * \param [in] address The source address.
    */
   typedef void (* RxTxTracedCallback)
-    (const Ptr<const Packet> packet, const UanAddress address);
+    (Ptr<const Packet> packet, UanAddress address);
   
 private:
   /**
--- a/src/uan/model/uan-phy.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/uan/model/uan-phy.h	Tue Aug 18 16:59:27 2015 -0700
@@ -210,7 +210,7 @@
    * \param [in] mode The channel mode.
    */
   typedef void (* TracedCallback)
-    (const Ptr<const Packet> pkt, const double sinr, const UanTxMode mode);
+    (Ptr<const Packet> pkt, double sinr, UanTxMode mode);
 
   
   /**
--- a/src/wave/model/wave-net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wave/model/wave-net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -352,6 +352,10 @@
   Ptr<ChannelCoordinator> m_channelCoordinator;
   Ptr<VsaManager> m_vsaManager;
   TxProfile *m_txProfile;
+  /**
+   * \todo The Address arguments should be passed
+   * by const reference, since they are large.
+   */
   TracedCallback<Address, Address> m_addressChange;
 
   // copy from WifiNetDevice
--- a/src/wifi/model/aparf-wifi-manager.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/aparf-wifi-manager.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -105,11 +105,11 @@
     .AddTraceSource ("PowerChange",
                      "The transmission power has change",
                      MakeTraceSourceAccessor (&AparfWifiManager::m_powerChange),
-                     "ns3::AparfWifiManager::PowerChangeTracedCallback")
+                     "ns3::WifiRemoteStationManager::PowerChangeTracedCallback")
     .AddTraceSource ("RateChange",
                      "The transmission rate has change",
                      MakeTraceSourceAccessor (&AparfWifiManager::m_rateChange),
-                     "ns3::AparfWifiManager::RateChangeTracedCallback")
+                     "ns3::WifiRemoteStationManager::RateChangeTracedCallback")
   ;
   return tid;
 }
--- a/src/wifi/model/aparf-wifi-manager.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/aparf-wifi-manager.h	Tue Aug 18 16:59:27 2015 -0700
@@ -62,23 +62,6 @@
     Spread
   };
 
-  /**
-   * TracedCallback signature for power change events.
-   *
-   * \param [in] power The new power.
-   * \param [in] address The remote station MAC address.
-   */
-  typedef void (*PowerChangeTracedCallback)(const uint8_t power, const Mac48Address remoteAddress);
-
-  /**
-   * TracedCallback signature for rate change events.
-   *
-   * \param [in] rate The new rate.
-   * \param [in] address The remote station MAC address.
-   */
-  typedef void (*RateChangeTracedCallback)(const uint32_t rate, const Mac48Address remoteAddress);
-
-
 private:
   //overriden from base class
   virtual WifiRemoteStation * DoCreateStation (void) const;
--- a/src/wifi/model/parf-wifi-manager.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/parf-wifi-manager.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -73,11 +73,11 @@
     .AddTraceSource ("PowerChange",
                      "The transmission power has change",
                      MakeTraceSourceAccessor (&ParfWifiManager::m_powerChange),
-                     "ns3::ParfWifiManager::PowerChangeTracedCallback")
+                     "ns3::WifiRemoteStationManager::PowerChangeTracedCallback")
     .AddTraceSource ("RateChange",
                      "The transmission rate has change",
                      MakeTraceSourceAccessor (&ParfWifiManager::m_rateChange),
-                     "ns3::ParfWifiManager::RateChangeTracedCallback")
+                     "ns3::WifiRemoteStationManager::RateChangeTracedCallback")
   ;
   return tid;
 }
--- a/src/wifi/model/parf-wifi-manager.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/parf-wifi-manager.h	Tue Aug 18 16:59:27 2015 -0700
@@ -50,21 +50,6 @@
 
   virtual void SetupPhy (Ptr<WifiPhy> phy);
 
-  /**
-   * TracedCallback signature for power change events.
-   *
-   * \param [in] power The new power.
-   * \param [in] address The remote station MAC address.
-   */
-  typedef void (*PowerChangeTracedCallback)(const uint8_t power, const Mac48Address remoteAddress);
-  /**
-   * TracedCallback signature for rate change events.
-   *
-   * \param [in] rate The new rate.
-   * \param [in] address The remote station MAC address.
-   */
-  typedef void (*RateChangeTracedCallback)(const uint32_t rate, const Mac48Address remoteAddress);
-
 
 private:
   //overriden from base class
--- a/src/wifi/model/wifi-phy-state-helper.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/wifi-phy-state-helper.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -48,7 +48,7 @@
     .AddTraceSource ("RxError",
                      "A packet has been received unsuccessfully.",
                      MakeTraceSourceAccessor (&WifiPhyStateHelper::m_rxErrorTrace),
-                     "ns3::WifiPhyStateHelper::RxErrorTracedCallback")
+                     "ns3::WifiPhyStateHelper::RxEndErrorTracedCallback")
     .AddTraceSource ("Tx", "Packet transmission is starting.",
                      MakeTraceSourceAccessor (&WifiPhyStateHelper::m_txTrace),
                      "ns3::WifiPhyStateHelper::TxTracedCallback")
--- a/src/wifi/model/wifi-phy-state-helper.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/wifi-phy-state-helper.h	Tue Aug 18 16:59:27 2015 -0700
@@ -187,7 +187,7 @@
   void SwitchFromSleep (Time duration);
 
   /** \todo Why is this public? */
-  TracedCallback<Time,Time,enum WifiPhy::State> m_stateLogger;
+  TracedCallback<Time, Time, enum WifiPhy::State> m_stateLogger;
 
   /**
    * TracedCallback signature for state changes.
@@ -197,7 +197,8 @@
    *             the \p state.
    * \param [in] state The state.
    */
-  typedef void (* StateTracedCallback)(const Time start, const Time duration, const WifiPhy::State state);
+  typedef void (* StateTracedCallback)
+    (Time start, Time duration, WifiPhy::State state);
 
   /**
    * TracedCallback signature for receive end ok event.
@@ -207,8 +208,8 @@
    * \param [in] mode   The transmission mode of the packet.
    * \param [in] preamble The preamble of the packet.
    */
-  typedef void (* RxOkTracedCallback)(const Ptr<const Packet> packet, const double snr,
-                                      const WifiMode mode, const WifiPreamble preamble);
+  typedef void (* RxOkTracedCallback)
+    (Ptr<const Packet> packet, double snr, WifiMode mode, WifiPreamble preamble);
 
   /**
    * TracedCallback signature for receive end error event.
@@ -216,7 +217,8 @@
    * \param [in] packet The received packet.
    * \param [in] snr    The SNR of the received packet.
    */
-  typedef void (* RxEndErrorTracedCallback)(const Ptr<const Packet> packet, const double snr);
+  typedef void (* RxEndErrorTracedCallback)
+    (Ptr<const Packet> packet, double snr);
 
   /**
    * TracedCallback signature for transmit event.
@@ -226,8 +228,9 @@
    * \param [in] preamble The preamble of the packet.
    * \param [in] power  The transmit power level.
    */
-  typedef void (* TxTracedCallback)(const Ptr<const Packet> packet, const WifiMode mode,
-                                    const WifiPreamble preamble, const uint8_t power);
+  typedef void (* TxTracedCallback)
+    (Ptr<const Packet> packet, WifiMode mode,
+     WifiPreamble preamble, uint8_t power);
 
 
 private:
--- a/src/wifi/model/wifi-phy.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/wifi-phy.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -95,12 +95,12 @@
                      "Trace source simulating a wifi device in monitor mode "
                      "sniffing all received frames",
                      MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffRxTrace),
-                     "ns3::WifiPhy::MonitorSnifferRxCallback")
+                     "ns3::WifiPhy::MonitorSnifferRxTracedCallback")
     .AddTraceSource ("MonitorSnifferTx",
                      "Trace source simulating the capability of a wifi device "
                      "in monitor mode to sniff all frames being transmitted",
                      MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffTxTrace),
-                     "ns3::WifiPhy::MonitorSnifferTxCallback")
+                     "ns3::WifiPhy::MonitorSnifferTxTracedCallback")
   ;
   return tid;
 }
--- a/src/wifi/model/wifi-phy.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/wifi-phy.h	Tue Aug 18 16:59:27 2015 -0700
@@ -1039,10 +1039,14 @@
    * \param aMpdu the type of the packet (0 is not A-MPDU, 1 is a MPDU that is part of an A-MPDU and 2 is the last MPDU in an A-MPDU)
    *        and the A-MPDU reference number (must be a different value for each A-MPDU but the same for each subframe within one A-MPDU)
    * \param signalNoise signal power and noise power in dBm
+   * \todo WifiTxVector should be passed by const reference because
+   * of its size.
    */
-  typedef void (* MonitorSnifferRxCallback)(Ptr<const Packet> packet, uint16_t channelFreqMhz,
-                                            uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
-                                            WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise);
+  typedef void (* MonitorSnifferRxCallback)
+    (Ptr<const Packet> packet, uint16_t channelFreqMhz,
+     uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
+     WifiTxVector txVector, struct mpduInfo aMpdu,
+     struct signalNoiseDbm signalNoise);
 
   /**
    * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
@@ -1076,10 +1080,13 @@
    * \param txVector the TXVECTOR that holds tx parameters
    * \param aMpdu the type of the packet (0 is not A-MPDU, 1 is a MPDU that is part of an A-MPDU and 2 is the last MPDU in an A-MPDU)
    *        and the A-MPDU reference number (must be a different value for each A-MPDU but the same for each subframe within one A-MPDU)
+   * \todo WifiTxVector should be passed by const reference because
+   * of its size.
    */
-  typedef void (* MonitorSnifferTxCallback)(const Ptr<const Packet> packet, uint16_t channelFreqMhz,
-                                            uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
-                                            WifiTxVector txVector, struct mpduInfo aMpdu);
+  typedef void (* MonitorSnifferTxCallback)
+    (const Ptr<const Packet> packet, uint16_t channelFreqMhz,
+     uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
+     WifiTxVector txVector, struct mpduInfo aMpdu);
 
   /**
    * Assign a fixed random variable stream number to the random variables
@@ -1214,8 +1221,12 @@
    * ieee80211_input_monitor()
    *
    * \see class CallBackTraceSource
+   * \todo WifiTxVector and signalNoiseDbm should be be passed as
+   * const  references because of their sizes.
    */
-  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo, struct signalNoiseDbm> m_phyMonitorSniffRxTrace;
+  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
+                 WifiPreamble, WifiTxVector,
+                 struct mpduInfo, struct signalNoiseDbm> m_phyMonitorSniffRxTrace;
 
   /**
    * A trace source that emulates a wifi device in monitor mode
@@ -1226,8 +1237,12 @@
    * ieee80211_input_monitor()
    *
    * \see class CallBackTraceSource
+   * \todo WifiTxVector should be passed by const reference because
+   * of its size.
    */
-  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo> m_phyMonitorSniffTxTrace;
+  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t,
+                 WifiPreamble, WifiTxVector,
+                 struct mpduInfo> m_phyMonitorSniffTxTrace;
 
   uint32_t m_totalAmpduNumSymbols; //!< Number of symbols previously transmitted for the MPDUs in an A-MPDU, used for the computation of the number of symbols needed for the last MPDU in the A-MPDU
   uint32_t m_totalAmpduSize;       //!< Total size of the previously transmitted MPDUs in an A-MPDU, used for the computation of the number of symbols needed for the last MPDU in the A-MPDU
--- a/src/wifi/model/wifi-radio-energy-model.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/wifi-radio-energy-model.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -83,7 +83,7 @@
     .AddTraceSource ("TotalEnergyConsumption",
                      "Total energy consumption of the radio device.",
                      MakeTraceSourceAccessor (&WifiRadioEnergyModel::m_totalEnergyConsumption),
-                     "ns3::TracedValue::DoubleCallback")
+                     "ns3::TracedValueCallback::Double")
   ; 
   return tid;
 }
--- a/src/wifi/model/wifi-remote-station-manager.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wifi/model/wifi-remote-station-manager.h	Tue Aug 18 16:59:27 2015 -0700
@@ -594,6 +594,25 @@
    */
   uint32_t GetNumberOfTransmitAntennas (void);
 
+  /**
+   * TracedCallback signature for power change events.
+   *
+   * \param [in] power The new power.
+   * \param [in] address The remote station MAC address.
+   */
+  typedef void (*PowerChangeTracedCallback)
+    (uint8_t power, Mac48Address remoteAddress);
+
+  /**
+   * TracedCallback signature for rate change events.
+   *
+   * \param [in] rate The new rate.
+   * \param [in] address The remote station MAC address.
+   */
+  typedef void (*RateChangeTracedCallback)
+    (uint32_t rate, Mac48Address remoteAddress);
+
+
 
 protected:
   virtual void DoDispose (void);
--- a/src/wimax/model/simple-ofdm-wimax-phy.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wimax/model/simple-ofdm-wimax-phy.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -94,7 +94,7 @@
 
     .AddTraceSource ("Rx", "Receive trace",
                      MakeTraceSourceAccessor (&SimpleOfdmWimaxPhy::m_traceRx),
-                     "ns3::PacketBurst::Traced::Ptr")
+                     "ns3::PacketBurst::TracedCallback")
     .AddTraceSource ("Tx", "Transmit trace",
                      MakeTraceSourceAccessor (&SimpleOfdmWimaxPhy::m_traceTx),
                      "ns3::PacketBurst::TracedCallback")
--- a/src/wimax/model/simple-ofdm-wimax-phy.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wimax/model/simple-ofdm-wimax-phy.h	Tue Aug 18 16:59:27 2015 -0700
@@ -273,6 +273,8 @@
    * the medium.
    *
    * \see class CallBackTraceSource
+   * \deprecated The non-const \c Ptr<PacketBurst> argument is deprecated
+   * and will be changed to \c Ptrc<PacketBurst> in a future release.
    */
   TracedCallback <Ptr<PacketBurst > >  m_phyTxBeginTrace;
 
@@ -281,6 +283,8 @@
    * the medium.
    *
    * \see class CallBackTraceSource
+   * \deprecated The non-const \c Ptr<PacketBurst> argument is deprecated
+   * and will be changed to \c Ptrc<PacketBurst> in a future release.
    */
   TracedCallback<Ptr<PacketBurst > > m_phyTxEndTrace;
 
@@ -289,6 +293,8 @@
    * to transmit it.
    *
    * \see class CallBackTraceSource
+   * \deprecated The non-const \c Ptr<PacketBurst> argument is deprecated
+   * and will be changed to \c Ptrc<PacketBurst> in a future release.
    */
   TracedCallback<Ptr<PacketBurst > > m_phyTxDropTrace;
 
@@ -297,6 +303,8 @@
    * the medium.
    *
    * \see class CallBackTraceSource
+   * \deprecated The non-const \c Ptr<PacketBurst> argument is deprecated
+   * and will be changed to \c Ptrc<PacketBurst> in a future release.
    */
   TracedCallback<Ptr<PacketBurst > > m_phyRxBeginTrace;
 
@@ -305,6 +313,8 @@
    * the medium.
    *
    * \see class CallBackTraceSource
+   * \deprecated The non-const \c Ptr<PacketBurst> argument is deprecated
+   * and will be changed to \c Ptrc<PacketBurst> in a future release.
    */
   TracedCallback<Ptr<PacketBurst > > m_phyRxEndTrace;
 
@@ -312,6 +322,8 @@
    * The trace source fired when the phy layer drops a packet it has received.
    *
    * \see class CallBackTraceSource
+   * \deprecated The non-const \c Ptr<PacketBurst> argument is deprecated
+   * and will be changed to \c Ptrc<PacketBurst> in a future release.
    */
   TracedCallback<Ptr<PacketBurst > > m_phyRxDropTrace;
 
--- a/src/wimax/model/ss-net-device.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wimax/model/ss-net-device.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -915,7 +915,7 @@
         }
       else if (GetInitialRangingConnection () != 0 && cid == GetInitialRangingConnection ()->GetCid () && !fragmentation)
         {
-          m_traceSSRx (packet, GetMacAddress (), &cid);
+          m_traceSSRx (packet, GetMacAddress (), cid);
           packet->RemoveHeader (msgType);
           switch (msgType.GetType ())
             {
@@ -934,7 +934,7 @@
         }
       else if (m_basicConnection != 0 && cid == m_basicConnection->GetCid () && !fragmentation)
         {
-          m_traceSSRx (packet, GetMacAddress (), &cid);
+          m_traceSSRx (packet, GetMacAddress (), cid);
           packet->RemoveHeader (msgType);
           switch (msgType.GetType ())
             {
@@ -953,7 +953,7 @@
         }
       else if (m_primaryConnection != 0 && cid == m_primaryConnection->GetCid () && !fragmentation)
         {
-          m_traceSSRx (packet, GetMacAddress (), &cid);
+          m_traceSSRx (packet, GetMacAddress (), cid);
           packet->RemoveHeader (msgType);
           switch (msgType.GetType ())
             {
@@ -1043,7 +1043,7 @@
         }
       else if (cid.IsMulticast ())
         {
-          m_traceSSRx (packet, GetMacAddress (), &cid);
+          m_traceSSRx (packet, GetMacAddress (), cid);
           ForwardUp (packet, m_baseStationId, GetMacAddress ()); // source shall be BS's address or sender SS's?
         }
       else if (IsPromisc ())
--- a/src/wimax/model/ss-net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wimax/model/ss-net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -350,8 +350,10 @@
   Ptr<SsServiceFlowManager> m_serviceFlowManager;
   Ptr<IpcsClassifier> m_classifier;
 
-  TracedCallback<Ptr<const Packet>, Mac48Address, Cid*> m_traceSSRx;
-  TracedCallback<Ptr<const PacketBurst>, Mac48Address, Cid*, WimaxPhy::ModulationType> m_traceSSTx;
+  TracedCallback<Ptr<const Packet>, Mac48Address, const Cid &> m_traceSSRx;
+  /** \todo Remove: this TracedCallback is never invoked. */
+  TracedCallback<Ptr<const PacketBurst>, Mac48Address, const Cid &,
+                 WimaxPhy::ModulationType> m_traceSSTx;
 
   /**
    * The trace source fired when packets come into the "top" of the device
--- a/src/wimax/model/wimax-net-device.cc	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wimax/model/wimax-net-device.cc	Tue Aug 18 16:59:27 2015 -0700
@@ -126,12 +126,12 @@
     .AddTraceSource ("Rx",
                      "Receive trace",
                      MakeTraceSourceAccessor (&WimaxNetDevice::m_traceRx),
-                     "ns3::Packet::TracedCallback")
+                     "ns3::WimaxNetDevice::TxRxTracedCallback")
 
     .AddTraceSource ("Tx",
                      "Transmit trace",
                      MakeTraceSourceAccessor (&WimaxNetDevice::m_traceTx),
-                     "ns3::Packet::TracedCallback");
+                     "ns3::WimaxNetDevice::TxRxTracedCallback");
   return tid;
 }
 
--- a/src/wimax/model/wimax-net-device.h	Tue Aug 18 16:17:36 2015 -0700
+++ b/src/wimax/model/wimax-net-device.h	Tue Aug 18 16:59:27 2015 -0700
@@ -170,7 +170,7 @@
    */
   void SetBandwidthManager (Ptr<BandwidthManager> bandwidthManager);
 
-  /*
+  /**
    * \brief Creates the initial ranging and broadcast connections
    */
   void CreateDefaultConnections (void);
@@ -219,8 +219,34 @@
   NetDevice::PromiscReceiveCallback GetPromiscReceiveCallback (void);
   virtual bool SupportsSendFrom (void) const;
 
-  TracedCallback<Ptr<const Packet>, const Mac48Address&> m_traceRx;
-  TracedCallback<Ptr<const Packet>, const Mac48Address&> m_traceTx;
+  /**
+   * TracedCallback signature for packet and Mac48Address.
+   *
+   * \param [in] packet The packet.
+   * \param [in] mac The Mac48Address.
+   * \deprecated The `const Mac48Address &` argument is deprecated
+   * and will be changed to \c Mac48Address in a future release.
+   * The TracedCallback signature will then match \c Packet::Mac48Address
+   * and this typedef can be removed.
+   */
+  typedef void (* TxRxTracedCallback)
+    (Ptr<const Packet> packet, const Mac48Address & mac);
+  /**
+   * \deprecated The `const Mac48Address &` argument is deprecated
+   * and will be changed to \c Mac48Address in a future release.
+   * The TracedCallback signature will then match \c Packet::Mac48Address
+   * and this typedef can be removed.
+   * \todo This member variable should be private.
+   */
+  TracedCallback<Ptr<const Packet>, const Mac48Address &> m_traceRx;
+  /**
+   * \deprecated The `const Mac48Address &` argument is deprecated
+   * and will be changed to \c Mac48Address in a future release.
+   * The TracedCallback signature will then match \c Packet::Mac48Address
+   * and this typedef can be removed.
+   * \todo This member variable should be private.
+   */
+  TracedCallback<Ptr<const Packet>, const Mac48Address &> m_traceTx;
 
   virtual void DoDispose (void);
   virtual Address GetMulticast (Ipv6Address addr) const;