get rid of CreateObjectWith
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 11 Mar 2008 13:30:12 -0700
changeset 25923ebf97150166
parent 2591 83a605082fb6
child 2593 5f22033d1408
get rid of CreateObjectWith
examples/csma-broadcast.cc
examples/csma-multicast.cc
examples/csma-one-subnet.cc
examples/csma-packet-socket.cc
examples/mixed-global-routing.cc
examples/simple-alternate-routing.cc
examples/simple-error-model.cc
examples/simple-global-routing.cc
examples/simple-point-to-point-olsr.cc
examples/simple-point-to-point.cc
examples/tcp-large-transfer-errors.cc
examples/tcp-large-transfer.cc
examples/tcp-small-transfer-oneloss.cc
examples/tcp-small-transfer.cc
examples/udp-echo.cc
samples/main-adhoc-wifi.cc
samples/main-ap-wifi.cc
samples/main-propagation-loss.cc
src/core/attribute-test.cc
src/core/object.h
src/devices/csma/csma-channel.cc
src/devices/csma/csma-channel.h
src/devices/csma/csma-ipv4-topology.cc
src/devices/csma/csma-topology.cc
src/devices/point-to-point/point-to-point-channel.cc
src/devices/point-to-point/point-to-point-channel.h
src/devices/point-to-point/point-to-point-topology.cc
src/devices/wifi/adhoc-wifi-mac.cc
src/devices/wifi/dca-txop.cc
src/devices/wifi/propagation-loss-model.cc
src/devices/wifi/wifi-helper.cc
src/internet-node/arp-ipv4-interface.cc
src/internet-node/arp-ipv4-interface.h
src/internet-node/arp-l3-protocol.cc
src/internet-node/arp-l3-protocol.h
src/internet-node/internet-node.cc
src/internet-node/ipv4-impl.cc
src/internet-node/ipv4-impl.h
src/internet-node/ipv4-interface.cc
src/internet-node/ipv4-interface.h
src/internet-node/ipv4-l3-protocol.cc
src/internet-node/ipv4-l3-protocol.h
src/internet-node/ipv4-l4-demux.cc
src/internet-node/ipv4-l4-demux.h
src/internet-node/ipv4-loopback-interface.cc
src/internet-node/ipv4-loopback-interface.h
src/internet-node/tcp-impl.cc
src/internet-node/tcp-impl.h
src/internet-node/tcp-l4-protocol.cc
src/internet-node/tcp-l4-protocol.h
src/internet-node/tcp-socket.cc
src/internet-node/tcp-socket.h
src/internet-node/udp-impl.cc
src/internet-node/udp-impl.h
src/internet-node/udp-l4-protocol.cc
src/internet-node/udp-l4-protocol.h
src/internet-node/udp-socket.cc
src/internet-node/udp-socket.h
src/mobility/mobility-helper.cc
src/node/packet-socket-factory.cc
src/node/packet-socket.cc
src/node/packet-socket.h
src/routing/olsr/olsr-agent-impl.cc
src/routing/olsr/routing-table.h
tutorial/point-to-point-ipv4-topology.cc
tutorial/tutorial-bus-network.cc
tutorial/tutorial-csma-echo-ascii-trace.cc
tutorial/tutorial-csma-echo-pcap-trace.cc
tutorial/tutorial-csma-echo.cc
tutorial/tutorial-linear-dumbbell.cc
tutorial/tutorial-point-to-point.cc
tutorial/tutorial-star-routing.cc
tutorial/tutorial-star.cc
utils/print-introspected-doxygen.cc
     1.1 --- a/examples/csma-broadcast.cc	Tue Mar 11 11:35:26 2008 -0700
     1.2 +++ b/examples/csma-broadcast.cc	Tue Mar 11 13:30:12 2008 -0700
     1.3 @@ -149,7 +149,7 @@
     1.4    // 512 bytes (default) at a rate of 500 Kb/s (default) from n0
     1.5    NS_LOG_INFO ("Create Applications.");
     1.6    Ptr<OnOffApplication> ooff = 
     1.7 -    CreateObjectWith<OnOffApplication> (
     1.8 +    CreateObject<OnOffApplication> (
     1.9                                          "Node", n0, 
    1.10                                          "Remote", Address (InetSocketAddress ("255.255.255.255", port)), 
    1.11                                          "Protocol", TypeId::LookupByName ("Udp"),
    1.12 @@ -162,7 +162,7 @@
    1.13    
    1.14    // Create an optional packet sink to receive these packets
    1.15    Ptr<PacketSink> sink = 
    1.16 -    CreateObjectWith<PacketSink> (
    1.17 +    CreateObject<PacketSink> (
    1.18                                    "Node", n1,
    1.19                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    1.20                                    "Protocol", TypeId::LookupByName ("Udp"));
    1.21 @@ -172,7 +172,7 @@
    1.22    sink->Stop (Seconds (10.0));
    1.23  
    1.24    // Create an optional packet sink to receive these packets
    1.25 -  sink = CreateObjectWith<PacketSink> (
    1.26 +  sink = CreateObject<PacketSink> (
    1.27                                         "Node", n2,
    1.28                                         "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    1.29                                         "Protocol", TypeId::LookupByName ("Udp"));
     2.1 --- a/examples/csma-multicast.cc	Tue Mar 11 11:35:26 2008 -0700
     2.2 +++ b/examples/csma-multicast.cc	Tue Mar 11 13:30:12 2008 -0700
     2.3 @@ -278,7 +278,7 @@
     2.4    // Configure a multicast packet generator that generates a packet
     2.5    // every few seconds
     2.6    Ptr<OnOffApplication> ooff = 
     2.7 -    CreateObjectWith<OnOffApplication> (
     2.8 +    CreateObject<OnOffApplication> (
     2.9                                          "Node", n0, 
    2.10                                          "Remote", Address (InetSocketAddress (multicastGroup, port)), 
    2.11                                          "Protocol", TypeId::LookupByName ("Udp"),
    2.12 @@ -297,7 +297,7 @@
    2.13    // If you enable logging on this (above) it will print a log statement
    2.14    // for every packet received
    2.15    Ptr<PacketSink> sink = 
    2.16 -    CreateObjectWith<PacketSink> (
    2.17 +    CreateObject<PacketSink> (
    2.18                                    "Node", n4,
    2.19                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    2.20                                    "Protocol", TypeId::LookupByName ("Udp"));
     3.1 --- a/examples/csma-one-subnet.cc	Tue Mar 11 11:35:26 2008 -0700
     3.2 +++ b/examples/csma-one-subnet.cc	Tue Mar 11 13:30:12 2008 -0700
     3.3 @@ -160,7 +160,7 @@
     3.4    NS_LOG_INFO ("Create Applications.");
     3.5    uint16_t port = 9;   // Discard port (RFC 863)
     3.6    Ptr<OnOffApplication> ooff = 
     3.7 -    CreateObjectWith<OnOffApplication> (
     3.8 +    CreateObject<OnOffApplication> (
     3.9                                          "Node", n0, 
    3.10                                          "Remote", Address (InetSocketAddress ("10.1.1.2", port)), 
    3.11                                          "Protocol", TypeId::LookupByName ("Udp"),
    3.12 @@ -176,7 +176,7 @@
    3.13  // 
    3.14  // Create a similar flow from n3 to n0, starting at time 1.1 seconds
    3.15  //
    3.16 -  ooff = CreateObjectWith<OnOffApplication> (
    3.17 +  ooff = CreateObject<OnOffApplication> (
    3.18                                               "Node", n3, 
    3.19                                               "Remote", Address (InetSocketAddress ("10.1.1.1", port)), 
    3.20                                               "Protocol", TypeId::LookupByName ("Udp"),
     4.1 --- a/examples/csma-packet-socket.cc	Tue Mar 11 11:35:26 2008 -0700
     4.2 +++ b/examples/csma-packet-socket.cc	Tue Mar 11 13:30:12 2008 -0700
     4.3 @@ -62,9 +62,9 @@
     4.4  static Ptr<CsmaNetDevice>
     4.5  CreateCsmaDevice (Ptr<Node> node, Ptr<CsmaChannel> channel)
     4.6  {
     4.7 -  Ptr<CsmaNetDevice> device = CreateObjectWith<CsmaNetDevice> ("Node", node, 
     4.8 -                                                               "Address", Mac48Address::Allocate (),
     4.9 -                                                               "EncapsulationMode", String ("Llc"));
    4.10 +  Ptr<CsmaNetDevice> device = CreateObject<CsmaNetDevice> ("Node", node, 
    4.11 +                                                           "Address", Mac48Address::Allocate (),
    4.12 +                                                           "EncapsulationMode", String ("Llc"));
    4.13    node->AddDevice (device);
    4.14    device->Attach (channel);
    4.15    Ptr<Queue> queue = CreateObject<DropTailQueue> ();
    4.16 @@ -114,7 +114,8 @@
    4.17  
    4.18    // create the shared medium used by all csma devices.
    4.19    NS_LOG_INFO ("Create channels.");
    4.20 -  Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> (DataRate(5000000), MilliSeconds(2));
    4.21 +  Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> ("BitRate", DataRate(5000000), 
    4.22 +                                                        "Delay", MilliSeconds(2));
    4.23  
    4.24    // use a helper function to connect our nodes to the shared channel.
    4.25    NS_LOG_INFO ("Build Topology.");
    4.26 @@ -140,7 +141,7 @@
    4.27    // from n0 to n1
    4.28    NS_LOG_INFO ("Create Applications.");
    4.29    Ptr<OnOffApplication> ooff = 
    4.30 -    CreateObjectWith<OnOffApplication> (
    4.31 +    CreateObject<OnOffApplication> (
    4.32                                          "Node", n0, 
    4.33                                          "Remote", Address (n0ToN1),
    4.34                                          "Protocol", TypeId::LookupByName ("Packet"),
    4.35 @@ -152,7 +153,7 @@
    4.36    ooff->Stop (Seconds(10.0));
    4.37  
    4.38    // Create a similar flow from n3 to n0, starting at time 1.1 seconds
    4.39 -  ooff = CreateObjectWith<OnOffApplication> (
    4.40 +  ooff = CreateObject<OnOffApplication> (
    4.41                                               "Node", n3, 
    4.42                                               "Remote", Address (n3ToN0),
    4.43                                               "Protocol", TypeId::LookupByName ("Packet"),
     5.1 --- a/examples/mixed-global-routing.cc	Tue Mar 11 11:35:26 2008 -0700
     5.2 +++ b/examples/mixed-global-routing.cc	Tue Mar 11 13:30:12 2008 -0700
     5.3 @@ -186,7 +186,7 @@
     5.4    NS_LOG_INFO ("Create Applications.");
     5.5    uint16_t port = 9;   // Discard port (RFC 863)
     5.6    Ptr<OnOffApplication> ooff = 
     5.7 -    CreateObjectWith<OnOffApplication> (
     5.8 +    CreateObject<OnOffApplication> (
     5.9                                          "Node", n0, 
    5.10                                          "Remote", Address (InetSocketAddress ("10.1.3.2", port)), 
    5.11                                          "Protocol", TypeId::LookupByName ("Udp"),
     6.1 --- a/examples/simple-alternate-routing.cc	Tue Mar 11 11:35:26 2008 -0700
     6.2 +++ b/examples/simple-alternate-routing.cc	Tue Mar 11 13:30:12 2008 -0700
     6.3 @@ -183,7 +183,7 @@
     6.4  
     6.5    // Create a flow from n3 to n1, starting at time 1.1 seconds
     6.6    Ptr<OnOffApplication> ooff = 
     6.7 -    CreateObjectWith<OnOffApplication> (
     6.8 +    CreateObject<OnOffApplication> (
     6.9                                          "Node", n3, 
    6.10                                          "Remote", Address (InetSocketAddress ("10.1.1.1", port)),
    6.11                                          "Protocol", TypeId::LookupByName ("Udp"),
    6.12 @@ -196,7 +196,7 @@
    6.13  
    6.14    // Create a packet sink to receive these packets
    6.15    Ptr<PacketSink> sink = 
    6.16 -    CreateObjectWith<PacketSink> (
    6.17 +    CreateObject<PacketSink> (
    6.18                                    "Node", n1, 
    6.19                                    "Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)), 
    6.20                                    "Protocol", TypeId::LookupByName ("Udp"));
     7.1 --- a/examples/simple-error-model.cc	Tue Mar 11 11:35:26 2008 -0700
     7.2 +++ b/examples/simple-error-model.cc	Tue Mar 11 13:30:12 2008 -0700
     7.3 @@ -143,7 +143,7 @@
     7.4    NS_LOG_INFO ("Create Applications.");
     7.5    uint16_t port = 9;   // Discard port (RFC 863)
     7.6    Ptr<OnOffApplication> ooff = 
     7.7 -    CreateObjectWith<OnOffApplication> (
     7.8 +    CreateObject<OnOffApplication> (
     7.9                                          "Node", n0, 
    7.10                                          "Remote", Address (InetSocketAddress ("10.1.3.2", port)), 
    7.11                                          "Protocol", TypeId::LookupByName ("Udp"),
    7.12 @@ -155,7 +155,7 @@
    7.13    ooff->Stop (Seconds(10.0));
    7.14  
    7.15    // Create an optional packet sink to receive these packets
    7.16 -  Ptr<PacketSink> sink = CreateObjectWith<PacketSink> (
    7.17 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
    7.18                                                         "Node", n3,
    7.19                                                         "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    7.20                                                         "Protocol", TypeId::LookupByName ("Udp"));
    7.21 @@ -165,7 +165,7 @@
    7.22    sink->Stop (Seconds (10.0));
    7.23  
    7.24    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
    7.25 -  ooff = CreateObjectWith<OnOffApplication> (
    7.26 +  ooff = CreateObject<OnOffApplication> (
    7.27                                           "Node", n3, 
    7.28                                           "Remote", Address (InetSocketAddress ("10.1.2.1", port)), 
    7.29                                           "Protocol", TypeId::LookupByName ("Udp"),
    7.30 @@ -177,7 +177,7 @@
    7.31    ooff->Stop (Seconds(10.0));
    7.32  
    7.33    // Create a packet sink to receive these packets
    7.34 -  sink = CreateObjectWith<PacketSink> (
    7.35 +  sink = CreateObject<PacketSink> (
    7.36                                     "Node", n1,
    7.37                                     "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    7.38                                     "Protocol", TypeId::LookupByName ("Udp"));
    7.39 @@ -205,7 +205,7 @@
    7.40      (n3, channel2);
    7.41    // Create an ErrorModel based on the implementation (constructor)
    7.42    // specified by the default classId
    7.43 -  Ptr<RateErrorModel> em = CreateObjectWith<RateErrorModel> ("RanVar", UniformVariable (0.0, 1.0),
    7.44 +  Ptr<RateErrorModel> em = CreateObject<RateErrorModel> ("RanVar", UniformVariable (0.0, 1.0),
    7.45                                                               "Rate", Double (0.001));
    7.46    nd3->AddReceiveErrorModel (em);
    7.47  
     8.1 --- a/examples/simple-global-routing.cc	Tue Mar 11 11:35:26 2008 -0700
     8.2 +++ b/examples/simple-global-routing.cc	Tue Mar 11 13:30:12 2008 -0700
     8.3 @@ -160,7 +160,7 @@
     8.4    NS_LOG_INFO ("Create Applications.");
     8.5    uint16_t port = 9;   // Discard port (RFC 863)
     8.6    Ptr<OnOffApplication> ooff = 
     8.7 -    CreateObjectWith<OnOffApplication> ("Node", n0, 
     8.8 +    CreateObject<OnOffApplication> ("Node", n0, 
     8.9                                          "Remote", Address (InetSocketAddress ("10.1.3.2", port)), 
    8.10                                          "Protocol", TypeId::LookupByName ("Udp"),
    8.11                                          "OnTime", ConstantVariable (1), 
    8.12 @@ -173,7 +173,7 @@
    8.13    // Create a packet sink to receive these packets
    8.14    // The last argument "true" disables output from the Receive callback
    8.15    Ptr<PacketSink> sink = 
    8.16 -    CreateObjectWith<PacketSink> ("Node", n3, 
    8.17 +    CreateObject<PacketSink> ("Node", n3, 
    8.18                                    "Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    8.19                                    "Protocol", TypeId::LookupByName ("Udp"));
    8.20    n3->AddApplication (sink);
    8.21 @@ -182,7 +182,7 @@
    8.22    sink->Stop (Seconds (10.0));
    8.23  
    8.24    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
    8.25 -  ooff = CreateObjectWith<OnOffApplication> (
    8.26 +  ooff = CreateObject<OnOffApplication> (
    8.27                                               "Node", n3, 
    8.28                                               "Remote", Address (InetSocketAddress ("10.1.2.1", port)),
    8.29                                               "Protocol", TypeId::LookupByName ("Udp"),
    8.30 @@ -194,7 +194,7 @@
    8.31    ooff->Stop (Seconds (10.0));
    8.32  
    8.33    // Create a packet sink to receive these packets
    8.34 -  sink = CreateObjectWith<PacketSink> ("Node", n1,
    8.35 +  sink = CreateObject<PacketSink> ("Node", n1,
    8.36                                         "Remote", Address (InetSocketAddress (Ipv4Address::GetAny (), port)), 
    8.37                                         "Protocol", TypeId::LookupByName ("Udp"));
    8.38    n1->AddApplication (sink);
     9.1 --- a/examples/simple-point-to-point-olsr.cc	Tue Mar 11 11:35:26 2008 -0700
     9.2 +++ b/examples/simple-point-to-point-olsr.cc	Tue Mar 11 13:30:12 2008 -0700
     9.3 @@ -167,7 +167,7 @@
     9.4    NS_LOG_INFO ("Create Applications.");
     9.5    uint16_t port = 9;   // Discard port (RFC 863)
     9.6    Ptr<OnOffApplication> ooff = 
     9.7 -    CreateObjectWith<OnOffApplication> (
     9.8 +    CreateObject<OnOffApplication> (
     9.9                                          "Node", n0, 
    9.10                                          "Remote", Address (InetSocketAddress ("10.1.4.2", port)), 
    9.11                                          "Protocol", TypeId::LookupByName ("Udp"),
    9.12 @@ -179,7 +179,7 @@
    9.13  
    9.14    // Create an optional packet sink to receive these packets
    9.15    Ptr<PacketSink> sink = 
    9.16 -    CreateObjectWith<PacketSink> (
    9.17 +    CreateObject<PacketSink> (
    9.18                                    "Node", n4,
    9.19                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    9.20                                    "Protocol", TypeId::LookupByName ("Udp"));
    9.21 @@ -188,7 +188,7 @@
    9.22    sink->Start (Seconds (1.0));
    9.23  
    9.24    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
    9.25 -  ooff = CreateObjectWith<OnOffApplication> (
    9.26 +  ooff = CreateObject<OnOffApplication> (
    9.27                                               "Node", n4, 
    9.28                                               "Remote", Address (InetSocketAddress ("10.1.2.1", port)), 
    9.29                                               "Protocol", TypeId::LookupByName ("Udp"),
    9.30 @@ -199,7 +199,7 @@
    9.31    ooff->Start (Seconds(1.1));
    9.32  
    9.33    // Create a packet sink to receive these packets
    9.34 -  sink = CreateObjectWith<PacketSink> (
    9.35 +  sink = CreateObject<PacketSink> (
    9.36                                         "Node", n1,
    9.37                                         "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
    9.38                                         "Protocol", TypeId::LookupByName ("Udp"));
    10.1 --- a/examples/simple-point-to-point.cc	Tue Mar 11 11:35:26 2008 -0700
    10.2 +++ b/examples/simple-point-to-point.cc	Tue Mar 11 13:30:12 2008 -0700
    10.3 @@ -136,7 +136,7 @@
    10.4    NS_LOG_INFO ("Create Applications.");
    10.5    uint16_t port = 9;   // Discard port (RFC 863)
    10.6    Ptr<OnOffApplication> ooff = 
    10.7 -    CreateObjectWith<OnOffApplication> (
    10.8 +    CreateObject<OnOffApplication> (
    10.9                                          "Node", n0, 
   10.10                                          "Remote", Address (InetSocketAddress ("10.1.3.2", port)), 
   10.11                                          "Protocol", TypeId::LookupByName ("Udp"),
   10.12 @@ -148,7 +148,7 @@
   10.13  
   10.14    // Create an optional packet sink to receive these packets
   10.15    Ptr<PacketSink> sink = 
   10.16 -    CreateObjectWith<PacketSink> (
   10.17 +    CreateObject<PacketSink> (
   10.18                                    "Node", n3,
   10.19                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
   10.20                                    "Protocol", TypeId::LookupByName ("Udp"));
   10.21 @@ -157,7 +157,7 @@
   10.22    sink->Start (Seconds (1.0));
   10.23  
   10.24    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   10.25 -  ooff = CreateObjectWith<OnOffApplication> (
   10.26 +  ooff = CreateObject<OnOffApplication> (
   10.27                                               "Node", n3, 
   10.28                                               "Remote", Address (InetSocketAddress ("10.1.2.1", port)), 
   10.29                                               "Protocol", TypeId::LookupByName ("Udp"),
   10.30 @@ -168,7 +168,7 @@
   10.31    ooff->Start(Seconds(1.1));
   10.32  
   10.33    // Create a packet sink to receive these packets
   10.34 -  sink = CreateObjectWith<PacketSink> (
   10.35 +  sink = CreateObject<PacketSink> (
   10.36                                         "Node", n1,
   10.37                                         "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), port)),
   10.38                                         "Protocol", TypeId::LookupByName ("Udp"));
   10.39 @@ -180,7 +180,7 @@
   10.40    // Create a file transfer from n0 to n3, starting at time 1.2
   10.41    uint16_t servPort = 500;
   10.42  
   10.43 -  ooff = CreateObjectWith<OnOffApplication> (
   10.44 +  ooff = CreateObject<OnOffApplication> (
   10.45                                               "Node", n0, 
   10.46                                               "Remote", Address (InetSocketAddress ("10.1.3.2", servPort)), 
   10.47                                               "Protocol", TypeId::LookupByName ("Tcp"),
   10.48 @@ -192,7 +192,7 @@
   10.49    ooff->Stop (Seconds(1.35));
   10.50  
   10.51    // Create a packet sink to receive these TCP packets
   10.52 -  sink = CreateObjectWith<PacketSink> (
   10.53 +  sink = CreateObject<PacketSink> (
   10.54                                         "Node", n3,
   10.55                                         "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
   10.56                                         "Protocol", TypeId::LookupByName ("Tcp"));
    11.1 --- a/examples/tcp-large-transfer-errors.cc	Tue Mar 11 11:35:26 2008 -0700
    11.2 +++ b/examples/tcp-large-transfer-errors.cc	Tue Mar 11 13:30:12 2008 -0700
    11.3 @@ -198,7 +198,7 @@
    11.4  
    11.5    // Create a packet sink to receive these packets
    11.6    Ptr<PacketSink> sink = 
    11.7 -    CreateObjectWith<PacketSink> (
    11.8 +    CreateObject<PacketSink> (
    11.9                                    "Node", n2,
   11.10                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
   11.11                                    "Protocol", TypeId::LookupByName ("Tcp"));
    12.1 --- a/examples/tcp-large-transfer.cc	Tue Mar 11 11:35:26 2008 -0700
    12.2 +++ b/examples/tcp-large-transfer.cc	Tue Mar 11 13:30:12 2008 -0700
    12.3 @@ -198,7 +198,7 @@
    12.4  
    12.5    // Create a packet sink to receive these packets
    12.6    Ptr<PacketSink> sink = 
    12.7 -    CreateObjectWith<PacketSink> (
    12.8 +    CreateObject<PacketSink> (
    12.9                                    "Node", n2,
   12.10                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
   12.11                                    "Protocol", TypeId::LookupByName ("Tcp"));
    13.1 --- a/examples/tcp-small-transfer-oneloss.cc	Tue Mar 11 11:35:26 2008 -0700
    13.2 +++ b/examples/tcp-small-transfer-oneloss.cc	Tue Mar 11 13:30:12 2008 -0700
    13.3 @@ -180,7 +180,7 @@
    13.4  
    13.5    // Create a packet sink to receive these packets
    13.6    Ptr<PacketSink> sink = 
    13.7 -    CreateObjectWith<PacketSink> (
    13.8 +    CreateObject<PacketSink> (
    13.9                                    "Node", n2,
   13.10                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
   13.11                                    "Protocol", TypeId::LookupByName ("Tcp"));
    14.1 --- a/examples/tcp-small-transfer.cc	Tue Mar 11 11:35:26 2008 -0700
    14.2 +++ b/examples/tcp-small-transfer.cc	Tue Mar 11 13:30:12 2008 -0700
    14.3 @@ -190,7 +190,7 @@
    14.4  
    14.5    // Create a packet sink to receive these packets
    14.6    Ptr<PacketSink> sink = 
    14.7 -    CreateObjectWith<PacketSink> (
    14.8 +    CreateObject<PacketSink> (
    14.9                                    "Node", n2,
   14.10                                    "Local", Address (InetSocketAddress (Ipv4Address::GetAny (), servPort)),
   14.11                                    "Protocol", TypeId::LookupByName ("Tcp"));
    15.1 --- a/examples/udp-echo.cc	Tue Mar 11 11:35:26 2008 -0700
    15.2 +++ b/examples/udp-echo.cc	Tue Mar 11 13:30:12 2008 -0700
    15.3 @@ -161,7 +161,7 @@
    15.4  //
    15.5    uint16_t port = 9;  // well-known echo port number
    15.6  
    15.7 -  Ptr<UdpEchoServer> server = CreateObjectWith<UdpEchoServer> ("Node", n1, 
    15.8 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> ("Node", n1, 
    15.9                                                                 "Port", Uinteger (port));
   15.10    n1->AddApplication (server);
   15.11  //
   15.12 @@ -173,7 +173,7 @@
   15.13    Time interPacketInterval = Seconds (1.);
   15.14  
   15.15    Ptr<UdpEchoClient> client = 
   15.16 -    CreateObjectWith<UdpEchoClient> ("Node", n0, 
   15.17 +    CreateObject<UdpEchoClient> ("Node", n0, 
   15.18                                       "RemoteIpv4", Ipv4Address ("10.1.1.2"),
   15.19                                       "RemotePort", Uinteger (port),
   15.20                                       "MaxPackets", Uinteger (maxPacketCount), 
    16.1 --- a/samples/main-adhoc-wifi.cc	Tue Mar 11 11:35:26 2008 -0700
    16.2 +++ b/samples/main-adhoc-wifi.cc	Tue Mar 11 13:30:12 2008 -0700
    16.3 @@ -136,7 +136,7 @@
    16.4    NetDeviceContainer devices = wifi.Build (c);
    16.5  
    16.6    MobilityHelper mobility;
    16.7 -  Ptr<ListPositionAllocator> positionAlloc = CreateObjectWith<ListPositionAllocator> ();
    16.8 +  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
    16.9    positionAlloc->Add (Vector (0.0, 0.0, 0.0));
   16.10    positionAlloc->Add (Vector (5.0, 0.0, 0.0));
   16.11    mobility.SetPositionAllocator (positionAlloc);
   16.12 @@ -149,7 +149,7 @@
   16.13    destination.SetSingleDevice (0);
   16.14    destination.SetPhysicalAddress (devices.Get (1)->GetAddress ());
   16.15    Ptr<Application> app = 
   16.16 -    CreateObjectWith<OnOffApplication> ("Node", c.Get (0), 
   16.17 +    CreateObject<OnOffApplication> ("Node", c.Get (0), 
   16.18                                          "Remote", Address (destination),
   16.19                                          "Protocol", TypeId::LookupByName ("Packet"),
   16.20                                          "OnTime", ConstantVariable (250),
    17.1 --- a/samples/main-ap-wifi.cc	Tue Mar 11 11:35:26 2008 -0700
    17.2 +++ b/samples/main-ap-wifi.cc	Tue Mar 11 13:30:12 2008 -0700
    17.3 @@ -144,7 +144,7 @@
    17.4    destination.SetSingleDevice (0);
    17.5    destination.SetPhysicalAddress (staDevs.Get(1)->GetAddress ());
    17.6    Ptr<Application> app = 
    17.7 -    CreateObjectWith<OnOffApplication> ("Node", stas.Get (0), 
    17.8 +    CreateObject<OnOffApplication> ("Node", stas.Get (0), 
    17.9                                          "Remote", Address (destination), 
   17.10                                          "Protocol", TypeId::LookupByName ("Packet"),
   17.11                                          "OnTime", ConstantVariable (42),
    18.1 --- a/samples/main-propagation-loss.cc	Tue Mar 11 11:35:26 2008 -0700
    18.2 +++ b/samples/main-propagation-loss.cc	Tue Mar 11 13:30:12 2008 -0700
    18.3 @@ -29,8 +29,8 @@
    18.4  {
    18.5    Ptr<StaticMobilityModel> a = CreateObject<StaticMobilityModel> ();
    18.6    Ptr<StaticMobilityModel> b = CreateObject<StaticMobilityModel> ();
    18.7 -  Ptr<LogDistancePropagationLossModel> log = CreateObjectWith<LogDistancePropagationLossModel> ();
    18.8 -  log->SetReferenceModel (CreateObjectWith<FriisPropagationLossModel> ());
    18.9 +  Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
   18.10 +  log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
   18.11  
   18.12    Ptr<PropagationLossModel> model = log;
   18.13  
    19.1 --- a/src/core/attribute-test.cc	Tue Mar 11 11:35:26 2008 -0700
    19.2 +++ b/src/core/attribute-test.cc	Tue Mar 11 13:30:12 2008 -0700
    19.3 @@ -272,11 +272,11 @@
    19.4    CHECK_GET_STR (p, "TestBoolName", "false");
    19.5    CHECK_GET_PARAM (p, "TestBoolName", Boolean, false);
    19.6  
    19.7 -  p = CreateObjectWith<AttributeObjectTest> ("TestBoolName", String ("true"));
    19.8 +  p = CreateObject<AttributeObjectTest> ("TestBoolName", String ("true"));
    19.9    CHECK_GET_STR (p, "TestBoolName", "true");
   19.10    CHECK_GET_PARAM (p, "TestBoolName", Boolean, true);
   19.11  
   19.12 -  p = CreateObjectWith<AttributeObjectTest> ("TestBoolName", Boolean (true));
   19.13 +  p = CreateObject<AttributeObjectTest> ("TestBoolName", Boolean (true));
   19.14    CHECK_GET_STR (p, "TestBoolName", "true");
   19.15    CHECK_GET_PARAM (p, "TestBoolName", Boolean, true);
   19.16  
   19.17 @@ -300,7 +300,7 @@
   19.18    Ptr<AttributeObjectTest> x = p->GetAttribute ("TestPtr");
   19.19    NS_TEST_ASSERT (x == 0);
   19.20  
   19.21 -  p = CreateObjectWith<AttributeObjectTest> ("TestPtr", Create<Derived> ());
   19.22 +  p = CreateObject<AttributeObjectTest> ("TestPtr", Create<Derived> ());
   19.23    NS_TEST_ASSERT (p != 0);
   19.24    derived = 0;
   19.25    derived = p->GetAttribute ("TestPtr");
   19.26 @@ -428,12 +428,12 @@
   19.27    }
   19.28  
   19.29    NS_TEST_ASSERT (AttributeList::GetGlobal ()->SetFailSafe ("AttributeObjectTest::TestBoolName", String ("true")));
   19.30 -  p = CreateObjectWith<AttributeObjectTest> ();
   19.31 +  p = CreateObject<AttributeObjectTest> ();
   19.32    Boolean boolV = p->GetAttribute ("TestBoolName");
   19.33    NS_TEST_ASSERT_EQUAL (boolV, Boolean (true));
   19.34  
   19.35    NS_TEST_ASSERT (AttributeList::GetGlobal ()->SetFailSafe ("AttributeObjectTest::TestBoolName", String ("false")));
   19.36 -  p = CreateObjectWith<AttributeObjectTest> ();
   19.37 +  p = CreateObject<AttributeObjectTest> ();
   19.38    boolV = p->GetAttribute ("TestBoolName");
   19.39    NS_TEST_ASSERT_EQUAL (boolV, Boolean (false));
   19.40  
    20.1 --- a/src/core/object.h	Tue Mar 11 11:35:26 2008 -0700
    20.2 +++ b/src/core/object.h	Tue Mar 11 13:30:12 2008 -0700
    20.3 @@ -507,24 +507,6 @@
    20.4    template <typename T>
    20.5    friend Ptr<T> CreateObject (const AttributeList &attributes);
    20.6  
    20.7 -  template <typename T>
    20.8 -  friend Ptr<T> CreateObject (void);
    20.9 -  template <typename T, typename T1>
   20.10 -  friend Ptr<T> CreateObject (T1 a1);
   20.11 -  template <typename T, typename T1, typename T2>
   20.12 -  friend Ptr<T> CreateObject (T1 a1, T2 a2);
   20.13 -  template <typename T, typename T1, typename T2, typename T3>
   20.14 -  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3);
   20.15 -  template <typename T, typename T1, typename T2, typename T3, typename T4>
   20.16 -  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4);
   20.17 -  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
   20.18 -  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   20.19 -  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
   20.20 -  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
   20.21 -  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
   20.22 -  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7);
   20.23 -
   20.24 -
   20.25    bool DoSet (Ptr<const AttributeAccessor> spec, Attribute intialValue, 
   20.26                Ptr<const AttributeChecker> checker, Attribute value);
   20.27    Ptr<Object> DoGetObject (TypeId tid) const;
   20.28 @@ -671,84 +653,17 @@
   20.29  }
   20.30  
   20.31  template <typename T>
   20.32 -Ptr<T> CreateObject (void)
   20.33 -{
   20.34 -  Ptr<T> p = Ptr<T> (new T (), false);
   20.35 -  p->SetTypeId (T::GetTypeId ());
   20.36 -  p->Object::Construct (AttributeList ());
   20.37 -  return p;
   20.38 -}
   20.39 -
   20.40 -template <typename T, typename T1>
   20.41 -Ptr<T> CreateObject (T1 a1)
   20.42 -{
   20.43 -  Ptr<T> p = Ptr<T> (new T (a1), false);
   20.44 -  p->SetTypeId (T::GetTypeId ());
   20.45 -  p->Object::Construct (AttributeList ());
   20.46 -  return p;
   20.47 -}
   20.48 -
   20.49 -template <typename T, typename T1, typename T2>
   20.50 -Ptr<T> CreateObject (T1 a1, T2 a2)
   20.51 -{
   20.52 -  Ptr<T> p = Ptr<T> (new T (a1, a2), false);
   20.53 -  p->SetTypeId (T::GetTypeId ());
   20.54 -  p->Object::Construct (AttributeList ());
   20.55 -  return p;
   20.56 -}
   20.57 -template <typename T, typename T1, typename T2, typename T3>
   20.58 -Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3)
   20.59 -{
   20.60 -  Ptr<T> p = Ptr<T> (new T (a1, a2, a3), false);
   20.61 -  p->SetTypeId (T::GetTypeId ());
   20.62 -  return p;
   20.63 -}
   20.64 -
   20.65 -template <typename T, typename T1, typename T2, typename T3, typename T4>
   20.66 -Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4)
   20.67 -{
   20.68 -  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4), false);
   20.69 -  p->SetTypeId (T::GetTypeId ());
   20.70 -  return p;
   20.71 -}
   20.72 -
   20.73 -template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
   20.74 -Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
   20.75 -{
   20.76 -  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5), false);
   20.77 -  p->SetTypeId (T::GetTypeId ());
   20.78 -  return p;
   20.79 -}
   20.80 -
   20.81 -template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
   20.82 -Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
   20.83 -{
   20.84 -  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5, a6), false);
   20.85 -  p->SetTypeId (T::GetTypeId ());
   20.86 -  return p;
   20.87 -}
   20.88 -
   20.89 -template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
   20.90 -Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
   20.91 -{
   20.92 -  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5, a6, a7), false);
   20.93 -  p->SetTypeId (T::GetTypeId ());
   20.94 -  return p;
   20.95 -}
   20.96 -
   20.97 -
   20.98 -template <typename T>
   20.99  Ptr<T> 
  20.100 -CreateObjectWith (std::string n1 = "", Attribute v1 = Attribute (),
  20.101 -                  std::string n2 = "", Attribute v2 = Attribute (),
  20.102 -                  std::string n3 = "", Attribute v3 = Attribute (),
  20.103 -                  std::string n4 = "", Attribute v4 = Attribute (),
  20.104 -                  std::string n5 = "", Attribute v5 = Attribute (),
  20.105 -                  std::string n6 = "", Attribute v6 = Attribute (),
  20.106 -                  std::string n7 = "", Attribute v7 = Attribute (),
  20.107 -                  std::string n8 = "", Attribute v8 = Attribute (),
  20.108 -                  std::string n9 = "", Attribute v9 = Attribute ())
  20.109 -              
  20.110 +CreateObject (std::string n1 = "", Attribute v1 = Attribute (),
  20.111 +              std::string n2 = "", Attribute v2 = Attribute (),
  20.112 +              std::string n3 = "", Attribute v3 = Attribute (),
  20.113 +              std::string n4 = "", Attribute v4 = Attribute (),
  20.114 +              std::string n5 = "", Attribute v5 = Attribute (),
  20.115 +              std::string n6 = "", Attribute v6 = Attribute (),
  20.116 +              std::string n7 = "", Attribute v7 = Attribute (),
  20.117 +              std::string n8 = "", Attribute v8 = Attribute (),
  20.118 +              std::string n9 = "", Attribute v9 = Attribute ())
  20.119 +  
  20.120  {
  20.121    AttributeList attributes;
  20.122    if (n1 == "")
    21.1 --- a/src/devices/csma/csma-channel.cc	Tue Mar 11 11:35:26 2008 -0700
    21.2 +++ b/src/devices/csma/csma-channel.cc	Tue Mar 11 13:30:12 2008 -0700
    21.3 @@ -45,48 +45,32 @@
    21.4    return active;
    21.5  }
    21.6  
    21.7 +TypeId 
    21.8 +CsmaChannel::GetTypeId (void)
    21.9 +{
   21.10 +  static TypeId tid = TypeId ("CsmaChannel")
   21.11 +    .SetParent<Channel> ()
   21.12 +    .AddConstructor<CsmaChannel> ()
   21.13 +    .AddAttribute ("BitRate", "The maximum bitrate of the channel",
   21.14 +                   DataRate (0xffffffff),
   21.15 +                   MakeDataRateAccessor (&CsmaChannel::m_bps),
   21.16 +                   MakeDataRateChecker ())
   21.17 +    .AddAttribute ("Delay", "Transmission delay through the channel",
   21.18 +                   Seconds (0),
   21.19 +                   MakeTimeAccessor (&CsmaChannel::m_delay),
   21.20 +                   MakeTimeChecker ())
   21.21 +    ;
   21.22 +  return tid;
   21.23 +}
   21.24  
   21.25  //
   21.26  // By default, you get a channel with the name "Csma Channel" that 
   21.27  // has an "infitely" fast transmission speed and zero delay.
   21.28  CsmaChannel::CsmaChannel()
   21.29  : 
   21.30 -  Channel ("Csma Channel"), 
   21.31 -  m_bps (DataRate(0xffffffff)),
   21.32 -  m_delay (Seconds(0))
   21.33 +  Channel ("Csma Channel")
   21.34  {
   21.35    NS_LOG_FUNCTION;
   21.36 -  Init();
   21.37 -}
   21.38 -
   21.39 -CsmaChannel::CsmaChannel(
   21.40 -  const DataRate& bps, 
   21.41 -  const Time& delay)
   21.42 -: 
   21.43 -  Channel ("Csma Channel"), 
   21.44 -  m_bps (bps),
   21.45 -  m_delay (delay)
   21.46 -{
   21.47 -  NS_LOG_FUNCTION;
   21.48 -  NS_LOG_PARAMS (this << Channel::GetName() << bps.GetBitRate() << delay);
   21.49 -  Init();
   21.50 -}
   21.51 -
   21.52 -CsmaChannel::CsmaChannel(
   21.53 -  const std::string& name,
   21.54 -  const DataRate& bps, 
   21.55 -  const Time& delay)
   21.56 -: 
   21.57 -  Channel (name),
   21.58 -  m_bps (bps), 
   21.59 -  m_delay (delay)
   21.60 -{
   21.61 -  NS_LOG_FUNCTION;
   21.62 -  NS_LOG_PARAMS (this << name << bps.GetBitRate() << delay);
   21.63 -  Init();
   21.64 -}
   21.65 -
   21.66 -void CsmaChannel::Init() {
   21.67    m_state = IDLE;
   21.68    m_deviceList.clear();
   21.69  }
    22.1 --- a/src/devices/csma/csma-channel.h	Tue Mar 11 11:35:26 2008 -0700
    22.2 +++ b/src/devices/csma/csma-channel.h	Tue Mar 11 13:30:12 2008 -0700
    22.3 @@ -85,8 +85,10 @@
    22.4   * packet to the channel is really connected to this channel
    22.5   *
    22.6   */
    22.7 -class CsmaChannel : public Channel {
    22.8 +class CsmaChannel : public Channel 
    22.9 +{
   22.10  public:
   22.11 +  static TypeId GetTypeId (void);
   22.12    /**
   22.13     * \brief Create a CsmaChannel
   22.14     *
   22.15 @@ -94,24 +96,6 @@
   22.16     * has an "infitely" fast transmission speed and zero delay.
   22.17     */
   22.18    CsmaChannel ();
   22.19 -  
   22.20 -  /**
   22.21 -   * \brief Create a CsmaChannel
   22.22 -   *
   22.23 -   * \param bps The bitrate of the channel
   22.24 -   * \param delay Transmission delay through the channel
   22.25 -   */  
   22.26 -  CsmaChannel (const DataRate& bps, const Time& delay);
   22.27 -  
   22.28 -  /**
   22.29 -   * \brief Create a CsmaChannel
   22.30 -   *
   22.31 -   * \param name the name of the channel for identification purposes
   22.32 -   * \param bps The bitrate of the channel
   22.33 -   * \param delay Transmission delay through the channel
   22.34 -   */
   22.35 -  CsmaChannel (const std::string& name,
   22.36 -                     const DataRate& bps, const Time& delay);
   22.37  
   22.38    /**
   22.39     * \brief Attach a given netdevice to this channel
   22.40 @@ -298,11 +282,6 @@
   22.41     * Current state of the channel
   22.42     */
   22.43    WireState          m_state;
   22.44 -  /**
   22.45 -   * Initializes the channel when it is constructed. Resets the
   22.46 -   * deviceList and sets the channel state to IDLE.
   22.47 -   */
   22.48 -  void Init (void);
   22.49  };
   22.50  
   22.51  } // namespace ns3
    23.1 --- a/src/devices/csma/csma-ipv4-topology.cc	Tue Mar 11 11:35:26 2008 -0700
    23.2 +++ b/src/devices/csma/csma-ipv4-topology.cc	Tue Mar 11 13:30:12 2008 -0700
    23.3 @@ -41,10 +41,10 @@
    23.4    Ptr<CsmaChannel> channel,
    23.5    Mac48Address addr)
    23.6  {
    23.7 -  Ptr<Queue> q = CreateObjectWith<DropTailQueue> ();
    23.8 +  Ptr<Queue> q = CreateObject<DropTailQueue> ();
    23.9  
   23.10    // assume full-duplex
   23.11 -  Ptr<CsmaNetDevice> nd = CreateObjectWith<CsmaNetDevice> ("Node", node, 
   23.12 +  Ptr<CsmaNetDevice> nd = CreateObject<CsmaNetDevice> ("Node", node, 
   23.13                                                             "Address", addr, 
   23.14                                                             "EncapsulationMode", String ("IpArp"));
   23.15    node->AddDevice (nd);
   23.16 @@ -60,9 +60,9 @@
   23.17                                       Ptr<CsmaChannel> ch,
   23.18                                       Mac48Address addr)
   23.19  {
   23.20 -  Ptr<Queue> q = CreateObjectWith<DropTailQueue> ();
   23.21 +  Ptr<Queue> q = CreateObject<DropTailQueue> ();
   23.22  
   23.23 -  Ptr<CsmaNetDevice> nd0 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
   23.24 +  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> ("Node", n1, 
   23.25                                                              "Address", addr,
   23.26                                                              "EncapsulationMode", String ("Llc"));
   23.27    n1->AddDevice (nd0);
   23.28 @@ -71,7 +71,7 @@
   23.29    nd0->AddQueue(q);
   23.30    nd0->Attach (ch);
   23.31  
   23.32 -  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
   23.33 +  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Node", n1, 
   23.34                                                              "Address", addr,
   23.35                                                              "EncapsulationMode", String ("Llc"));
   23.36    n1->AddDevice (nd1);
   23.37 @@ -86,9 +86,9 @@
   23.38                                       Ptr<CsmaChannel> ch,
   23.39                                       Mac48Address addr)
   23.40  {
   23.41 -  Ptr<Queue> q = CreateObjectWith<DropTailQueue> ();
   23.42 +  Ptr<Queue> q = CreateObject<DropTailQueue> ();
   23.43  
   23.44 -  Ptr<CsmaNetDevice> nd0 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
   23.45 +  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> ("Node", n1, 
   23.46                                                              "Address", addr,
   23.47                                                              "EncapsulationMode", String ("Raw"));
   23.48    n1->AddDevice (nd0);
   23.49 @@ -97,7 +97,7 @@
   23.50    nd0->AddQueue(q);
   23.51    nd0->Attach (ch);
   23.52  
   23.53 -  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", n1, 
   23.54 +  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Node", n1, 
   23.55                                                              "Address", addr,
   23.56                                                              "EncapsulationMode", String ("Raw"));
   23.57    n1->AddDevice (nd1);
    24.1 --- a/src/devices/csma/csma-topology.cc	Tue Mar 11 11:35:26 2008 -0700
    24.2 +++ b/src/devices/csma/csma-topology.cc	Tue Mar 11 13:30:12 2008 -0700
    24.3 @@ -36,7 +36,7 @@
    24.4    const DataRate& bps,
    24.5    const Time& delay)
    24.6  {
    24.7 -  Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> (bps, delay);
    24.8 +  Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> ("BitRate", bps, "Delay", delay);
    24.9  
   24.10    return channel;
   24.11  }
   24.12 @@ -48,7 +48,7 @@
   24.13    Ptr<CsmaChannel> ch,
   24.14    Mac48Address addr)
   24.15  {
   24.16 -  Ptr<CsmaNetDevice> nd1 = CreateObjectWith<CsmaNetDevice> ("Node", Ptr<Node> (n1), 
   24.17 +  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> ("Node", Ptr<Node> (n1), 
   24.18                                                              "Address", addr, 
   24.19                                                              "EncapsulationMode", "EthernetV1");
   24.20  
    25.1 --- a/src/devices/point-to-point/point-to-point-channel.cc	Tue Mar 11 11:35:26 2008 -0700
    25.2 +++ b/src/devices/point-to-point/point-to-point-channel.cc	Tue Mar 11 13:30:12 2008 -0700
    25.3 @@ -29,46 +29,35 @@
    25.4  
    25.5  namespace ns3 {
    25.6  
    25.7 +TypeId 
    25.8 +PointToPointChannel::GetTypeId (void)
    25.9 +{
   25.10 +  static TypeId tid = TypeId ("PointToPointChannel")
   25.11 +    .SetParent<Channel> ()
   25.12 +    .AddConstructor<PointToPointChannel> ()
   25.13 +    .AddAttribute ("BitRate", "The maximum bitrate of the channel",
   25.14 +                   DataRate (0xffffffff),
   25.15 +                   MakeDataRateAccessor (&PointToPointChannel::m_bps),
   25.16 +                   MakeDataRateChecker ())
   25.17 +    .AddAttribute ("Delay", "Transmission delay through the channel",
   25.18 +                   Seconds (0),
   25.19 +                   MakeTimeAccessor (&PointToPointChannel::m_delay),
   25.20 +                   MakeTimeChecker ())
   25.21 +    ;
   25.22 +  return tid;
   25.23 +}
   25.24 +
   25.25  //
   25.26  // By default, you get a channel with the name "PointToPoint Channel" that 
   25.27  // has an "infitely" fast transmission speed and zero delay.
   25.28  PointToPointChannel::PointToPointChannel()
   25.29  : 
   25.30    Channel ("PointToPoint Channel"), 
   25.31 -  m_bps (DataRate(0xffffffff)),
   25.32 -  m_delay (Seconds(0)),
   25.33    m_nDevices(0)
   25.34  {
   25.35    NS_LOG_FUNCTION;
   25.36  }
   25.37  
   25.38 -PointToPointChannel::PointToPointChannel(
   25.39 -  const DataRate& bps, 
   25.40 -  const Time& delay)
   25.41 -: 
   25.42 -  Channel ("PointToPoint Channel"), 
   25.43 -  m_bps (bps),
   25.44 -  m_delay (delay),
   25.45 -  m_nDevices(0)
   25.46 -{
   25.47 -  NS_LOG_FUNCTION;
   25.48 -  NS_LOG_PARAMS (this << Channel::GetName() << bps.GetBitRate() << delay);
   25.49 -}
   25.50 -
   25.51 -PointToPointChannel::PointToPointChannel(
   25.52 -  const std::string& name,
   25.53 -  const DataRate& bps, 
   25.54 -  const Time& delay)
   25.55 -: 
   25.56 -  Channel (name),
   25.57 -  m_bps (bps), 
   25.58 -  m_delay (delay),
   25.59 -  m_nDevices(0)
   25.60 -{
   25.61 -  NS_LOG_FUNCTION;
   25.62 -  NS_LOG_PARAMS (this << name << bps.GetBitRate() << delay);
   25.63 -}
   25.64 -
   25.65  void
   25.66  PointToPointChannel::Attach(Ptr<PointToPointNetDevice> device)
   25.67  {
    26.1 --- a/src/devices/point-to-point/point-to-point-channel.h	Tue Mar 11 11:35:26 2008 -0700
    26.2 +++ b/src/devices/point-to-point/point-to-point-channel.h	Tue Mar 11 13:30:12 2008 -0700
    26.3 @@ -49,8 +49,11 @@
    26.4   * [0] wire to transmit on.  The second device gets the [1] wire.  There is a
    26.5   * state (IDLE, TRANSMITTING) associated with each wire.
    26.6   */
    26.7 -class PointToPointChannel : public Channel {
    26.8 +class PointToPointChannel : public Channel 
    26.9 +{
   26.10  public:
   26.11 +  static TypeId GetTypeId (void);
   26.12 +
   26.13    /**
   26.14     * \brief Create a PointToPointChannel
   26.15     *
   26.16 @@ -58,24 +61,6 @@
   26.17     * has an "infitely" fast transmission speed and zero delay.
   26.18     */
   26.19    PointToPointChannel ();
   26.20 -  
   26.21 -  /**
   26.22 -   * \brief Create a PointToPointChannel
   26.23 -   *
   26.24 -   * \param bps The maximum bitrate of the channel
   26.25 -   * \param delay Transmission delay through the channel
   26.26 -   */  
   26.27 -  PointToPointChannel (const DataRate& bps, const Time& delay);
   26.28 -  
   26.29 -  /**
   26.30 -   * \brief Create a PointToPointChannel
   26.31 -   *
   26.32 -   * \param name the name of the channel for identification purposes
   26.33 -   * \param bps The maximum bitrate of the channel
   26.34 -   * \param delay Transmission delay through the channel
   26.35 -   */
   26.36 -  PointToPointChannel (const std::string& name,
   26.37 -                       const DataRate& bps, const Time& delay);
   26.38  
   26.39    /**
   26.40     * \brief Attach a given netdevice to this channel
    27.1 --- a/src/devices/point-to-point/point-to-point-topology.cc	Tue Mar 11 11:35:26 2008 -0700
    27.2 +++ b/src/devices/point-to-point/point-to-point-topology.cc	Tue Mar 11 13:30:12 2008 -0700
    27.3 @@ -46,21 +46,21 @@
    27.4    const DataRate& bps,
    27.5    const Time& delay)
    27.6  {
    27.7 -  Ptr<PointToPointChannel> channel = CreateObject<PointToPointChannel> (bps, delay);
    27.8 +  Ptr<PointToPointChannel> channel = CreateObject<PointToPointChannel> ("BitRate", bps, "Delay", delay);
    27.9  
   27.10 -  Ptr<PointToPointNetDevice> net1 = CreateObjectWith<PointToPointNetDevice> ("Node", n1, 
   27.11 -                                                                             "Address", Mac48Address::Allocate ());
   27.12 +  Ptr<PointToPointNetDevice> net1 = CreateObject<PointToPointNetDevice> ("Node", n1, 
   27.13 +                                                                         "Address", Mac48Address::Allocate ());
   27.14    n1->AddDevice (net1);
   27.15  
   27.16 -  Ptr<Queue> q = CreateObjectWith<DropTailQueue> ();
   27.17 +  Ptr<Queue> q = CreateObject<DropTailQueue> ();
   27.18    net1->AddQueue(q);
   27.19    net1->Attach (channel);
   27.20    
   27.21 -  Ptr<PointToPointNetDevice> net2 = CreateObjectWith<PointToPointNetDevice> ("Node", n2, 
   27.22 -                                                                             "Address", Mac48Address::Allocate ());
   27.23 +  Ptr<PointToPointNetDevice> net2 = CreateObject<PointToPointNetDevice> ("Node", n2, 
   27.24 +                                                                         "Address", Mac48Address::Allocate ());
   27.25    n2->AddDevice (net2);
   27.26  
   27.27 -  q = CreateObjectWith<DropTailQueue> ();
   27.28 +  q = CreateObject<DropTailQueue> ();
   27.29    net2->AddQueue(q);
   27.30    net2->Attach (channel);
   27.31  
    28.1 --- a/src/devices/wifi/adhoc-wifi-mac.cc	Tue Mar 11 11:35:26 2008 -0700
    28.2 +++ b/src/devices/wifi/adhoc-wifi-mac.cc	Tue Mar 11 13:30:12 2008 -0700
    28.3 @@ -48,7 +48,7 @@
    28.4    m_rxMiddle = new MacRxMiddle ();
    28.5    m_rxMiddle->SetForwardCallback (MakeCallback (&AdhocWifiMac::ForwardUp, this));
    28.6  
    28.7 -  m_low = CreateObjectWith<MacLow> ();
    28.8 +  m_low = CreateObject<MacLow> ();
    28.9    m_low->SetRxCallback (MakeCallback (&MacRxMiddle::Receive, m_rxMiddle));
   28.10    m_low->SetMac (this);
   28.11  
    29.1 --- a/src/devices/wifi/dca-txop.cc	Tue Mar 11 11:35:26 2008 -0700
    29.2 +++ b/src/devices/wifi/dca-txop.cc	Tue Mar 11 13:30:12 2008 -0700
    29.3 @@ -132,7 +132,7 @@
    29.4  {
    29.5    m_transmissionListener = new DcaTxop::TransmissionListener (this);
    29.6    m_dcf = new DcaTxop::Dcf (this);
    29.7 -  m_queue = CreateObjectWith<WifiMacQueue> ();
    29.8 +  m_queue = CreateObject<WifiMacQueue> ();
    29.9    m_rng = new RealRandomStream ();
   29.10    m_txMiddle = new MacTxMiddle ();
   29.11  }
    30.1 --- a/src/devices/wifi/propagation-loss-model.cc	Tue Mar 11 11:35:26 2008 -0700
    30.2 +++ b/src/devices/wifi/propagation-loss-model.cc	Tue Mar 11 13:30:12 2008 -0700
    30.3 @@ -252,10 +252,10 @@
    30.4     * rx = rx0(tx) - 10 * n * log (d/d0)
    30.5     */
    30.6    static Ptr<StaticMobilityModel> zero = 
    30.7 -    CreateObjectWith<StaticMobilityModel> ("position", 
    30.8 +    CreateObject<StaticMobilityModel> ("position", 
    30.9                                             Vector (0.0, 0.0, 0.0));
   30.10    static Ptr<StaticMobilityModel> reference = 
   30.11 -    CreateObjectWith<StaticMobilityModel> ("position", 
   30.12 +    CreateObject<StaticMobilityModel> ("position", 
   30.13                                             Vector (m_referenceDistance, 0.0, 0.0));
   30.14    double rx0 = m_reference->GetRxPower (txPowerDbm, zero, reference);
   30.15    double pathLossDb = 10 * m_exponent * log10 (distance / m_referenceDistance);
    31.1 --- a/src/devices/wifi/wifi-helper.cc	Tue Mar 11 11:35:26 2008 -0700
    31.2 +++ b/src/devices/wifi/wifi-helper.cc	Tue Mar 11 13:30:12 2008 -0700
    31.3 @@ -92,10 +92,10 @@
    31.4  NetDeviceContainer
    31.5  WifiHelper::Build (NodeContainer c) const
    31.6  {
    31.7 -  Ptr<WifiChannel> channel = CreateObjectWith<WifiChannel> ();
    31.8 -  channel->SetPropagationDelayModel (CreateObjectWith<ConstantSpeedPropagationDelayModel> ());
    31.9 -  Ptr<LogDistancePropagationLossModel> log = CreateObjectWith<LogDistancePropagationLossModel> ();
   31.10 -  log->SetReferenceModel (CreateObjectWith<FriisPropagationLossModel> ());
   31.11 +  Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
   31.12 +  channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
   31.13 +  Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
   31.14 +  log->SetReferenceModel (CreateObject<FriisPropagationLossModel> ());
   31.15    channel->SetPropagationLossModel (log);
   31.16    return Build (c, channel);
   31.17  }
    32.1 --- a/src/internet-node/arp-ipv4-interface.cc	Tue Mar 11 11:35:26 2008 -0700
    32.2 +++ b/src/internet-node/arp-ipv4-interface.cc	Tue Mar 11 13:30:12 2008 -0700
    32.3 @@ -34,9 +34,7 @@
    32.4  
    32.5  namespace ns3 {
    32.6  
    32.7 -ArpIpv4Interface::ArpIpv4Interface (Ptr<Node> node, Ptr<NetDevice> device)
    32.8 -  : Ipv4Interface (device),
    32.9 -    m_node (node)
   32.10 +ArpIpv4Interface::ArpIpv4Interface ()
   32.11  {
   32.12    NS_LOG_FUNCTION;
   32.13  }
   32.14 @@ -47,6 +45,30 @@
   32.15  }
   32.16  
   32.17  void 
   32.18 +ArpIpv4Interface::DoDispose (void)
   32.19 +{
   32.20 +  m_node = 0;
   32.21 +  m_device = 0;
   32.22 +}
   32.23 +
   32.24 +void 
   32.25 +ArpIpv4Interface::SetNode (Ptr<Node> node)
   32.26 +{
   32.27 +  m_node = node;
   32.28 +}
   32.29 +void 
   32.30 +ArpIpv4Interface::SetDevice (Ptr<NetDevice> device)
   32.31 +{
   32.32 +  m_device = device;
   32.33 +}
   32.34 +
   32.35 +Ptr<NetDevice> 
   32.36 +ArpIpv4Interface::GetDevice (void) const
   32.37 +{
   32.38 +  return m_device;
   32.39 +}
   32.40 +
   32.41 +void 
   32.42  ArpIpv4Interface::SendTo (Ptr<Packet> p, Ipv4Address dest)
   32.43  {
   32.44    NS_LOG_FUNCTION;
    33.1 --- a/src/internet-node/arp-ipv4-interface.h	Tue Mar 11 11:35:26 2008 -0700
    33.2 +++ b/src/internet-node/arp-ipv4-interface.h	Tue Mar 11 13:30:12 2008 -0700
    33.3 @@ -39,12 +39,19 @@
    33.4  class ArpIpv4Interface : public Ipv4Interface
    33.5  {
    33.6   public:
    33.7 -  ArpIpv4Interface (Ptr<Node> node, Ptr<NetDevice> device);
    33.8 +  ArpIpv4Interface ();
    33.9    virtual ~ArpIpv4Interface ();
   33.10  
   33.11 +  void SetNode (Ptr<Node> node);
   33.12 +  void SetDevice (Ptr<NetDevice> device);
   33.13 +
   33.14 +  virtual Ptr<NetDevice> GetDevice (void) const;
   33.15 +
   33.16  private:
   33.17    virtual void SendTo (Ptr<Packet> p, Ipv4Address dest);
   33.18 +  virtual void DoDispose (void);
   33.19    Ptr<Node> m_node;
   33.20 +  Ptr<NetDevice> m_device;
   33.21  };
   33.22  
   33.23  }//namespace ns3
    34.1 --- a/src/internet-node/arp-l3-protocol.cc	Tue Mar 11 11:35:26 2008 -0700
    34.2 +++ b/src/internet-node/arp-l3-protocol.cc	Tue Mar 11 13:30:12 2008 -0700
    34.3 @@ -42,11 +42,6 @@
    34.4  {
    34.5    static TypeId tid = TypeId ("ArpL3Protocol")
    34.6      .SetParent<Object> ()
    34.7 -    .AddAttribute ("Node", "The node to which this protocol is associated.",
    34.8 -                   TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
    34.9 -                   Ptr<Node> (0),
   34.10 -                   MakePtrAccessor (&ArpL3Protocol::m_node),
   34.11 -                   MakePtrChecker<Node> ())
   34.12      ;
   34.13    return tid;
   34.14  }
   34.15 @@ -62,6 +57,12 @@
   34.16  }
   34.17  
   34.18  void 
   34.19 +ArpL3Protocol::SetNode (Ptr<Node> node)
   34.20 +{
   34.21 +  m_node = node;
   34.22 +}
   34.23 +
   34.24 +void 
   34.25  ArpL3Protocol::DoDispose (void)
   34.26  {
   34.27    NS_LOG_FUNCTION;
    35.1 --- a/src/internet-node/arp-l3-protocol.h	Tue Mar 11 11:35:26 2008 -0700
    35.2 +++ b/src/internet-node/arp-l3-protocol.h	Tue Mar 11 13:30:12 2008 -0700
    35.3 @@ -47,6 +47,9 @@
    35.4     */
    35.5    ArpL3Protocol ();
    35.6    virtual ~ArpL3Protocol ();
    35.7 +
    35.8 +  void SetNode (Ptr<Node> node);
    35.9 +
   35.10    /**
   35.11     * \brief Recieve a packet
   35.12     */
    36.1 --- a/src/internet-node/internet-node.cc	Tue Mar 11 11:35:26 2008 -0700
    36.2 +++ b/src/internet-node/internet-node.cc	Tue Mar 11 13:30:12 2008 -0700
    36.3 @@ -52,8 +52,10 @@
    36.4  void
    36.5  InternetNode::Construct (void)
    36.6  {
    36.7 -  Ptr<Ipv4L3Protocol> ipv4 = CreateObjectWith<Ipv4L3Protocol> ("Node", Ptr<Node> (this));
    36.8 -  Ptr<ArpL3Protocol> arp = CreateObjectWith<ArpL3Protocol> ("Node", Ptr<Node> (this));
    36.9 +  Ptr<Ipv4L3Protocol> ipv4 = CreateObject<Ipv4L3Protocol> ();
   36.10 +  Ptr<ArpL3Protocol> arp = CreateObject<ArpL3Protocol> ();
   36.11 +  ipv4->SetNode (this);
   36.12 +  arp->SetNode (this);
   36.13    // XXX remove the PeekPointer below.
   36.14    RegisterProtocolHandler (MakeCallback (&Ipv4L3Protocol::Receive, PeekPointer (ipv4)), 
   36.15                             Ipv4L3Protocol::PROT_NUMBER, 0);
   36.16 @@ -61,16 +63,24 @@
   36.17                             ArpL3Protocol::PROT_NUMBER, 0);
   36.18  
   36.19  
   36.20 -  Ptr<Ipv4L4Demux> ipv4L4Demux = CreateObjectWith<Ipv4L4Demux> ("Node", Ptr<Node> (this));
   36.21 -  Ptr<UdpL4Protocol> udp = CreateObjectWith<UdpL4Protocol> ("Node", Ptr<Node> (this));
   36.22 -  Ptr<TcpL4Protocol> tcp = CreateObjectWith<TcpL4Protocol> ("Node", Ptr<Node> (this));
   36.23 +  Ptr<Ipv4L4Demux> ipv4L4Demux = CreateObject<Ipv4L4Demux> ();
   36.24 +  Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
   36.25 +  Ptr<TcpL4Protocol> tcp = CreateObject<TcpL4Protocol> ();
   36.26 +
   36.27 +  ipv4L4Demux->SetNode (this);
   36.28 +  udp->SetNode (this);
   36.29 +  tcp->SetNode (this);
   36.30  
   36.31    ipv4L4Demux->Insert (udp);
   36.32    ipv4L4Demux->Insert (tcp);
   36.33  
   36.34 -  Ptr<UdpImpl> udpImpl = CreateObject<UdpImpl> (udp);
   36.35 -  Ptr<TcpImpl> tcpImpl = CreateObject<TcpImpl> (tcp);
   36.36 -  Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> (ipv4);
   36.37 +  Ptr<UdpImpl> udpImpl = CreateObject<UdpImpl> ();
   36.38 +  Ptr<TcpImpl> tcpImpl = CreateObject<TcpImpl> ();
   36.39 +  Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> ();
   36.40 +
   36.41 +  udpImpl->SetUdp (udp);
   36.42 +  tcpImpl->SetTcp (tcp);
   36.43 +  ipv4Impl->SetIpv4 (ipv4);
   36.44  
   36.45    Object::AggregateObject (ipv4);
   36.46    Object::AggregateObject (arp);
    37.1 --- a/src/internet-node/ipv4-impl.cc	Tue Mar 11 11:35:26 2008 -0700
    37.2 +++ b/src/internet-node/ipv4-impl.cc	Tue Mar 11 13:30:12 2008 -0700
    37.3 @@ -26,14 +26,19 @@
    37.4  
    37.5  namespace ns3 {
    37.6  
    37.7 -Ipv4Impl::Ipv4Impl (Ptr<Ipv4L3Protocol> ipv4)
    37.8 -  : m_ipv4 (ipv4)
    37.9 +Ipv4Impl::Ipv4Impl ()
   37.10 +  : m_ipv4 (0)
   37.11  {}
   37.12  Ipv4Impl::~Ipv4Impl ()
   37.13  {
   37.14    NS_ASSERT (m_ipv4 == 0);
   37.15  }
   37.16  void 
   37.17 +Ipv4Impl::SetIpv4 (Ptr<Ipv4L3Protocol> ipv4)
   37.18 +{
   37.19 +  m_ipv4 = ipv4;
   37.20 +}
   37.21 +void 
   37.22  Ipv4Impl::DoDispose (void)
   37.23  {
   37.24    m_ipv4 = 0;
    38.1 --- a/src/internet-node/ipv4-impl.h	Tue Mar 11 11:35:26 2008 -0700
    38.2 +++ b/src/internet-node/ipv4-impl.h	Tue Mar 11 13:30:12 2008 -0700
    38.3 @@ -31,10 +31,12 @@
    38.4  class Ipv4Impl : public Ipv4
    38.5  {
    38.6  public:
    38.7 -  Ipv4Impl (Ptr<Ipv4L3Protocol> ipv4);
    38.8 +  Ipv4Impl ();
    38.9  
   38.10    virtual ~Ipv4Impl ();
   38.11  
   38.12 +  void SetIpv4 (Ptr<Ipv4L3Protocol> ipv4);
   38.13 +
   38.14    virtual void AddRoutingProtocol (Ptr<Ipv4RoutingProtocol> routingProtocol,
   38.15                                     int16_t priority);
   38.16  
    39.1 --- a/src/internet-node/ipv4-interface.cc	Tue Mar 11 11:35:26 2008 -0700
    39.2 +++ b/src/internet-node/ipv4-interface.cc	Tue Mar 11 13:30:12 2008 -0700
    39.3 @@ -35,13 +35,12 @@
    39.4     * becoming useable, the user must invoke SetUp on them
    39.5     * once the final Ipv4 address and mask has been set.
    39.6     */
    39.7 -Ipv4Interface::Ipv4Interface (Ptr<NetDevice> nd) 
    39.8 -  : m_netdevice (nd), 
    39.9 -    m_ifup(false),
   39.10 +Ipv4Interface::Ipv4Interface () 
   39.11 +  : m_ifup(false),
   39.12      m_metric(1)
   39.13  {
   39.14    NS_LOG_FUNCTION;
   39.15 -  NS_LOG_PARAMS (this << &nd);
   39.16 +  NS_LOG_PARAMS (this);
   39.17  }
   39.18  
   39.19  Ipv4Interface::~Ipv4Interface ()
   39.20 @@ -53,17 +52,9 @@
   39.21  Ipv4Interface::DoDispose (void)
   39.22  {
   39.23    NS_LOG_FUNCTION;
   39.24 -  m_netdevice = 0;
   39.25    Object::DoDispose ();
   39.26  }
   39.27  
   39.28 -Ptr<NetDevice>
   39.29 -Ipv4Interface::GetDevice (void) const
   39.30 -{
   39.31 -  NS_LOG_FUNCTION;
   39.32 -  return m_netdevice;
   39.33 -}
   39.34 -
   39.35  void 
   39.36  Ipv4Interface::SetAddress (Ipv4Address a)
   39.37  {
   39.38 @@ -123,12 +114,12 @@
   39.39  Ipv4Interface::GetMtu (void) const
   39.40  {
   39.41    NS_LOG_FUNCTION;
   39.42 -  if (m_netdevice == 0)
   39.43 +  if (GetDevice () == 0)
   39.44      {
   39.45        uint32_t mtu = (1<<16) - 1;
   39.46        return mtu;
   39.47      }
   39.48 -  return m_netdevice->GetMtu ();
   39.49 +  return GetDevice ()->GetMtu ();
   39.50  }
   39.51  
   39.52  /**
    40.1 --- a/src/internet-node/ipv4-interface.h	Tue Mar 11 11:35:26 2008 -0700
    40.2 +++ b/src/internet-node/ipv4-interface.h	Tue Mar 11 13:30:12 2008 -0700
    40.3 @@ -69,14 +69,14 @@
    40.4     *           This value can be zero in which case the MTU
    40.5     *           of this interface will be 2^(16-1).
    40.6     */
    40.7 -  Ipv4Interface (Ptr<NetDevice> nd);
    40.8 +  Ipv4Interface ();
    40.9    virtual ~Ipv4Interface();
   40.10  
   40.11    /**
   40.12     * \returns the underlying NetDevice. This method can return
   40.13     *          zero if this interface has no associated NetDevice.
   40.14     */
   40.15 -  Ptr<NetDevice> GetDevice (void) const;
   40.16 +  virtual Ptr<NetDevice> GetDevice (void) const = 0;
   40.17  
   40.18    /**
   40.19     * \param a set the ipv4 address of this interface.
   40.20 @@ -150,7 +150,6 @@
   40.21    virtual void DoDispose (void);
   40.22  private:
   40.23    virtual void SendTo (Ptr<Packet> p, Ipv4Address dest) = 0;
   40.24 -  Ptr<NetDevice> m_netdevice;
   40.25    bool m_ifup;
   40.26    Ipv4Address m_address;
   40.27    Ipv4Mask m_netmask;
    41.1 --- a/src/internet-node/ipv4-l3-protocol.cc	Tue Mar 11 11:35:26 2008 -0700
    41.2 +++ b/src/internet-node/ipv4-l3-protocol.cc	Tue Mar 11 13:30:12 2008 -0700
    41.3 @@ -56,11 +56,6 @@
    41.4                     Uinteger (64),
    41.5                     MakeUintegerAccessor (&Ipv4L3Protocol::m_defaultTtl),
    41.6                     MakeUintegerChecker<uint8_t> ())
    41.7 -    .AddAttribute ("Node", "The node to which this l3 protocol is attached.",
    41.8 -                   TypeId::ATTR_GET | TypeId::ATTR_CONSTRUCT,
    41.9 -                   Ptr<Node> (0),
   41.10 -                   MakePtrAccessor (&Ipv4L3Protocol::m_node),
   41.11 -                   MakePtrChecker<Node> ())
   41.12      .AddTraceSource ("Tx", "Send ipv4 packet to outgoing interface.",
   41.13                     MakeTraceSourceAccessor (&Ipv4L3Protocol::m_txTrace))
   41.14      .AddTraceSource ("Rx", "Receive ipv4 packet from incoming interface.",
   41.15 @@ -82,7 +77,6 @@
   41.16    NS_LOG_FUNCTION;
   41.17    m_staticRouting = CreateObject<Ipv4StaticRouting> ();
   41.18    AddRoutingProtocol (m_staticRouting, 0);
   41.19 -  SetupLoopback ();
   41.20  }
   41.21  
   41.22  Ipv4L3Protocol::~Ipv4L3Protocol ()
   41.23 @@ -90,6 +84,13 @@
   41.24    NS_LOG_FUNCTION;
   41.25  }
   41.26  
   41.27 +void
   41.28 +Ipv4L3Protocol::SetNode (Ptr<Node> node)
   41.29 +{
   41.30 +  m_node = node;
   41.31 +  SetupLoopback ();
   41.32 +}
   41.33 +
   41.34  void 
   41.35  Ipv4L3Protocol::DoDispose (void)
   41.36  {
   41.37 @@ -106,7 +107,8 @@
   41.38  {
   41.39    NS_LOG_FUNCTION;
   41.40  
   41.41 -  Ptr<Ipv4LoopbackInterface> interface = CreateObject<Ipv4LoopbackInterface> (m_node);
   41.42 +  Ptr<Ipv4LoopbackInterface> interface = CreateObject<Ipv4LoopbackInterface> ();
   41.43 +  interface->SetNode (m_node);
   41.44    interface->SetAddress (Ipv4Address::GetLoopback ());
   41.45    interface->SetNetworkMask (Ipv4Mask::GetLoopback ());
   41.46    uint32_t index = AddIpv4Interface (interface);
   41.47 @@ -328,7 +330,9 @@
   41.48  {
   41.49    NS_LOG_FUNCTION;
   41.50    NS_LOG_PARAMS (this << &device);
   41.51 -  Ptr<Ipv4Interface> interface = CreateObject<ArpIpv4Interface> (m_node, device);
   41.52 +  Ptr<ArpIpv4Interface> interface = CreateObject<ArpIpv4Interface> ();
   41.53 +  interface->SetNode (m_node);
   41.54 +  interface->SetDevice (device);
   41.55    return AddIpv4Interface (interface);
   41.56  }
   41.57  
    42.1 --- a/src/internet-node/ipv4-l3-protocol.h	Tue Mar 11 11:35:26 2008 -0700
    42.2 +++ b/src/internet-node/ipv4-l3-protocol.h	Tue Mar 11 13:30:12 2008 -0700
    42.3 @@ -51,6 +51,8 @@
    42.4    Ipv4L3Protocol();
    42.5    virtual ~Ipv4L3Protocol ();
    42.6  
    42.7 +  void SetNode (Ptr<Node> node);
    42.8 +
    42.9    /**
   42.10     * \param ttl default ttl to use
   42.11     *
    43.1 --- a/src/internet-node/ipv4-l4-demux.cc	Tue Mar 11 11:35:26 2008 -0700
    43.2 +++ b/src/internet-node/ipv4-l4-demux.cc	Tue Mar 11 13:30:12 2008 -0700
    43.3 @@ -37,10 +37,6 @@
    43.4  {
    43.5    static TypeId tid = TypeId ("Ipv4L4Demux")
    43.6      .SetParent<Object> ()
    43.7 -    .AddAttribute ("Node", "The node to which this object is associated.",
    43.8 -                   Ptr<Node> (0),
    43.9 -                   MakePtrAccessor (&Ipv4L4Demux::m_node),
   43.10 -                   MakePtrChecker<Node> ())
   43.11      .AddAttribute ("Protocols", "The set of protocols registered with this demux.",
   43.12                     ObjectVector (),
   43.13                     MakeObjectVectorAccessor (&Ipv4L4Demux::m_protocols),
   43.14 @@ -55,6 +51,12 @@
   43.15  Ipv4L4Demux::~Ipv4L4Demux()
   43.16  {}
   43.17  
   43.18 +void 
   43.19 +Ipv4L4Demux::SetNode (Ptr<Node> node)
   43.20 +{
   43.21 +  m_node = node;
   43.22 +}
   43.23 +
   43.24  void
   43.25  Ipv4L4Demux::DoDispose (void)
   43.26  {
    44.1 --- a/src/internet-node/ipv4-l4-demux.h	Tue Mar 11 11:35:26 2008 -0700
    44.2 +++ b/src/internet-node/ipv4-l4-demux.h	Tue Mar 11 13:30:12 2008 -0700
    44.3 @@ -45,6 +45,8 @@
    44.4    Ipv4L4Demux ();
    44.5    virtual ~Ipv4L4Demux();
    44.6  
    44.7 +  void SetNode (Ptr<Node> node);
    44.8 +
    44.9    /**
   44.10     * \param protocol a template for the protocol to add to this L4 Demux.
   44.11     * \returns the L4Protocol effectively added.
    45.1 --- a/src/internet-node/ipv4-loopback-interface.cc	Tue Mar 11 11:35:26 2008 -0700
    45.2 +++ b/src/internet-node/ipv4-loopback-interface.cc	Tue Mar 11 13:30:12 2008 -0700
    45.3 @@ -32,9 +32,8 @@
    45.4  
    45.5  namespace ns3 {
    45.6  
    45.7 -Ipv4LoopbackInterface::Ipv4LoopbackInterface (Ptr<Node> node)
    45.8 -  : Ipv4Interface (0),
    45.9 -    m_node (node)
   45.10 +Ipv4LoopbackInterface::Ipv4LoopbackInterface ()
   45.11 +  : m_node (0)
   45.12  {
   45.13    NS_LOG_FUNCTION;
   45.14  }
   45.15 @@ -42,6 +41,19 @@
   45.16  Ipv4LoopbackInterface::~Ipv4LoopbackInterface ()
   45.17  {
   45.18    NS_LOG_FUNCTION;
   45.19 +  NS_ASSERT (m_node != 0);
   45.20 +}
   45.21 +
   45.22 +Ptr<NetDevice> 
   45.23 +Ipv4LoopbackInterface::GetDevice (void) const
   45.24 +{
   45.25 +  return 0;
   45.26 +}
   45.27 +
   45.28 +void 
   45.29 +Ipv4LoopbackInterface::SetNode (Ptr<Node> node)
   45.30 +{
   45.31 +  m_node = node;
   45.32  }
   45.33  
   45.34  void 
    46.1 --- a/src/internet-node/ipv4-loopback-interface.h	Tue Mar 11 11:35:26 2008 -0700
    46.2 +++ b/src/internet-node/ipv4-loopback-interface.h	Tue Mar 11 13:30:12 2008 -0700
    46.3 @@ -34,13 +34,13 @@
    46.4  class Ipv4LoopbackInterface : public Ipv4Interface 
    46.5  {
    46.6   public:
    46.7 -  /**
    46.8 -   * \brief Constructor
    46.9 -   * \param node Pointer to a node associated with this IPv4 interface
   46.10 -   */
   46.11 -  Ipv4LoopbackInterface (Ptr<Node> node);
   46.12 +  Ipv4LoopbackInterface ();
   46.13    virtual ~Ipv4LoopbackInterface ();
   46.14  
   46.15 +  virtual Ptr<NetDevice> GetDevice (void) const;
   46.16 +
   46.17 +  void SetNode (Ptr<Node> node);
   46.18 +
   46.19   private:
   46.20    virtual void SendTo (Ptr<Packet> p, Ipv4Address dest);
   46.21  
    47.1 --- a/src/internet-node/tcp-impl.cc	Tue Mar 11 11:35:26 2008 -0700
    47.2 +++ b/src/internet-node/tcp-impl.cc	Tue Mar 11 13:30:12 2008 -0700
    47.3 @@ -24,14 +24,20 @@
    47.4  
    47.5  namespace ns3 {
    47.6  
    47.7 -TcpImpl::TcpImpl (Ptr<TcpL4Protocol> tcp)
    47.8 -  : m_tcp (tcp)
    47.9 +TcpImpl::TcpImpl ()
   47.10 +  : m_tcp (0)
   47.11  {}
   47.12  TcpImpl::~TcpImpl ()
   47.13  {
   47.14    NS_ASSERT (m_tcp == 0);
   47.15  }
   47.16  
   47.17 +void 
   47.18 +TcpImpl::SetTcp (Ptr<TcpL4Protocol> tcp)
   47.19 +{
   47.20 +  m_tcp = tcp;
   47.21 +}
   47.22 +
   47.23  Ptr<Socket>
   47.24  TcpImpl::CreateSocket (void)
   47.25  {
    48.1 --- a/src/internet-node/tcp-impl.h	Tue Mar 11 11:35:26 2008 -0700
    48.2 +++ b/src/internet-node/tcp-impl.h	Tue Mar 11 13:30:12 2008 -0700
    48.3 @@ -42,9 +42,11 @@
    48.4  class TcpImpl : public Tcp
    48.5  {
    48.6  public:
    48.7 -  TcpImpl (Ptr<TcpL4Protocol> tcp);
    48.8 +  TcpImpl ();
    48.9    virtual ~TcpImpl ();
   48.10  
   48.11 +  void SetTcp (Ptr<TcpL4Protocol> tcp);
   48.12 +
   48.13    virtual Ptr<Socket> CreateSocket (void);
   48.14  
   48.15  protected:
    49.1 --- a/src/internet-node/tcp-l4-protocol.cc	Tue Mar 11 11:35:26 2008 -0700
    49.2 +++ b/src/internet-node/tcp-l4-protocol.cc	Tue Mar 11 13:30:12 2008 -0700
    49.3 @@ -350,6 +350,12 @@
    49.4    NS_LOG_FUNCTION;
    49.5  }
    49.6  
    49.7 +void 
    49.8 +TcpL4Protocol::SetNode (Ptr<Node> node)
    49.9 +{
   49.10 +  m_node = node;
   49.11 +}
   49.12 +
   49.13  int 
   49.14  TcpL4Protocol::GetProtocolNumber (void) const
   49.15  {
   49.16 @@ -379,7 +385,10 @@
   49.17  {
   49.18    NS_LOG_FUNCTION;
   49.19    Ptr<RttEstimator> rtt = m_rttFactory.Create<RttEstimator> ();
   49.20 -  Ptr<Socket> socket = CreateObject<TcpSocket> (m_node, this, rtt);
   49.21 +  Ptr<TcpSocket> socket = CreateObject<TcpSocket> ();
   49.22 +  socket->SetNode (m_node);
   49.23 +  socket->SetTcp (this);
   49.24 +  socket->SetRtt (rtt);
   49.25    return socket;
   49.26  }
   49.27  
    50.1 --- a/src/internet-node/tcp-l4-protocol.h	Tue Mar 11 11:35:26 2008 -0700
    50.2 +++ b/src/internet-node/tcp-l4-protocol.h	Tue Mar 11 13:30:12 2008 -0700
    50.3 @@ -53,6 +53,8 @@
    50.4    TcpL4Protocol ();
    50.5    virtual ~TcpL4Protocol ();
    50.6  
    50.7 +  void SetNode (Ptr<Node> node);
    50.8 +
    50.9    virtual int GetProtocolNumber (void) const;
   50.10    virtual int GetVersion (void) const;
   50.11  
    51.1 --- a/src/internet-node/tcp-socket.cc	Tue Mar 11 11:35:26 2008 -0700
    51.2 +++ b/src/internet-node/tcp-socket.cc	Tue Mar 11 13:30:12 2008 -0700
    51.3 @@ -40,12 +40,12 @@
    51.4  
    51.5  namespace ns3 {
    51.6  
    51.7 -  TcpSocket::TcpSocket (Ptr<Node> node, Ptr<TcpL4Protocol> tcp, Ptr<RttEstimator> rtt)
    51.8 +  TcpSocket::TcpSocket ()
    51.9    : m_skipRetxResched (false),
   51.10      m_dupAckCount (0),
   51.11      m_endPoint (0),
   51.12 -    m_node (node),
   51.13 -    m_tcp (tcp),
   51.14 +    m_node (0),
   51.15 +    m_tcp (0),
   51.16      m_errno (ERROR_NOTERROR),
   51.17      m_shutdownSend (false),
   51.18      m_shutdownRecv (false),
   51.19 @@ -61,22 +61,12 @@
   51.20      m_lastRxAck (0),
   51.21      m_nextRxSequence (0),
   51.22      m_pendingData (0),
   51.23 -    m_rtt (rtt),
   51.24 +    m_rtt (0),
   51.25      m_lastMeasuredRtt (Seconds(0.0))
   51.26  {
   51.27    NS_LOG_FUNCTION;
   51.28 -  NS_LOG_PARAMS (this<<node<<tcp);
   51.29 +  NS_LOG_PARAMS (this);
   51.30    
   51.31 -  Ptr<Tcp> t = node->GetObject<Tcp> ();
   51.32 -  m_segmentSize = t->GetDefaultSegSize ();
   51.33 -  m_rxWindowSize = t->GetDefaultAdvWin ();
   51.34 -  m_advertisedWindowSize = t->GetDefaultAdvWin ();
   51.35 -  m_cWnd = t->GetDefaultInitialCwnd () * m_segmentSize;
   51.36 -  m_ssThresh = t->GetDefaultSsThresh ();
   51.37 -  m_initialCWnd = t->GetDefaultInitialCwnd ();
   51.38 -  m_cnTimeout = Seconds (t->GetDefaultConnTimeout ());
   51.39 -  m_cnCount = t->GetDefaultConnCount ();
   51.40 -
   51.41  }
   51.42  
   51.43  TcpSocket::~TcpSocket ()
   51.44 @@ -103,6 +93,33 @@
   51.45    m_pendingData = 0;
   51.46  }
   51.47  
   51.48 +void
   51.49 +TcpSocket::SetNode (Ptr<Node> node)
   51.50 +{
   51.51 +  m_node = node;
   51.52 +  Ptr<Tcp> t = node->GetObject<Tcp> ();
   51.53 +  m_segmentSize = t->GetDefaultSegSize ();
   51.54 +  m_rxWindowSize = t->GetDefaultAdvWin ();
   51.55 +  m_advertisedWindowSize = t->GetDefaultAdvWin ();
   51.56 +  m_cWnd = t->GetDefaultInitialCwnd () * m_segmentSize;
   51.57 +  m_ssThresh = t->GetDefaultSsThresh ();
   51.58 +  m_initialCWnd = t->GetDefaultInitialCwnd ();
   51.59 +  m_cnTimeout = Seconds (t->GetDefaultConnTimeout ());
   51.60 +  m_cnCount = t->GetDefaultConnCount ();
   51.61 +}
   51.62 +
   51.63 +void 
   51.64 +TcpSocket::SetTcp (Ptr<TcpL4Protocol> tcp)
   51.65 +{
   51.66 +  m_tcp = tcp;
   51.67 +}
   51.68 +void 
   51.69 +TcpSocket::SetRtt (Ptr<RttEstimator> rtt)
   51.70 +{
   51.71 +  m_rtt = rtt;
   51.72 +}
   51.73 +
   51.74 +
   51.75  enum Socket::SocketErrno
   51.76  TcpSocket::GetErrno (void) const
   51.77  {
    52.1 --- a/src/internet-node/tcp-socket.h	Tue Mar 11 11:35:26 2008 -0700
    52.2 +++ b/src/internet-node/tcp-socket.h	Tue Mar 11 13:30:12 2008 -0700
    52.3 @@ -45,9 +45,13 @@
    52.4    /**
    52.5     * Create an unbound tcp socket.
    52.6     */
    52.7 -  TcpSocket (Ptr<Node> node, Ptr<TcpL4Protocol> tcp, Ptr<RttEstimator> rtt);
    52.8 +  TcpSocket ();
    52.9    virtual ~TcpSocket ();
   52.10  
   52.11 +  void SetNode (Ptr<Node> node);
   52.12 +  void SetTcp (Ptr<TcpL4Protocol> tcp);
   52.13 +  void SetRtt (Ptr<RttEstimator> rtt);
   52.14 +
   52.15    virtual enum SocketErrno GetErrno (void) const;
   52.16    virtual Ptr<Node> GetNode (void) const;
   52.17    virtual int Bind (void);
    53.1 --- a/src/internet-node/udp-impl.cc	Tue Mar 11 11:35:26 2008 -0700
    53.2 +++ b/src/internet-node/udp-impl.cc	Tue Mar 11 13:30:12 2008 -0700
    53.3 @@ -25,14 +25,20 @@
    53.4  
    53.5  namespace ns3 {
    53.6  
    53.7 -UdpImpl::UdpImpl (Ptr<UdpL4Protocol> udp)
    53.8 -  : m_udp (udp)
    53.9 +UdpImpl::UdpImpl ()
   53.10 +  : m_udp (0)
   53.11  {}
   53.12  UdpImpl::~UdpImpl ()
   53.13  {
   53.14    NS_ASSERT (m_udp == 0);
   53.15  }
   53.16  
   53.17 +void 
   53.18 +UdpImpl::SetUdp (Ptr<UdpL4Protocol> udp)
   53.19 +{
   53.20 +  m_udp = udp;
   53.21 +}
   53.22 +
   53.23  Ptr<Socket>
   53.24  UdpImpl::CreateSocket (void)
   53.25  {
    54.1 --- a/src/internet-node/udp-impl.h	Tue Mar 11 11:35:26 2008 -0700
    54.2 +++ b/src/internet-node/udp-impl.h	Tue Mar 11 13:30:12 2008 -0700
    54.3 @@ -40,9 +40,11 @@
    54.4  class UdpImpl : public Udp
    54.5  {
    54.6  public:
    54.7 -  UdpImpl (Ptr<UdpL4Protocol> udp);
    54.8 +  UdpImpl ();
    54.9    virtual ~UdpImpl ();
   54.10  
   54.11 +  void SetUdp (Ptr<UdpL4Protocol> udp);
   54.12 +
   54.13    /**
   54.14     * \brief Implements a method to create a UdpImpl-based socket and return
   54.15     * a base class smart pointer to the socket.
    55.1 --- a/src/internet-node/udp-l4-protocol.cc	Tue Mar 11 11:35:26 2008 -0700
    55.2 +++ b/src/internet-node/udp-l4-protocol.cc	Tue Mar 11 13:30:12 2008 -0700
    55.3 @@ -66,6 +66,12 @@
    55.4    NS_LOG_FUNCTION;
    55.5  }
    55.6  
    55.7 +void 
    55.8 +UdpL4Protocol::SetNode (Ptr<Node> node)
    55.9 +{
   55.10 +  m_node = node;
   55.11 +}
   55.12 +
   55.13  int 
   55.14  UdpL4Protocol::GetProtocolNumber (void) const
   55.15  {
   55.16 @@ -95,7 +101,9 @@
   55.17  UdpL4Protocol::CreateSocket (void)
   55.18  {
   55.19    NS_LOG_FUNCTION;
   55.20 -  Ptr<Socket> socket = CreateObject<UdpSocket> (m_node, this);
   55.21 +  Ptr<UdpSocket> socket = CreateObject<UdpSocket> ();
   55.22 +  socket->SetNode (m_node);
   55.23 +  socket->SetUdp (this);
   55.24    return socket;
   55.25  }
   55.26  
    56.1 --- a/src/internet-node/udp-l4-protocol.h	Tue Mar 11 11:35:26 2008 -0700
    56.2 +++ b/src/internet-node/udp-l4-protocol.h	Tue Mar 11 13:30:12 2008 -0700
    56.3 @@ -49,6 +49,8 @@
    56.4    UdpL4Protocol ();
    56.5    virtual ~UdpL4Protocol ();
    56.6  
    56.7 +  void SetNode (Ptr<Node> node);
    56.8 +
    56.9    virtual int GetProtocolNumber (void) const;
   56.10    virtual int GetVersion (void) const;
   56.11  
    57.1 --- a/src/internet-node/udp-socket.cc	Tue Mar 11 11:35:26 2008 -0700
    57.2 +++ b/src/internet-node/udp-socket.cc	Tue Mar 11 13:30:12 2008 -0700
    57.3 @@ -34,10 +34,10 @@
    57.4  
    57.5  namespace ns3 {
    57.6  
    57.7 -UdpSocket::UdpSocket (Ptr<Node> node, Ptr<UdpL4Protocol> udp)
    57.8 +UdpSocket::UdpSocket ()
    57.9    : m_endPoint (0),
   57.10 -    m_node (node),
   57.11 -    m_udp (udp),
   57.12 +    m_node (0),
   57.13 +    m_udp (0),
   57.14      m_errno (ERROR_NOTERROR),
   57.15      m_shutdownSend (false),
   57.16      m_shutdownRecv (false),
   57.17 @@ -69,6 +69,18 @@
   57.18    m_udp = 0;
   57.19  }
   57.20  
   57.21 +void 
   57.22 +UdpSocket::SetNode (Ptr<Node> node)
   57.23 +{
   57.24 +  m_node = node;
   57.25 +}
   57.26 +void 
   57.27 +UdpSocket::SetUdp (Ptr<UdpL4Protocol> udp)
   57.28 +{
   57.29 +  m_udp = udp;
   57.30 +}
   57.31 +
   57.32 +
   57.33  enum Socket::SocketErrno
   57.34  UdpSocket::GetErrno (void) const
   57.35  {
   57.36 @@ -400,7 +412,7 @@
   57.37    Ptr<Node> rxNode = CreateObject<InternetNode> ();
   57.38    Ptr<PointToPointNetDevice> rxDev1, rxDev2;
   57.39    { // first interface
   57.40 -    rxDev1 = CreateObjectWith<PointToPointNetDevice> ("Node", rxNode, "Address", Mac48Address::Allocate ());
   57.41 +    rxDev1 = CreateObject<PointToPointNetDevice> ("Node", rxNode, "Address", Mac48Address::Allocate ());
   57.42      rxNode->AddDevice (rxDev1);
   57.43      rxDev1->AddQueue(CreateObject<DropTailQueue> ());
   57.44      Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
   57.45 @@ -411,7 +423,7 @@
   57.46    }
   57.47  
   57.48    { // second interface
   57.49 -    rxDev2 = CreateObjectWith<PointToPointNetDevice> ("Node", rxNode, "Address", Mac48Address::Allocate ());
   57.50 +    rxDev2 = CreateObject<PointToPointNetDevice> ("Node", rxNode, "Address", Mac48Address::Allocate ());
   57.51      rxNode->AddDevice (rxDev2);
   57.52      rxDev2->AddQueue(CreateObject<DropTailQueue> ());
   57.53      Ptr<Ipv4> ipv4 = rxNode->GetObject<Ipv4> ();
   57.54 @@ -425,7 +437,7 @@
   57.55    Ptr<Node> txNode = CreateObject<InternetNode> ();
   57.56    Ptr<PointToPointNetDevice> txDev;
   57.57    {
   57.58 -    txDev = CreateObjectWith<PointToPointNetDevice> ("Node", txNode, "Address", Mac48Address::Allocate ());
   57.59 +    txDev = CreateObject<PointToPointNetDevice> ("Node", txNode, "Address", Mac48Address::Allocate ());
   57.60      txNode->AddDevice (txDev);
   57.61      txDev->AddQueue(CreateObject<DropTailQueue> ());
   57.62      Ptr<Ipv4> ipv4 = txNode->GetObject<Ipv4> ();
    58.1 --- a/src/internet-node/udp-socket.h	Tue Mar 11 11:35:26 2008 -0700
    58.2 +++ b/src/internet-node/udp-socket.h	Tue Mar 11 13:30:12 2008 -0700
    58.3 @@ -40,9 +40,12 @@
    58.4    /**
    58.5     * Create an unbound udp socket.
    58.6     */
    58.7 -  UdpSocket (Ptr<Node> node, Ptr<UdpL4Protocol> udp);
    58.8 +  UdpSocket ();
    58.9    virtual ~UdpSocket ();
   58.10  
   58.11 +  void SetNode (Ptr<Node> node);
   58.12 +  void SetUdp (Ptr<UdpL4Protocol> udp);
   58.13 +
   58.14    virtual enum SocketErrno GetErrno (void) const;
   58.15    virtual Ptr<Node> GetNode (void) const;
   58.16    virtual int Bind (void);
    59.1 --- a/src/mobility/mobility-helper.cc	Tue Mar 11 11:35:26 2008 -0700
    59.2 +++ b/src/mobility/mobility-helper.cc	Tue Mar 11 13:30:12 2008 -0700
    59.3 @@ -12,7 +12,7 @@
    59.4  MobilityHelper::MobilityHelper ()
    59.5    : m_notifierEnabled (false)
    59.6  {
    59.7 -  m_position = CreateObjectWith<RandomRectanglePositionAllocator> ("X", ConstantVariable (0.0),
    59.8 +  m_position = CreateObject<RandomRectanglePositionAllocator> ("X", ConstantVariable (0.0),
    59.9  								   "Y", ConstantVariable (0.0));
   59.10    m_mobility.SetTypeId ("StaticMobilityModel");
   59.11  }
   59.12 @@ -125,7 +125,7 @@
   59.13  	      // we need to setup a hierarchical mobility model
   59.14  	      Ptr<MobilityModel> parent = m_mobilityStack.back ();
   59.15  	      Ptr<MobilityModel> hierarchical = 
   59.16 -		CreateObjectWith<HierarchicalMobilityModel> ("Child", model,
   59.17 +		CreateObject<HierarchicalMobilityModel> ("Child", model,
   59.18  							     "Parent", parent);
   59.19  	      object->AggregateObject (hierarchical);
   59.20  	      NS_LOG_DEBUG ("node="<<object<<", mob="<<hierarchical);
    60.1 --- a/src/node/packet-socket-factory.cc	Tue Mar 11 11:35:26 2008 -0700
    60.2 +++ b/src/node/packet-socket-factory.cc	Tue Mar 11 13:30:12 2008 -0700
    60.3 @@ -40,7 +40,8 @@
    60.4  Ptr<Socket> PacketSocketFactory::CreateSocket (void)
    60.5  {
    60.6    Ptr<Node> node = GetObject<Node> ();
    60.7 -  Ptr<PacketSocket> socket = CreateObject<PacketSocket> (node);
    60.8 +  Ptr<PacketSocket> socket = CreateObject<PacketSocket> ();
    60.9 +  socket->SetNode (node);
   60.10    return socket;
   60.11  } 
   60.12  } // namespace ns3
    61.1 --- a/src/node/packet-socket.cc	Tue Mar 11 11:35:26 2008 -0700
    61.2 +++ b/src/node/packet-socket.cc	Tue Mar 11 13:30:12 2008 -0700
    61.3 @@ -29,16 +29,9 @@
    61.4  
    61.5  namespace ns3 {
    61.6  
    61.7 -PacketSocket::PacketSocket (Ptr<Node> node)
    61.8 -  : m_node (node)
    61.9 +PacketSocket::PacketSocket ()
   61.10  {
   61.11    NS_LOG_FUNCTION;
   61.12 -  Init();
   61.13 -}
   61.14 -
   61.15 -void 
   61.16 -PacketSocket::Init()
   61.17 -{
   61.18    NS_LOG_FUNCTION;
   61.19    m_state = STATE_OPEN;
   61.20    m_shutdownSend = false;
   61.21 @@ -46,6 +39,12 @@
   61.22    m_errno = ERROR_NOTERROR;
   61.23  }
   61.24  
   61.25 +void 
   61.26 +PacketSocket::SetNode (Ptr<Node> node)
   61.27 +{
   61.28 +  m_node = node;
   61.29 +}
   61.30 +
   61.31  PacketSocket::~PacketSocket ()
   61.32  {
   61.33    NS_LOG_FUNCTION;
    62.1 --- a/src/node/packet-socket.h	Tue Mar 11 11:35:26 2008 -0700
    62.2 +++ b/src/node/packet-socket.h	Tue Mar 11 13:30:12 2008 -0700
    62.3 @@ -71,9 +71,11 @@
    62.4  class PacketSocket : public Socket
    62.5  {
    62.6  public:
    62.7 -  PacketSocket (Ptr<Node> node);
    62.8 +  PacketSocket ();
    62.9    virtual ~PacketSocket ();
   62.10  
   62.11 +  void SetNode (Ptr<Node> node);
   62.12 +
   62.13    virtual enum SocketErrno GetErrno (void) const;
   62.14    virtual Ptr<Node> GetNode (void) const;
   62.15    virtual int Bind (void);
   62.16 @@ -87,9 +89,6 @@
   62.17  
   62.18  
   62.19  private:
   62.20 -
   62.21 -private:
   62.22 -  void Init (void);
   62.23    void ForwardUp (Ptr<NetDevice> device, Ptr<Packet> packet, 
   62.24                    uint16_t protocol, const Address &from);
   62.25    int DoBind (const PacketSocketAddress &address);
    63.1 --- a/src/routing/olsr/olsr-agent-impl.cc	Tue Mar 11 11:35:26 2008 -0700
    63.2 +++ b/src/routing/olsr/olsr-agent-impl.cc	Tue Mar 11 13:30:12 2008 -0700
    63.3 @@ -250,7 +250,9 @@
    63.4  
    63.5    NS_LOG_DEBUG ("Starting OLSR on node " << m_mainAddress);
    63.6  
    63.7 -  m_routingTable = CreateObject<RoutingTable> (m_ipv4, m_mainAddress);
    63.8 +  m_routingTable = CreateObject<RoutingTable> ();
    63.9 +  m_routingTable->SetIpv4 (m_ipv4);
   63.10 +  m_routingTable->SetMainAddress (m_mainAddress);
   63.11    // Add OLSR as routing protocol, with slightly higher priority than
   63.12    // static routing.
   63.13    m_ipv4->AddRoutingProtocol (m_routingTable, 10);
    64.1 --- a/src/routing/olsr/routing-table.h	Tue Mar 11 11:35:26 2008 -0700
    64.2 +++ b/src/routing/olsr/routing-table.h	Tue Mar 11 13:30:12 2008 -0700
    64.3 @@ -74,11 +74,9 @@
    64.4  public:
    64.5  	
    64.6    RoutingTable () {}
    64.7 -  RoutingTable (Ptr<Ipv4> ipv4, const Ipv4Address &mainAddress)
    64.8 -    :
    64.9 -    m_ipv4 (ipv4),
   64.10 -    m_mainAddress (mainAddress)
   64.11 -  {}
   64.12 +
   64.13 +  void SetIpv4 (Ptr<Ipv4> ipv4) {m_ipv4 = ipv4;}
   64.14 +  void SetMainAddress (Ipv4Address mainAddress) {m_mainAddress = mainAddress;}
   64.15  
   64.16    ~RoutingTable () {}
   64.17  
    65.1 --- a/tutorial/point-to-point-ipv4-topology.cc	Tue Mar 11 11:35:26 2008 -0700
    65.2 +++ b/tutorial/point-to-point-ipv4-topology.cc	Tue Mar 11 13:30:12 2008 -0700
    65.3 @@ -34,7 +34,7 @@
    65.4    const DataRate& bps,
    65.5    const Time& delay)
    65.6  {
    65.7 -  return CreateObject<PointToPointChannel> (bps, delay);
    65.8 +  return CreateObject<PointToPointChannel> ("BitRate", bps, "Delay", delay);
    65.9  }
   65.10  
   65.11    uint32_t
   65.12 @@ -45,7 +45,7 @@
   65.13    NS_ASSERT (channel->GetNDevices () <= 1);
   65.14  
   65.15    Ptr<PointToPointNetDevice> nd = 
   65.16 -    CreateObjectWith<PointToPointNetDevice> ("Node", node, 
   65.17 +    CreateObject<PointToPointNetDevice> ("Node", node, 
   65.18                                               "Address", Mac48Address::Allocate ());
   65.19    node->AddDevice (nd);
   65.20    Ptr<Queue> q = CreateObject<DropTailQueue> ();
    66.1 --- a/tutorial/tutorial-bus-network.cc	Tue Mar 11 11:35:26 2008 -0700
    66.2 +++ b/tutorial/tutorial-bus-network.cc	Tue Mar 11 13:30:12 2008 -0700
    66.3 @@ -44,7 +44,7 @@
    66.4  
    66.5    Ptr<Node> n0 = bus.GetNode (0);
    66.6    Ptr<UdpEchoClient> client =  
    66.7 -    CreateObjectWith<UdpEchoClient> ("Node", n0, 
    66.8 +    CreateObject<UdpEchoClient> ("Node", n0, 
    66.9  				     "RemoteIpv4", Ipv4Address ("10.1.0.1"),
   66.10  				     "RemotePort", Uinteger (port),
   66.11  				     "MaxPackets", Uinteger (1), 
   66.12 @@ -54,7 +54,7 @@
   66.13  
   66.14    Ptr<Node> n1 = bus.GetNode (1);
   66.15    Ptr<UdpEchoServer> server = 
   66.16 -    CreateObjectWith<UdpEchoServer> ("Node", n1, "Port", Uinteger (port));
   66.17 +    CreateObject<UdpEchoServer> ("Node", n1, "Port", Uinteger (port));
   66.18    n1->AddApplication (server);
   66.19  
   66.20    server->Start(Seconds(1.));
    67.1 --- a/tutorial/tutorial-csma-echo-ascii-trace.cc	Tue Mar 11 11:35:26 2008 -0700
    67.2 +++ b/tutorial/tutorial-csma-echo-ascii-trace.cc	Tue Mar 11 13:30:12 2008 -0700
    67.3 @@ -69,7 +69,7 @@
    67.4    uint16_t port = 7;
    67.5  
    67.6    Ptr<UdpEchoClient> client = 
    67.7 -    CreateObjectWith<UdpEchoClient> ("Node", n0, 
    67.8 +    CreateObject<UdpEchoClient> ("Node", n0, 
    67.9                                       "RemoteIpv4", Ipv4Address ("10.1.1.2"),
   67.10                                       "RemotePort", Uinteger (port), 
   67.11                                       "MaxPackets", Uinteger (1), 
   67.12 @@ -78,7 +78,7 @@
   67.13    n0->AddApplication (client);
   67.14  
   67.15    Ptr<UdpEchoServer> server = 
   67.16 -    CreateObjectWith<UdpEchoServer> ("Node", n1, 
   67.17 +    CreateObject<UdpEchoServer> ("Node", n1, 
   67.18                                       "Port", Uinteger (port));
   67.19    n1->AddApplication (server);
   67.20  
    68.1 --- a/tutorial/tutorial-csma-echo-pcap-trace.cc	Tue Mar 11 11:35:26 2008 -0700
    68.2 +++ b/tutorial/tutorial-csma-echo-pcap-trace.cc	Tue Mar 11 13:30:12 2008 -0700
    68.3 @@ -70,7 +70,7 @@
    68.4    uint16_t port = 7;
    68.5  
    68.6    Ptr<UdpEchoClient> client = 
    68.7 -    CreateObjectWith<UdpEchoClient> ("Node", n0, 
    68.8 +    CreateObject<UdpEchoClient> ("Node", n0, 
    68.9                                       "RemoteIpv4", Ipv4Address ("10.1.1.2"),
   68.10                                       "RemotePort", Uinteger (port), 
   68.11                                       "MaxPackets", Uinteger (1), 
   68.12 @@ -79,7 +79,7 @@
   68.13    n0->AddApplication (client);
   68.14  
   68.15    Ptr<UdpEchoServer> server = 
   68.16 -    CreateObjectWith<UdpEchoServer> ("Node", n1, 
   68.17 +    CreateObject<UdpEchoServer> ("Node", n1, 
   68.18                                       "Port", Uinteger (port));
   68.19    n1->AddApplication (server);
   68.20  
    69.1 --- a/tutorial/tutorial-csma-echo.cc	Tue Mar 11 11:35:26 2008 -0700
    69.2 +++ b/tutorial/tutorial-csma-echo.cc	Tue Mar 11 13:30:12 2008 -0700
    69.3 @@ -68,7 +68,7 @@
    69.4    uint16_t port = 7;
    69.5  
    69.6    Ptr<UdpEchoClient> client = 
    69.7 -    CreateObjectWith<UdpEchoClient> ("Node", n0, 
    69.8 +    CreateObject<UdpEchoClient> ("Node", n0, 
    69.9                                       "RemoteIpv4", Ipv4Address ("10.1.1.2"),
   69.10                                       "RemotePort", Uinteger (port), 
   69.11                                       "MaxPackets", Uinteger (1), 
   69.12 @@ -77,7 +77,7 @@
   69.13    n0->AddApplication (client);
   69.14  
   69.15    Ptr<UdpEchoServer> server = 
   69.16 -    CreateObjectWith<UdpEchoServer> ("Node", n1, 
   69.17 +    CreateObject<UdpEchoServer> ("Node", n1, 
   69.18                                       "Port", Uinteger (port));
   69.19    n1->AddApplication (server);
   69.20  
    70.1 --- a/tutorial/tutorial-linear-dumbbell.cc	Tue Mar 11 11:35:26 2008 -0700
    70.2 +++ b/tutorial/tutorial-linear-dumbbell.cc	Tue Mar 11 13:30:12 2008 -0700
    70.3 @@ -127,7 +127,7 @@
    70.4    uint16_t port = 7;
    70.5  
    70.6    Ptr<UdpEchoClient> client0 = 
    70.7 -    CreateObjectWith<UdpEchoClient> (
    70.8 +    CreateObject<UdpEchoClient> (
    70.9                                       "Node", n0, 
   70.10                                       "RemoteIpv4", Ipv4Address ("10.1.2.1"),
   70.11                                       "RemotePort", Uinteger (port),
   70.12 @@ -136,7 +136,7 @@
   70.13                                       "PacketSize", Uinteger (1024));
   70.14    n0->AddApplication (client0);
   70.15    Ptr<UdpEchoClient> client1 = 
   70.16 -    CreateObjectWith<UdpEchoClient> (
   70.17 +    CreateObject<UdpEchoClient> (
   70.18                                       "Node", n1, 
   70.19                                       "RemoteIpv4", Ipv4Address ("10.1.2.2"),
   70.20                                       "RemotePort", Uinteger (port),
   70.21 @@ -145,7 +145,7 @@
   70.22                                       "PacketSize", Uinteger (1024));
   70.23    n1->AddApplication (client1);
   70.24    Ptr<UdpEchoClient> client2 = 
   70.25 -    CreateObjectWith<UdpEchoClient> (
   70.26 +    CreateObject<UdpEchoClient> (
   70.27                                       "Node", n2, 
   70.28                                       "RemoteIpv4", Ipv4Address ("10.1.2.3"),
   70.29                                       "RemotePort", Uinteger (port),
   70.30 @@ -154,7 +154,7 @@
   70.31                                       "PacketSize", Uinteger (1024));
   70.32    n2->AddApplication (client2);
   70.33    Ptr<UdpEchoClient> client3 = 
   70.34 -    CreateObjectWith<UdpEchoClient> (
   70.35 +    CreateObject<UdpEchoClient> (
   70.36                                       "Node", n3, 
   70.37                                       "RemoteIpv4", Ipv4Address ("10.1.2.4"),
   70.38                                       "RemotePort", Uinteger (port),
   70.39 @@ -164,16 +164,16 @@
   70.40    n3->AddApplication (client3);
   70.41  
   70.42    Ptr<UdpEchoServer> server4 = 
   70.43 -    CreateObjectWith<UdpEchoServer> ("Node", n4, "Port", Uinteger (port));
   70.44 +    CreateObject<UdpEchoServer> ("Node", n4, "Port", Uinteger (port));
   70.45    n4->AddApplication (server4);
   70.46    Ptr<UdpEchoServer> server5 = 
   70.47 -    CreateObjectWith<UdpEchoServer> ("Node", n5, "Port", Uinteger (port));
   70.48 +    CreateObject<UdpEchoServer> ("Node", n5, "Port", Uinteger (port));
   70.49    n5->AddApplication (server5);
   70.50    Ptr<UdpEchoServer> server6 = 
   70.51 -    CreateObjectWith<UdpEchoServer> ("Node", n6, "Port", Uinteger (port));
   70.52 +    CreateObject<UdpEchoServer> ("Node", n6, "Port", Uinteger (port));
   70.53    n6->AddApplication (server6);
   70.54    Ptr<UdpEchoServer> server7 = 
   70.55 -    CreateObjectWith<UdpEchoServer> ("Node", n7, "Port", Uinteger (port));
   70.56 +    CreateObject<UdpEchoServer> ("Node", n7, "Port", Uinteger (port));
   70.57    n7->AddApplication (server7);
   70.58  
   70.59    server4->Start(Seconds(1.));
    71.1 --- a/tutorial/tutorial-point-to-point.cc	Tue Mar 11 11:35:26 2008 -0700
    71.2 +++ b/tutorial/tutorial-point-to-point.cc	Tue Mar 11 13:30:12 2008 -0700
    71.3 @@ -61,7 +61,7 @@
    71.4    uint16_t port = 7;
    71.5  
    71.6    Ptr<UdpEchoClient> client = 
    71.7 -    CreateObjectWith<UdpEchoClient> ("Node", n0, 
    71.8 +    CreateObject<UdpEchoClient> ("Node", n0, 
    71.9                                       "RemoteIpv4", Ipv4Address ("10.1.1.2"), 
   71.10                                       "RemotePort", Uinteger (port), 
   71.11                                       "MaxPackets", Uinteger (1), 
   71.12 @@ -70,7 +70,7 @@
   71.13    n0->AddApplication (client);
   71.14  
   71.15    Ptr<UdpEchoServer> server = 
   71.16 -    CreateObjectWith<UdpEchoServer> ("Node", n1, 
   71.17 +    CreateObject<UdpEchoServer> ("Node", n1, 
   71.18                                       "Port", Uinteger (port));
   71.19    n1->AddApplication (server);
   71.20  
    72.1 --- a/tutorial/tutorial-star-routing.cc	Tue Mar 11 11:35:26 2008 -0700
    72.2 +++ b/tutorial/tutorial-star-routing.cc	Tue Mar 11 13:30:12 2008 -0700
    72.3 @@ -148,7 +148,7 @@
    72.4    uint16_t port = 7;
    72.5  
    72.6    Ptr<UdpEchoClient> client = 
    72.7 -    CreateObjectWith<UdpEchoClient> ("Node", n4, 
    72.8 +    CreateObject<UdpEchoClient> ("Node", n4, 
    72.9                                       "RemoteIpv4", Ipv4Address ("10.1.1.2"),
   72.10                                       "RemotePort", Uinteger (port), 
   72.11                                       "MaxPackets", Uinteger (1), 
   72.12 @@ -157,7 +157,7 @@
   72.13    n0->AddApplication (client);
   72.14  
   72.15    Ptr<UdpEchoServer> server = 
   72.16 -    CreateObjectWith<UdpEchoServer> ("Node", n1, 
   72.17 +    CreateObject<UdpEchoServer> ("Node", n1, 
   72.18                                       "Port", Uinteger (port));
   72.19    n1->AddApplication (server);
   72.20  
    73.1 --- a/tutorial/tutorial-star.cc	Tue Mar 11 11:35:26 2008 -0700
    73.2 +++ b/tutorial/tutorial-star.cc	Tue Mar 11 13:30:12 2008 -0700
    73.3 @@ -148,7 +148,7 @@
    73.4    uint16_t port = 7;
    73.5  
    73.6    Ptr<UdpEchoClient> client = 
    73.7 -    CreateObjectWith<UdpEchoClient> ("Node", n0, 
    73.8 +    CreateObject<UdpEchoClient> ("Node", n0, 
    73.9                                       "RemoteIpv4", Ipv4Address ("10.1.1.2"),
   73.10                                       "RemotePort", Uinteger (port), 
   73.11                                       "MaxPackets", Uinteger (1), 
   73.12 @@ -157,7 +157,7 @@
   73.13    n0->AddApplication (client);
   73.14  
   73.15    Ptr<UdpEchoServer> server = 
   73.16 -    CreateObjectWith<UdpEchoServer> ("Node", n1, 
   73.17 +    CreateObject<UdpEchoServer> ("Node", n1, 
   73.18                                       "Port", Uinteger (port));
   73.19    n1->AddApplication (server);
   73.20  
    74.1 --- a/utils/print-introspected-doxygen.cc	Tue Mar 11 11:35:26 2008 -0700
    74.2 +++ b/utils/print-introspected-doxygen.cc	Tue Mar 11 13:30:12 2008 -0700
    74.3 @@ -17,11 +17,11 @@
    74.4    Ptr<Node> node = CreateObject<InternetNode> ();
    74.5    node->AggregateObject (CreateObject<MobilityModelNotifier> ());
    74.6  
    74.7 -  Ptr<PointToPointNetDevice> p2p = CreateObjectWith<PointToPointNetDevice> ("Node", node, 
    74.8 +  Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> ("Node", node, 
    74.9  									    "Address", Mac48Address::Allocate ());
   74.10    node->AddDevice (p2p);
   74.11    p2p->AddQueue (CreateObject<DropTailQueue> ());
   74.12 -  Ptr<CsmaNetDevice> csma = CreateObjectWith<CsmaNetDevice> ("Node", node, 
   74.13 +  Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> ("Node", node, 
   74.14  							     "Address", Mac48Address::Allocate (),
   74.15  							     "EncapsulationMode", String ("Llc"));
   74.16    node->AddDevice (csma);