Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 11 Mar 2008 13:46:22 -0700
changeset 2594a8f89acd17a1
parent 2593 5f22033d1408
child 2595 b504951bcca8
Config::Connect -> Config::ConnectWithoutContext && Config::ConnectWithContext -> Config::Connect
doc/tracing.h
examples/tcp-large-transfer-errors.cc
examples/tcp-large-transfer.cc
examples/tcp-small-transfer-oneloss.cc
examples/tcp-small-transfer.cc
samples/main-ap-wifi.cc
samples/main-random-topology.cc
samples/main-random-walk.cc
src/core/attribute-test.cc
src/core/config.cc
src/core/config.h
src/core/object.cc
src/core/object.h
src/core/trace-source-accessor.h
src/core/traced-callback.cc
src/core/traced-callback.h
src/core/traced-value.h
src/devices/wifi/wifi-trace.cc
src/internet-node/ascii-trace.cc
src/internet-node/pcap-trace.cc
src/mobility/hierarchical-mobility-model.cc
     1.1 --- a/doc/tracing.h	Tue Mar 11 13:34:29 2008 -0700
     1.2 +++ b/doc/tracing.h	Tue Mar 11 13:46:22 2008 -0700
     1.3 @@ -159,7 +159,7 @@
     1.4   * \section TraceConnection Connecting Trace Sources to Trace Sinks
     1.5   * 
     1.6   * If a trace source is integrated in the ns-3 trace connection facility, a user 
     1.7 - * should call the ns3::NodeList::Connect method to establish a connection between
     1.8 + * should call the ns3::NodeList::ConnectWithoutContext method to establish a connection between
     1.9   * a trace sink and a set of matching trace sources. The second argument to that
    1.10   * method is a callback to the user's trace sink.
    1.11   * That callback is easy to construct: call ns3::MakeCallback and you are done. The
    1.12 @@ -178,7 +178,7 @@
    1.13   *   std::cout << "packet: " << packet->Print () << std::endl;
    1.14   * }
    1.15   * // connect the above sink to a matching trace source
    1.16 - * NodeList::Connect ("/nodes/* /devices/* /rx", MakeCallback (&DoSomethingTraceSink));
    1.17 + * NodeList::ConnectWithoutContext ("/nodes/* /devices/* /rx", MakeCallback (&DoSomethingTraceSink));
    1.18   * \endcode
    1.19   *
    1.20   * The connection path string "/nodes/* /devices/* /rx" matches the "rx" trace source
     2.1 --- a/examples/tcp-large-transfer-errors.cc	Tue Mar 11 13:34:29 2008 -0700
     2.2 +++ b/examples/tcp-large-transfer-errors.cc	Tue Mar 11 13:46:22 2008 -0700
     2.3 @@ -239,7 +239,7 @@
     2.4    PcapTrace pcaptrace ("tcp-large-transfer-errors.pcap");
     2.5    pcaptrace.TraceAllIp ();
     2.6  
     2.7 -  Config::Connect ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink));
     2.8 +  Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink));
     2.9  
    2.10    Simulator::StopAt (Seconds(10000));
    2.11    Simulator::Run ();
     3.1 --- a/examples/tcp-large-transfer.cc	Tue Mar 11 13:34:29 2008 -0700
     3.2 +++ b/examples/tcp-large-transfer.cc	Tue Mar 11 13:46:22 2008 -0700
     3.3 @@ -224,7 +224,7 @@
     3.4    PcapTrace pcaptrace ("tcp-large-transfer.pcap");
     3.5    pcaptrace.TraceAllIp ();
     3.6  
     3.7 -  Config::Connect ("/NodeList/*/ApplicationList/*/Rx", 
     3.8 +  Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", 
     3.9                     MakeCallback (&ApplicationTraceSink));
    3.10  
    3.11    Simulator::StopAt (Seconds(1000));
     4.1 --- a/examples/tcp-small-transfer-oneloss.cc	Tue Mar 11 13:34:29 2008 -0700
     4.2 +++ b/examples/tcp-small-transfer-oneloss.cc	Tue Mar 11 13:46:22 2008 -0700
     4.3 @@ -221,7 +221,7 @@
     4.4    PcapTrace pcaptrace ("tcp-small-transfer-oneloss.pcap");
     4.5    pcaptrace.TraceAllIp ();
     4.6  
     4.7 -  Config::Connect ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink));
     4.8 +  Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink));
     4.9  
    4.10    Simulator::StopAt (Seconds(1000));
    4.11    Simulator::Run ();
     5.1 --- a/examples/tcp-small-transfer.cc	Tue Mar 11 13:34:29 2008 -0700
     5.2 +++ b/examples/tcp-small-transfer.cc	Tue Mar 11 13:46:22 2008 -0700
     5.3 @@ -216,7 +216,7 @@
     5.4    PcapTrace pcaptrace ("tcp-small-transfer.pcap");
     5.5    pcaptrace.TraceAllIp ();
     5.6  
     5.7 -  Config::Connect ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink));
     5.8 +  Config::ConnectWithoutContext ("/NodeList/*/ApplicationList/*/Rx", MakeCallback (&ApplicationTraceSink));
     5.9  
    5.10    Simulator::StopAt (Seconds(1000));
    5.11    Simulator::Run ();
     6.1 --- a/samples/main-ap-wifi.cc	Tue Mar 11 13:34:29 2008 -0700
     6.2 +++ b/samples/main-ap-wifi.cc	Tue Mar 11 13:46:22 2008 -0700
     6.3 @@ -155,8 +155,8 @@
     6.4  
     6.5    Simulator::StopAt (Seconds (44.0));
     6.6  
     6.7 -  //NodeList::Connect ("/nodes/*/devices/*/*", MakeCallback (&WifiNetDeviceTrace));
     6.8 -  //NodeList::Connect ("/nodes/*/devices/*/phy/state", MakeCallback (&WifiPhyStateTrace));
     6.9 +  //NodeList::ConnectWithoutContext ("/nodes/*/devices/*/*", MakeCallback (&WifiNetDeviceTrace));
    6.10 +  //NodeList::ConnectWithoutContext ("/nodes/*/devices/*/phy/state", MakeCallback (&WifiPhyStateTrace));
    6.11  
    6.12    Simulator::Run ();
    6.13  
     7.1 --- a/samples/main-random-topology.cc	Tue Mar 11 13:34:29 2008 -0700
     7.2 +++ b/samples/main-random-topology.cc	Tue Mar 11 13:46:22 2008 -0700
     7.3 @@ -44,7 +44,7 @@
     7.4    mobility.SetMobilityModel ("StaticMobilityModel");
     7.5    mobility.Layout (objects.begin (), objects.end ());
     7.6  
     7.7 -  Config::ConnectWithContext ("/NodeList/*/$MobilityModelNotifier/CourseChange",
     7.8 +  Config::Connect ("/NodeList/*/$MobilityModelNotifier/CourseChange",
     7.9                                MakeCallback (&CourseChange));
    7.10    
    7.11    Simulator::StopAt (Seconds (100.0));
     8.1 --- a/samples/main-random-walk.cc	Tue Mar 11 13:34:29 2008 -0700
     8.2 +++ b/samples/main-random-walk.cc	Tue Mar 11 13:46:22 2008 -0700
     8.3 @@ -53,7 +53,7 @@
     8.4                               "Speed", String ("Constant:1.0"),
     8.5                               "Bounds", String ("0:200:0:100"));
     8.6    mobility.Layout (NodeList::Begin (), NodeList::End ());
     8.7 -  Config::ConnectWithContext ("/NodeList/*/$MobilityModelNotifier/CourseChange",
     8.8 +  Config::Connect ("/NodeList/*/$MobilityModelNotifier/CourseChange",
     8.9                                MakeCallback (&CourseChange));
    8.10  
    8.11    Simulator::StopAt (Seconds (100.0));
     9.1 --- a/src/core/attribute-test.cc	Tue Mar 11 13:34:29 2008 -0700
     9.2 +++ b/src/core/attribute-test.cc	Tue Mar 11 13:46:22 2008 -0700
     9.3 @@ -459,25 +459,25 @@
     9.4  
     9.5    m_got1 = -2;
     9.6    NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", Integer (-1)));
     9.7 -  NS_TEST_ASSERT (p->TraceConnect ("Source1", MakeCallback (&AttributeTest::NotifySource1, this)));
     9.8 +  NS_TEST_ASSERT (p->TraceConnectWithoutContext ("Source1", MakeCallback (&AttributeTest::NotifySource1, this)));
     9.9    NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", Integer (0)));
    9.10    NS_TEST_ASSERT_EQUAL (m_got1, 0);
    9.11 -  NS_TEST_ASSERT (p->TraceDisconnect ("Source1", MakeCallback (&AttributeTest::NotifySource1, this)));
    9.12 +  NS_TEST_ASSERT (p->TraceDisconnectWithoutContext ("Source1", MakeCallback (&AttributeTest::NotifySource1, this)));
    9.13    NS_TEST_ASSERT (p->SetAttributeFailSafe ("IntegerTraceSource1", Integer (1)));
    9.14    NS_TEST_ASSERT_EQUAL (m_got1, 0);
    9.15  
    9.16    m_got2 = 4.3;
    9.17    p->InvokeCb (1.0, -5, 0.0);
    9.18    NS_TEST_ASSERT_EQUAL (m_got2, 4.3);
    9.19 -  NS_TEST_ASSERT (p->TraceConnect ("Source2", MakeCallback (&AttributeTest::NotifySource2, this)));
    9.20 +  NS_TEST_ASSERT (p->TraceConnectWithoutContext ("Source2", MakeCallback (&AttributeTest::NotifySource2, this)));
    9.21    NS_TEST_ASSERT_EQUAL (m_got2, 4.3);
    9.22    p->InvokeCb (1.0, -5, 0.0);
    9.23    NS_TEST_ASSERT_EQUAL (m_got2, 1.0);
    9.24 -  NS_TEST_ASSERT (p->TraceDisconnect ("Source2", MakeCallback (&AttributeTest::NotifySource2, this)));
    9.25 +  NS_TEST_ASSERT (p->TraceDisconnectWithoutContext ("Source2", MakeCallback (&AttributeTest::NotifySource2, this)));
    9.26    p->InvokeCb (-1.0, -5, 0.0);
    9.27    NS_TEST_ASSERT_EQUAL (m_got2, 1.0);
    9.28  
    9.29 -  NS_TEST_ASSERT (p->TraceConnect ("ValueSource", MakeCallback (&AttributeTest::NotifySourceValue, this)));
    9.30 +  NS_TEST_ASSERT (p->TraceConnectWithoutContext ("ValueSource", MakeCallback (&AttributeTest::NotifySourceValue, this)));
    9.31    
    9.32  
    9.33  
    10.1 --- a/src/core/config.cc	Tue Mar 11 13:34:29 2008 -0700
    10.2 +++ b/src/core/config.cc	Tue Mar 11 13:46:22 2008 -0700
    10.3 @@ -285,10 +285,10 @@
    10.4  {
    10.5  public:
    10.6    void Set (std::string path, Attribute value);
    10.7 +  void ConnectWithoutContext (std::string path, const CallbackBase &cb);
    10.8    void Connect (std::string path, const CallbackBase &cb);
    10.9 -  void ConnectWithContext (std::string path, const CallbackBase &cb);
   10.10 +  void DisconnectWithoutContext (std::string path, const CallbackBase &cb);
   10.11    void Disconnect (std::string path, const CallbackBase &cb);
   10.12 -  void DisconnectWithContext (std::string path, const CallbackBase &cb);
   10.13  
   10.14    void RegisterRootNamespaceObject (Ptr<Object> obj);
   10.15    void UnregisterRootNamespaceObject (Ptr<Object> obj);
   10.16 @@ -319,7 +319,7 @@
   10.17      }
   10.18  }
   10.19  void 
   10.20 -ConfigImpl::Connect (std::string path, const CallbackBase &cb)
   10.21 +ConfigImpl::ConnectWithoutContext (std::string path, const CallbackBase &cb)
   10.22  {
   10.23    class ConnectResolver : public Resolver 
   10.24    {
   10.25 @@ -329,7 +329,7 @@
   10.26  	m_cb (cb) {}
   10.27    private:
   10.28      virtual void DoOne (Ptr<Object> object, std::string path, std::string name) {
   10.29 -      object->TraceConnect (name, m_cb);
   10.30 +      object->TraceConnectWithoutContext (name, m_cb);
   10.31      }
   10.32      CallbackBase m_cb;
   10.33    } resolver = ConnectResolver (path, cb);
   10.34 @@ -339,7 +339,7 @@
   10.35      }
   10.36  }
   10.37  void 
   10.38 -ConfigImpl::Disconnect (std::string path, const CallbackBase &cb)
   10.39 +ConfigImpl::DisconnectWithoutContext (std::string path, const CallbackBase &cb)
   10.40  {
   10.41    class DisconnectResolver : public Resolver 
   10.42    {
   10.43 @@ -349,7 +349,7 @@
   10.44  	m_cb (cb) {}
   10.45    private:
   10.46      virtual void DoOne (Ptr<Object> object, std::string path, std::string name) {
   10.47 -      object->TraceDisconnect (name, m_cb);
   10.48 +      object->TraceDisconnectWithoutContext (name, m_cb);
   10.49      }
   10.50      CallbackBase m_cb;
   10.51    } resolver = DisconnectResolver (path, cb);
   10.52 @@ -359,7 +359,7 @@
   10.53      }
   10.54  }
   10.55  void 
   10.56 -ConfigImpl::ConnectWithContext (std::string path, const CallbackBase &cb)
   10.57 +ConfigImpl::Connect (std::string path, const CallbackBase &cb)
   10.58  {
   10.59    class ConnectWithContextResolver : public Resolver 
   10.60    {
   10.61 @@ -369,7 +369,7 @@
   10.62  	m_cb (cb) {}
   10.63    private:
   10.64      virtual void DoOne (Ptr<Object> object, std::string path, std::string name) {
   10.65 -      object->TraceConnectWithContext (name, path, m_cb);
   10.66 +      object->TraceConnectWithoutContext (name, path, m_cb);
   10.67      }
   10.68      CallbackBase m_cb;
   10.69    } resolver = ConnectWithContextResolver (path, cb);
   10.70 @@ -379,7 +379,7 @@
   10.71      }
   10.72  }
   10.73  void 
   10.74 -ConfigImpl::DisconnectWithContext (std::string path, const CallbackBase &cb)
   10.75 +ConfigImpl::Disconnect (std::string path, const CallbackBase &cb)
   10.76  {
   10.77    class DisconnectWithContextResolver : public Resolver 
   10.78    {
   10.79 @@ -389,7 +389,7 @@
   10.80  	m_cb (cb) {}
   10.81    private:
   10.82      virtual void DoOne (Ptr<Object> object, std::string path, std::string name) {
   10.83 -      object->TraceDisconnectWithContext (name, path, m_cb);
   10.84 +      object->TraceDisconnectWithoutContext (name, path, m_cb);
   10.85      }
   10.86      CallbackBase m_cb;
   10.87    } resolver = DisconnectWithContextResolver (path, cb);
   10.88 @@ -440,24 +440,24 @@
   10.89  {
   10.90    return GlobalValue::BindFailSafe (name, value);
   10.91  }
   10.92 -void Connect (std::string path, const CallbackBase &cb)
   10.93 +void ConnectWithoutContext (std::string path, const CallbackBase &cb)
   10.94 +{
   10.95 +  Singleton<ConfigImpl>::Get ()->ConnectWithoutContext (path, cb);
   10.96 +}
   10.97 +void DisconnectWithoutContext (std::string path, const CallbackBase &cb)
   10.98 +{
   10.99 +  Singleton<ConfigImpl>::Get ()->DisconnectWithoutContext (path, cb);
  10.100 +}
  10.101 +void 
  10.102 +Connect (std::string path, const CallbackBase &cb)
  10.103  {
  10.104    Singleton<ConfigImpl>::Get ()->Connect (path, cb);
  10.105  }
  10.106 -void Disconnect (std::string path, const CallbackBase &cb)
  10.107 +void 
  10.108 +Disconnect (std::string path, const CallbackBase &cb)
  10.109  {
  10.110    Singleton<ConfigImpl>::Get ()->Disconnect (path, cb);
  10.111  }
  10.112 -void 
  10.113 -ConnectWithContext (std::string path, const CallbackBase &cb)
  10.114 -{
  10.115 -  Singleton<ConfigImpl>::Get ()->ConnectWithContext (path, cb);
  10.116 -}
  10.117 -void 
  10.118 -DisconnectWithContext (std::string path, const CallbackBase &cb)
  10.119 -{
  10.120 -  Singleton<ConfigImpl>::Get ()->DisconnectWithContext (path, cb);
  10.121 -}
  10.122  
  10.123  void RegisterRootNamespaceObject (Ptr<Object> obj)
  10.124  {
  10.125 @@ -710,7 +710,7 @@
  10.126    NS_TEST_ASSERT_EQUAL (v.Get (), -16);
  10.127  
  10.128  
  10.129 -  Config::Connect ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.130 +  Config::ConnectWithoutContext ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.131  		   MakeCallback (&ConfigTest::ChangeNotification, this));
  10.132    m_traceNotification = 0;
  10.133    // this should trigger no notification
  10.134 @@ -720,7 +720,7 @@
  10.135    // this should trigger a notification
  10.136    d1->SetAttribute ("Source", Integer (-3));
  10.137    NS_TEST_ASSERT_EQUAL (m_traceNotification, -3);
  10.138 -  Config::Disconnect ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.139 +  Config::DisconnectWithoutContext ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.140  		      MakeCallback (&ConfigTest::ChangeNotification, this));
  10.141    m_traceNotification = 0;
  10.142    // this should _not_ trigger a notification
  10.143 @@ -728,7 +728,7 @@
  10.144    NS_TEST_ASSERT_EQUAL (m_traceNotification, 0);
  10.145  
  10.146    
  10.147 -  Config::ConnectWithContext ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.148 +  Config::Connect ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.149  			      MakeCallback (&ConfigTest::ChangeNotificationWithPath, this));
  10.150    m_traceNotification = 0;
  10.151    // this should trigger no notification
  10.152 @@ -746,7 +746,7 @@
  10.153    d3->SetAttribute ("Source", Integer (-3));
  10.154    NS_TEST_ASSERT_EQUAL (m_traceNotification, -3);
  10.155    NS_TEST_ASSERT_EQUAL (m_tracePath, "/NodeA/NodeB/NodesB/3/Source");
  10.156 -  Config::DisconnectWithContext ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.157 +  Config::Disconnect ("/NodeA/NodeB/NodesB/[0-1]|3/Source", 
  10.158  				 MakeCallback (&ConfigTest::ChangeNotificationWithPath, this));
  10.159    m_traceNotification = 0;
  10.160    // this should _not_ trigger a notification
    11.1 --- a/src/core/config.h	Tue Mar 11 13:34:29 2008 -0700
    11.2 +++ b/src/core/config.h	Tue Mar 11 13:46:22 2008 -0700
    11.3 @@ -78,14 +78,14 @@
    11.4   * match the input path and will then connect the input callback
    11.5   * to them.
    11.6   */
    11.7 -void Connect (std::string path, const CallbackBase &cb);
    11.8 +void ConnectWithoutContext (std::string path, const CallbackBase &cb);
    11.9  /**
   11.10   * \param path a path to match trace sources.
   11.11   * \param cb the callback to disconnect to the matching trace sources.
   11.12   *
   11.13   * This function undoes the work of Config::Connect.
   11.14   */
   11.15 -void Disconnect (std::string path, const CallbackBase &cb);
   11.16 +void DisconnectWithoutContext (std::string path, const CallbackBase &cb);
   11.17  /**
   11.18   * \param path a path to match trace sources.
   11.19   * \param cb the callback to connect to the matching trace sources.
   11.20 @@ -95,14 +95,14 @@
   11.21   * to them in such a way that the callback will receive an extra
   11.22   * context string upon trace event notification.
   11.23   */
   11.24 -void ConnectWithContext (std::string path, const CallbackBase &cb);
   11.25 +void Connect (std::string path, const CallbackBase &cb);
   11.26  /**
   11.27   * \param path a path to match trace sources.
   11.28   * \param cb the callback to connect to the matching trace sources.
   11.29   *
   11.30   * This function undoes the work of Config::ConnectWithContext.
   11.31   */
   11.32 -void DisconnectWithContext (std::string path, const CallbackBase &cb);
   11.33 +void Disconnect (std::string path, const CallbackBase &cb);
   11.34  
   11.35  /**
   11.36   * \param obj a new root object
    12.1 --- a/src/core/object.cc	Tue Mar 11 13:34:29 2008 -0700
    12.2 +++ b/src/core/object.cc	Tue Mar 11 13:46:22 2008 -0700
    12.3 @@ -1127,47 +1127,47 @@
    12.4  }
    12.5  
    12.6  bool 
    12.7 -Object::TraceConnect (std::string name, const CallbackBase &cb)
    12.8 +Object::TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
    12.9  {
   12.10    Ptr<const TraceSourceAccessor> accessor = m_tid.LookupTraceSourceByName (name);
   12.11    if (accessor == 0)
   12.12      {
   12.13        return false;
   12.14      }
   12.15 -  bool ok = accessor->Connect (this, cb);
   12.16 +  bool ok = accessor->ConnectWithoutContext (this, cb);
   12.17    return ok;
   12.18  }
   12.19  bool 
   12.20 -Object::TraceConnectWithContext (std::string name, std::string context, const CallbackBase &cb)
   12.21 +Object::TraceConnectWithoutContext (std::string name, std::string context, const CallbackBase &cb)
   12.22  {
   12.23    Ptr<const TraceSourceAccessor> accessor = m_tid.LookupTraceSourceByName (name);
   12.24    if (accessor == 0)
   12.25      {
   12.26        return false;
   12.27      }
   12.28 -  bool ok = accessor->ConnectWithContext (this, context, cb);
   12.29 +  bool ok = accessor->Connect (this, context, cb);
   12.30    return ok;
   12.31  }
   12.32  bool 
   12.33 -Object::TraceDisconnect (std::string name, const CallbackBase &cb)
   12.34 +Object::TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
   12.35  {
   12.36    Ptr<const TraceSourceAccessor> accessor = m_tid.LookupTraceSourceByName (name);
   12.37    if (accessor == 0)
   12.38      {
   12.39        return false;
   12.40      }
   12.41 -  bool ok = accessor->Disconnect (this, cb);
   12.42 +  bool ok = accessor->DisconnectWithoutContext (this, cb);
   12.43    return ok;
   12.44  }
   12.45  bool 
   12.46 -Object::TraceDisconnectWithContext (std::string name, std::string context, const CallbackBase &cb)
   12.47 +Object::TraceDisconnectWithoutContext (std::string name, std::string context, const CallbackBase &cb)
   12.48  {
   12.49    Ptr<const TraceSourceAccessor> accessor = m_tid.LookupTraceSourceByName (name);
   12.50    if (accessor == 0)
   12.51      {
   12.52        return false;
   12.53      }
   12.54 -  bool ok = accessor->DisconnectWithContext (this, context, cb);
   12.55 +  bool ok = accessor->Disconnect (this, context, cb);
   12.56    return ok;
   12.57  }
   12.58  
    13.1 --- a/src/core/object.h	Tue Mar 11 13:34:29 2008 -0700
    13.2 +++ b/src/core/object.h	Tue Mar 11 13:46:22 2008 -0700
    13.3 @@ -445,10 +445,10 @@
    13.4     */
    13.5    Attribute GetAttribute (std::string name) const;
    13.6  
    13.7 -  bool TraceConnect (std::string name, const CallbackBase &cb);
    13.8 -  bool TraceConnectWithContext (std::string name, std::string context, const CallbackBase &cb);
    13.9 -  bool TraceDisconnect (std::string name, const CallbackBase &cb);
   13.10 -  bool TraceDisconnectWithContext (std::string name, std::string context, const CallbackBase &cb);
   13.11 +  bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb);
   13.12 +  bool TraceConnectWithoutContext (std::string name, std::string context, const CallbackBase &cb);
   13.13 +  bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb);
   13.14 +  bool TraceDisconnectWithoutContext (std::string name, std::string context, const CallbackBase &cb);
   13.15  
   13.16    TypeId GetRealTypeId (void) const;
   13.17  
    14.1 --- a/src/core/trace-source-accessor.h	Tue Mar 11 13:34:29 2008 -0700
    14.2 +++ b/src/core/trace-source-accessor.h	Tue Mar 11 13:46:22 2008 -0700
    14.3 @@ -44,24 +44,24 @@
    14.4     * \param obj the object instance which contains the target trace source.
    14.5     * \param cb the callback to connect to the target trace source.
    14.6     */
    14.7 -  virtual bool Connect (ObjectBase *obj, const CallbackBase &cb) const = 0;
    14.8 +  virtual bool ConnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const = 0;
    14.9    /**
   14.10     * \param obj the object instance which contains the target trace source.
   14.11     * \param context the context to bind to the user callback.
   14.12     * \param cb the callback to connect to the target trace source.
   14.13     */
   14.14 -  virtual bool ConnectWithContext (ObjectBase *obj, std::string context, const CallbackBase &cb) const = 0;
   14.15 +  virtual bool Connect (ObjectBase *obj, std::string context, const CallbackBase &cb) const = 0;
   14.16    /**
   14.17     * \param obj the object instance which contains the target trace source.
   14.18     * \param cb the callback to disconnect from the target trace source.
   14.19     */
   14.20 -  virtual bool Disconnect (ObjectBase *obj, const CallbackBase &cb) const = 0;
   14.21 +  virtual bool DisconnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const = 0;
   14.22    /**
   14.23     * \param obj the object instance which contains the target trace source.
   14.24     * \param context the context which was bound to the user callback.
   14.25     * \param cb the callback to disconnect from the target trace source.
   14.26     */
   14.27 -  virtual bool DisconnectWithContext (ObjectBase *obj, std::string context, const CallbackBase &cb) const = 0;
   14.28 +  virtual bool Disconnect (ObjectBase *obj, std::string context, const CallbackBase &cb) const = 0;
   14.29  private:
   14.30    mutable uint32_t m_count;
   14.31  };
   14.32 @@ -85,40 +85,40 @@
   14.33  {
   14.34    struct Accessor : public TraceSourceAccessor
   14.35    {
   14.36 -    virtual bool Connect (ObjectBase *obj, const CallbackBase &cb) const {
   14.37 +    virtual bool ConnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const {
   14.38        T *p = dynamic_cast<T*> (obj);
   14.39        if (p == 0)
   14.40  	{
   14.41  	  return false;
   14.42  	}
   14.43 -      (p->*m_source).Connect (cb);
   14.44 +      (p->*m_source).ConnectWithoutContext (cb);
   14.45        return true;
   14.46      }
   14.47 -    virtual bool ConnectWithContext (ObjectBase *obj, std::string context, const CallbackBase &cb) const {
   14.48 +    virtual bool Connect (ObjectBase *obj, std::string context, const CallbackBase &cb) const {
   14.49        T *p = dynamic_cast<T*> (obj);
   14.50        if (p == 0)
   14.51  	{
   14.52  	  return false;
   14.53  	}
   14.54 -      (p->*m_source).ConnectWithContext (cb, context);
   14.55 +      (p->*m_source).Connect (cb, context);
   14.56        return true;
   14.57      }
   14.58 -    virtual bool Disconnect (ObjectBase *obj, const CallbackBase &cb) const {
   14.59 +    virtual bool DisconnectWithoutContext (ObjectBase *obj, const CallbackBase &cb) const {
   14.60        T *p = dynamic_cast<T*> (obj);
   14.61        if (p == 0)
   14.62  	{
   14.63  	  return false;
   14.64  	}
   14.65 -      (p->*m_source).Disconnect (cb);
   14.66 +      (p->*m_source).DisconnectWithoutContext (cb);
   14.67        return true;      
   14.68      }
   14.69 -    virtual bool DisconnectWithContext (ObjectBase *obj, std::string context, const CallbackBase &cb) const {
   14.70 +    virtual bool Disconnect (ObjectBase *obj, std::string context, const CallbackBase &cb) const {
   14.71        T *p = dynamic_cast<T*> (obj);
   14.72        if (p == 0)
   14.73  	{
   14.74  	  return false;
   14.75  	}
   14.76 -      (p->*m_source).DisconnectWithContext (cb, context);
   14.77 +      (p->*m_source).Disconnect (cb, context);
   14.78        return true;      
   14.79      }
   14.80      SOURCE T::*m_source;
    15.1 --- a/src/core/traced-callback.cc	Tue Mar 11 13:34:29 2008 -0700
    15.2 +++ b/src/core/traced-callback.cc	Tue Mar 11 13:46:22 2008 -0700
    15.3 @@ -61,29 +61,29 @@
    15.4    bool result = true;
    15.5  
    15.6    TracedCallback<uint8_t,double> trace;
    15.7 -  trace.Connect (MakeCallback (&TracedCallbackTest::CbOne, this));
    15.8 -  trace.Connect (MakeCallback (&TracedCallbackTest::CbTwo, this));
    15.9 +  trace.ConnectWithoutContext (MakeCallback (&TracedCallbackTest::CbOne, this));
   15.10 +  trace.ConnectWithoutContext (MakeCallback (&TracedCallbackTest::CbTwo, this));
   15.11    m_one = false;
   15.12    m_two = false;
   15.13    trace (1, 2);
   15.14    NS_TEST_ASSERT (m_one);
   15.15    NS_TEST_ASSERT (m_two);
   15.16  
   15.17 -  trace.Disconnect (MakeCallback (&TracedCallbackTest::CbOne, this));
   15.18 +  trace.DisconnectWithoutContext (MakeCallback (&TracedCallbackTest::CbOne, this));
   15.19    m_one = false;
   15.20    m_two = false;
   15.21    trace (1, 2);
   15.22    NS_TEST_ASSERT (!m_one);
   15.23    NS_TEST_ASSERT (m_two);
   15.24 -  trace.Disconnect (MakeCallback (&TracedCallbackTest::CbTwo, this));
   15.25 +  trace.DisconnectWithoutContext (MakeCallback (&TracedCallbackTest::CbTwo, this));
   15.26    m_one = false;
   15.27    m_two = false;
   15.28    trace (1, 2);
   15.29    NS_TEST_ASSERT (!m_one);
   15.30    NS_TEST_ASSERT (!m_two);
   15.31  
   15.32 -  trace.Connect (MakeCallback (&TracedCallbackTest::CbOne, this));
   15.33 -  trace.Connect (MakeCallback (&TracedCallbackTest::CbTwo, this));
   15.34 +  trace.ConnectWithoutContext (MakeCallback (&TracedCallbackTest::CbOne, this));
   15.35 +  trace.ConnectWithoutContext (MakeCallback (&TracedCallbackTest::CbTwo, this));
   15.36    m_one = false;
   15.37    m_two = false;
   15.38    trace (1, 2);
    16.1 --- a/src/core/traced-callback.h	Tue Mar 11 13:34:29 2008 -0700
    16.2 +++ b/src/core/traced-callback.h	Tue Mar 11 13:46:22 2008 -0700
    16.3 @@ -40,10 +40,10 @@
    16.4  {
    16.5  public:
    16.6    TracedCallback ();
    16.7 -  void Connect (const CallbackBase & callback);
    16.8 -  void ConnectWithContext (const CallbackBase & callback, std::string path);
    16.9 -  void Disconnect (const CallbackBase & callback);
   16.10 -  void DisconnectWithContext (const CallbackBase & callback, std::string path);
   16.11 +  void ConnectWithoutContext (const CallbackBase & callback);
   16.12 +  void Connect (const CallbackBase & callback, std::string path);
   16.13 +  void DisconnectWithoutContext (const CallbackBase & callback);
   16.14 +  void Disconnect (const CallbackBase & callback, std::string path);
   16.15    void operator() (void) const;
   16.16    void operator() (T1 a1) const;
   16.17    void operator() (T1 a1, T2 a2) const;
   16.18 @@ -69,7 +69,7 @@
   16.19  template<typename T1, typename T2, 
   16.20           typename T3, typename T4>
   16.21  void 
   16.22 -TracedCallback<T1,T2,T3,T4>::Connect (const CallbackBase & callback)
   16.23 +TracedCallback<T1,T2,T3,T4>::ConnectWithoutContext (const CallbackBase & callback)
   16.24  {
   16.25    Callback<void,T1,T2,T3,T4> cb;
   16.26    cb.Assign (callback);
   16.27 @@ -78,7 +78,7 @@
   16.28  template<typename T1, typename T2, 
   16.29           typename T3, typename T4>
   16.30  void 
   16.31 -TracedCallback<T1,T2,T3,T4>::ConnectWithContext (const CallbackBase & callback, std::string path)
   16.32 +TracedCallback<T1,T2,T3,T4>::Connect (const CallbackBase & callback, std::string path)
   16.33  {
   16.34    Callback<void,std::string,T1,T2,T3,T4> cb;
   16.35    cb.Assign (callback);
   16.36 @@ -88,7 +88,7 @@
   16.37  template<typename T1, typename T2, 
   16.38           typename T3, typename T4>
   16.39  void 
   16.40 -TracedCallback<T1,T2,T3,T4>::Disconnect (const CallbackBase & callback)
   16.41 +TracedCallback<T1,T2,T3,T4>::DisconnectWithoutContext (const CallbackBase & callback)
   16.42  {
   16.43    for (typename CallbackList::iterator i = m_callbackList.begin ();
   16.44         i != m_callbackList.end (); /* empty */)
   16.45 @@ -106,12 +106,12 @@
   16.46  template<typename T1, typename T2, 
   16.47           typename T3, typename T4>
   16.48  void 
   16.49 -TracedCallback<T1,T2,T3,T4>::DisconnectWithContext (const CallbackBase & callback, std::string path)
   16.50 +TracedCallback<T1,T2,T3,T4>::Disconnect (const CallbackBase & callback, std::string path)
   16.51  {
   16.52    Callback<void,std::string,T1,T2,T3,T4> cb;
   16.53    cb.Assign (callback);
   16.54    Callback<void,T1,T2,T3,T4> realCb = cb.Bind (path);
   16.55 -  Disconnect (realCb);
   16.56 +  DisconnectWithoutContext (realCb);
   16.57  }
   16.58  template<typename T1, typename T2, 
   16.59           typename T3, typename T4>
    17.1 --- a/src/core/traced-value.h	Tue Mar 11 13:34:29 2008 -0700
    17.2 +++ b/src/core/traced-value.h	Tue Mar 11 13:46:22 2008 -0700
    17.3 @@ -20,7 +20,7 @@
    17.4   * support operator !=), you can wrap them in an instance of
    17.5   * this template: this instance will behave just like
    17.6   * the original class (if it did not export any special method),
    17.7 - * and will define Connect/Disconnect methods to work
    17.8 + * and will define Connect/DisconnectWithoutContext methods to work
    17.9   * with an ns3::TraceSourceAccessor.
   17.10   */
   17.11  template <typename T>
   17.12 @@ -61,17 +61,17 @@
   17.13    operator Enum () const {
   17.14      return Enum (m_v);
   17.15    }
   17.16 -  void Connect (const CallbackBase &cb) {
   17.17 -    m_cb.Connect (cb);
   17.18 +  void ConnectWithoutContext (const CallbackBase &cb) {
   17.19 +    m_cb.ConnectWithoutContext (cb);
   17.20    }
   17.21 -  void ConnectWithContext (const CallbackBase &cb, std::string path) {
   17.22 -    m_cb.ConnectWithContext (cb, path);
   17.23 +  void Connect (const CallbackBase &cb, std::string path) {
   17.24 +    m_cb.Connect (cb, path);
   17.25    }
   17.26 -  void Disconnect (const CallbackBase &cb) {
   17.27 -    m_cb.Disconnect (cb);
   17.28 +  void DisconnectWithoutContext (const CallbackBase &cb) {
   17.29 +    m_cb.DisconnectWithoutContext (cb);
   17.30    }
   17.31 -  void DisconnectWithContext (const CallbackBase &cb, std::string path) {
   17.32 -    m_cb.DisconnectWithContext (cb, path);
   17.33 +  void Disconnect (const CallbackBase &cb, std::string path) {
   17.34 +    m_cb.Disconnect (cb, path);
   17.35    }
   17.36    void Set (const T &v) {
   17.37      if (m_v != v)
    18.1 --- a/src/devices/wifi/wifi-trace.cc	Tue Mar 11 13:34:29 2008 -0700
    18.2 +++ b/src/devices/wifi/wifi-trace.cc	Tue Mar 11 13:46:22 2008 -0700
    18.3 @@ -47,7 +47,7 @@
    18.4  WifiTrace::TraceAllNetDeviceRx (void)
    18.5  {
    18.6    Packet::EnableMetadata ();
    18.7 -  NodeList::Connect ("/nodes/*/devices/*/rx",
    18.8 +  NodeList::ConnectWithoutContext ("/nodes/*/devices/*/rx",
    18.9                       MakeCallback (&WifiTrace::LogDevRx, this));
   18.10  }
   18.11  
   18.12 @@ -55,7 +55,7 @@
   18.13  WifiTrace::TraceAllNetDeviceTx (void)
   18.14  {
   18.15    Packet::EnableMetadata ();
   18.16 -  NodeList::Connect ("/nodes/*/devices/*/tx",
   18.17 +  NodeList::ConnectWithoutContext ("/nodes/*/devices/*/tx",
   18.18                       MakeCallback (&WifiTrace::LogDevTx, this));
   18.19  }
   18.20  
   18.21 @@ -63,7 +63,7 @@
   18.22  WifiTrace::TraceAllPhy (void)
   18.23  {
   18.24    Packet::EnableMetadata ();
   18.25 -  NodeList::Connect ("/nodes/*/devices/*/*/state",
   18.26 +  NodeList::ConnectWithoutContext ("/nodes/*/devices/*/*/state",
   18.27                       MakeCallback (&WifiTrace::LogPhy, this));
   18.28  }
   18.29  
   18.30 @@ -71,7 +71,7 @@
   18.31  WifiTrace::TraceAllErrors (void)
   18.32  {
   18.33    Packet::EnableMetadata ();
   18.34 -  NodeList::Connect ("/nodes/*/devices/*/*/error",
   18.35 +  NodeList::ConnectWithoutContext ("/nodes/*/devices/*/*/error",
   18.36                       MakeCallback (&WifiTrace::LogErrors, this));
   18.37  }
   18.38  
   18.39 @@ -79,7 +79,7 @@
   18.40  WifiTrace::TraceAckTimeouts (void)
   18.41  {
   18.42    Packet::EnableMetadata ();
   18.43 -  NodeList::Connect ("/nodes/*/devices/*/*/ackTimeout",
   18.44 +  NodeList::ConnectWithoutContext ("/nodes/*/devices/*/*/ackTimeout",
   18.45                       MakeCallback (&WifiTrace::LogAckTimeout, this));
   18.46  }
   18.47  
   18.48 @@ -87,7 +87,7 @@
   18.49  WifiTrace::TraceCtsTimeouts (void)
   18.50  {
   18.51    Packet::EnableMetadata ();
   18.52 -  NodeList::Connect ("/nodes/*/devices/*/*/ctsTimeout",
   18.53 +  NodeList::ConnectWithoutContext ("/nodes/*/devices/*/*/ctsTimeout",
   18.54                       MakeCallback (&WifiTrace::LogCtsTimeout, this));
   18.55  }
   18.56  
    19.1 --- a/src/internet-node/ascii-trace.cc	Tue Mar 11 13:34:29 2008 -0700
    19.2 +++ b/src/internet-node/ascii-trace.cc	Tue Mar 11 13:46:22 2008 -0700
    19.3 @@ -40,18 +40,18 @@
    19.4  AsciiTrace::TraceAllQueues (void)
    19.5  {
    19.6    Packet::EnableMetadata ();
    19.7 -  Config::ConnectWithContext ("/NodeList/*/DeviceList/*/TxQueue/Enqueue",
    19.8 +  Config::Connect ("/NodeList/*/DeviceList/*/TxQueue/Enqueue",
    19.9                                MakeCallback (&AsciiTrace::LogDevQueueEnqueue, this));
   19.10 -  Config::ConnectWithContext ("/NodeList/*/DeviceList/*/TxQueue/Dequeue",
   19.11 +  Config::Connect ("/NodeList/*/DeviceList/*/TxQueue/Dequeue",
   19.12                                MakeCallback (&AsciiTrace::LogDevQueueDequeue, this));
   19.13 -  Config::ConnectWithContext ("/NodeList/*/DeviceList/*/TxQueue/Drop",
   19.14 +  Config::Connect ("/NodeList/*/DeviceList/*/TxQueue/Drop",
   19.15                                MakeCallback (&AsciiTrace::LogDevQueueDrop, this));
   19.16  }
   19.17  void
   19.18  AsciiTrace::TraceAllNetDeviceRx (void)
   19.19  {
   19.20    Packet::EnableMetadata ();
   19.21 -  Config::ConnectWithContext ("/NodeList/*/DeviceList/*/Rx",
   19.22 +  Config::Connect ("/NodeList/*/DeviceList/*/Rx",
   19.23                                MakeCallback (&AsciiTrace::LogDevRx, this));
   19.24  }
   19.25  
    20.1 --- a/src/internet-node/pcap-trace.cc	Tue Mar 11 13:34:29 2008 -0700
    20.2 +++ b/src/internet-node/pcap-trace.cc	Tue Mar 11 13:46:22 2008 -0700
    20.3 @@ -52,9 +52,9 @@
    20.4  void 
    20.5  PcapTrace::TraceAllIp (void)
    20.6  {
    20.7 -  Config::ConnectWithContext ("/NodeList/*/$Ipv4L3Protocol/Tx",
    20.8 +  Config::Connect ("/NodeList/*/$Ipv4L3Protocol/Tx",
    20.9                                MakeCallback (&PcapTrace::LogTxIp, this));
   20.10 -  Config::ConnectWithContext ("/NodeList/*/$Ipv4L3Protocol/Rx",
   20.11 +  Config::Connect ("/NodeList/*/$Ipv4L3Protocol/Rx",
   20.12                                MakeCallback (&PcapTrace::LogRxIp, this));
   20.13  }
   20.14  
    21.1 --- a/src/mobility/hierarchical-mobility-model.cc	Tue Mar 11 13:34:29 2008 -0700
    21.2 +++ b/src/mobility/hierarchical-mobility-model.cc	Tue Mar 11 13:46:22 2008 -0700
    21.3 @@ -58,7 +58,7 @@
    21.4        notifier = CreateObject<MobilityModelNotifier> ();
    21.5        m_child->AggregateObject (notifier);
    21.6      }
    21.7 -  notifier->TraceConnect ("CourseChange", MakeCallback (&HierarchicalMobilityModel::ChildChanged, this));
    21.8 +  notifier->TraceConnectWithoutContext ("CourseChange", MakeCallback (&HierarchicalMobilityModel::ChildChanged, this));
    21.9  }
   21.10  
   21.11  void 
   21.12 @@ -72,7 +72,7 @@
   21.13        notifier = CreateObject<MobilityModelNotifier> ();
   21.14        m_parent->AggregateObject (notifier);
   21.15      }
   21.16 -  notifier->TraceConnect ("CourseChange", MakeCallback (&HierarchicalMobilityModel::ParentChanged, this));
   21.17 +  notifier->TraceConnectWithoutContext ("CourseChange", MakeCallback (&HierarchicalMobilityModel::ParentChanged, this));
   21.18  }
   21.19  
   21.20