add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 02 Jan 2008 09:09:24 +0100
changeset 22309f13ac3291e0
parent 2205 57710f066013
child 2231 a5b898c1ee2c
add CreateObject<> to instanciate subclasses of the Object base class. Replaces Create<>.
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/udp-echo.cc
samples/main-adhoc-wifi.cc
samples/main-ap-wifi.cc
samples/main-component-manager.cc
samples/main-grid-topology.cc
samples/main-object.cc
samples/main-propagation-loss.cc
samples/main-ptr.cc
samples/main-query-interface.cc
samples/main-random-topology.cc
samples/main-random-walk.cc
samples/main-simple.cc
src/common/error-model.cc
src/common/error-model.h
src/core/array-trace-resolver.cc
src/core/component-manager.cc
src/core/component-manager.h
src/core/object.cc
src/core/object.h
src/core/ptr.cc
src/devices/csma/csma-ipv4-topology.cc
src/devices/csma/csma-topology.cc
src/devices/point-to-point/point-to-point-topology.cc
src/devices/wifi/propagation-delay-model.cc
src/devices/wifi/propagation-loss-model.cc
src/devices/wifi/wifi-net-device.cc
src/internet-node/arp-l3-protocol.cc
src/internet-node/internet-node.cc
src/internet-node/ipv4-l3-protocol.cc
src/internet-node/ipv4-l4-demux.cc
src/internet-node/udp-l4-protocol.cc
src/internet-node/udp-socket.cc
src/mobility/hierarchical-mobility-model.cc
src/mobility/mobility-model-notifier.cc
src/mobility/mobility-model.cc
src/mobility/ns2-mobility-file-topology.cc
src/mobility/random-direction-2d-mobility-model.cc
src/mobility/random-position.cc
src/mobility/random-walk-2d-mobility-model.cc
src/mobility/random-waypoint-mobility-model.cc
src/mobility/static-mobility-model.cc
src/mobility/static-speed-mobility-model.cc
src/node/channel.cc
src/node/ipv4.cc
src/node/net-device.cc
src/node/node.cc
src/node/packet-socket-factory.cc
src/node/queue.cc
src/node/socket-factory.cc
src/node/udp.cc
src/routing/global-routing/global-route-manager-impl.cc
src/routing/global-routing/global-router-interface.cc
src/routing/olsr/olsr-agent-impl.cc
tutorial/ipv4-bus-network.cc
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/bench-object.cc
utils/mobility-generator.cc
utils/mobility-visualizer-model.cc
utils/print-introspected-doxygen.cc
     1.1 --- a/examples/csma-broadcast.cc	Sun Dec 30 19:36:44 2007 -0800
     1.2 +++ b/examples/csma-broadcast.cc	Wed Jan 02 09:09:24 2008 +0100
     1.3 @@ -107,9 +107,9 @@
     1.4    // Here, we will explicitly create four nodes.  In more sophisticated
     1.5    // topologies, we could configure a node factory.
     1.6    NS_LOG_INFO ("Create nodes.");
     1.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     1.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     1.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    1.10 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    1.11 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    1.12 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    1.13  
    1.14    // We create the channels first without any IP addressing information
    1.15    NS_LOG_INFO ("Create channels.");
    1.16 @@ -154,7 +154,7 @@
    1.17    // Create the OnOff application to send UDP datagrams of size
    1.18    // 512 bytes (default) at a rate of 500 Kb/s (default) from n0
    1.19    NS_LOG_INFO ("Create Applications.");
    1.20 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    1.21 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    1.22      n0, 
    1.23      InetSocketAddress ("255.255.255.255", port), 
    1.24      "Udp",
    1.25 @@ -165,7 +165,7 @@
    1.26    ooff->Stop (Seconds(10.0));
    1.27    
    1.28    // Create an optional packet sink to receive these packets
    1.29 -  Ptr<PacketSink> sink = Create<PacketSink> (
    1.30 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
    1.31      n1,
    1.32      InetSocketAddress (Ipv4Address::GetAny (), port),
    1.33      "Udp");
    1.34 @@ -174,7 +174,7 @@
    1.35    sink->Stop (Seconds (10.0));
    1.36  
    1.37    // Create an optional packet sink to receive these packets
    1.38 -  sink = Create<PacketSink> (
    1.39 +  sink = CreateObject<PacketSink> (
    1.40      n2,
    1.41      InetSocketAddress (Ipv4Address::GetAny (), port),
    1.42      "Udp");
     2.1 --- a/examples/csma-multicast.cc	Sun Dec 30 19:36:44 2007 -0800
     2.2 +++ b/examples/csma-multicast.cc	Wed Jan 02 09:09:24 2008 +0100
     2.3 @@ -106,11 +106,11 @@
     2.4  // Explicitly create the nodes required by the topology (shown above).
     2.5  //
     2.6    NS_LOG_INFO ("Create nodes.");
     2.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     2.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     2.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    2.10 -  Ptr<Node> n3 = Create<InternetNode> ();
    2.11 -  Ptr<Node> n4 = Create<InternetNode> ();
    2.12 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    2.13 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    2.14 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    2.15 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
    2.16 +  Ptr<Node> n4 = CreateObject<InternetNode> ();
    2.17  
    2.18    NS_LOG_INFO ("Create channels.");
    2.19  //
    2.20 @@ -281,7 +281,7 @@
    2.21  
    2.22    // Configure a multicast packet generator that generates a packet
    2.23    // every few seconds
    2.24 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    2.25 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    2.26      n0, 
    2.27      InetSocketAddress (multicastGroup, port), 
    2.28      "Udp",
    2.29 @@ -298,7 +298,7 @@
    2.30    // Create an optional packet sink to receive these packets
    2.31    // If you enable logging on this (above) it will print a log statement
    2.32    // for every packet received
    2.33 -  Ptr<PacketSink> sink = Create<PacketSink> (
    2.34 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
    2.35      n4,
    2.36      InetSocketAddress (Ipv4Address::GetAny (), port),
    2.37      "Udp");
     3.1 --- a/examples/csma-one-subnet.cc	Sun Dec 30 19:36:44 2007 -0800
     3.2 +++ b/examples/csma-one-subnet.cc	Wed Jan 02 09:09:24 2008 +0100
     3.3 @@ -100,10 +100,10 @@
     3.4  // Explicitly create the nodes required by the topology (shown above).
     3.5  //
     3.6    NS_LOG_INFO ("Create nodes.");
     3.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     3.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     3.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    3.10 -  Ptr<Node> n3 = Create<InternetNode> ();
    3.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    3.12 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    3.13 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    3.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
    3.15  
    3.16    NS_LOG_INFO ("Create channels.");
    3.17  //
    3.18 @@ -165,7 +165,7 @@
    3.19  //
    3.20    NS_LOG_INFO ("Create Applications.");
    3.21    uint16_t port = 9;   // Discard port (RFC 863)
    3.22 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    3.23 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    3.24      n0, 
    3.25      InetSocketAddress ("10.1.1.2", port), 
    3.26      "Udp",
    3.27 @@ -179,7 +179,7 @@
    3.28  // 
    3.29  // Create a similar flow from n3 to n0, starting at time 1.1 seconds
    3.30  //
    3.31 -  ooff = Create<OnOffApplication> (
    3.32 +  ooff = CreateObject<OnOffApplication> (
    3.33      n3, 
    3.34      InetSocketAddress ("10.1.1.1", port), 
    3.35      "Udp",
     4.1 --- a/examples/csma-packet-socket.cc	Sun Dec 30 19:36:44 2007 -0800
     4.2 +++ b/examples/csma-packet-socket.cc	Wed Jan 02 09:09:24 2008 +0100
     4.3 @@ -61,7 +61,7 @@
     4.4  static Ptr<CsmaNetDevice>
     4.5  CreateCsmaDevice (Ptr<Node> node, Ptr<CsmaChannel> channel)
     4.6  {
     4.7 -  Ptr<CsmaNetDevice> device = Create<CsmaNetDevice> (node);
     4.8 +  Ptr<CsmaNetDevice> device = CreateObject<CsmaNetDevice> (node);
     4.9    device->Attach (channel);
    4.10    Ptr<Queue> queue = Queue::CreateDefault ();
    4.11    device->AddQueue (queue);
    4.12 @@ -102,14 +102,14 @@
    4.13    // Here, we will explicitly create four nodes.  In more sophisticated
    4.14    // topologies, we could configure a node factory.
    4.15    NS_LOG_INFO ("Create nodes.");
    4.16 -  Ptr<Node> n0 = Create<Node> ();
    4.17 -  Ptr<Node> n1 = Create<Node> (); 
    4.18 -  Ptr<Node> n2 = Create<Node> (); 
    4.19 -  Ptr<Node> n3 = Create<Node> ();
    4.20 +  Ptr<Node> n0 = CreateObject<Node> ();
    4.21 +  Ptr<Node> n1 = CreateObject<Node> (); 
    4.22 +  Ptr<Node> n2 = CreateObject<Node> (); 
    4.23 +  Ptr<Node> n3 = CreateObject<Node> ();
    4.24  
    4.25    // create the shared medium used by all csma devices.
    4.26    NS_LOG_INFO ("Create channels.");
    4.27 -  Ptr<CsmaChannel> channel = Create<CsmaChannel> (DataRate(5000000), MilliSeconds(2));
    4.28 +  Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> (DataRate(5000000), MilliSeconds(2));
    4.29  
    4.30    // use a helper function to connect our nodes to the shared channel.
    4.31    NS_LOG_INFO ("Build Topology.");
    4.32 @@ -134,7 +134,7 @@
    4.33    // 210 bytes at a rate of 448 Kb/s
    4.34    // from n0 to n1
    4.35    NS_LOG_INFO ("Create Applications.");
    4.36 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    4.37 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    4.38      n0, 
    4.39      n0ToN1,
    4.40      "Packet",
    4.41 @@ -145,7 +145,7 @@
    4.42    ooff->Stop (Seconds(10.0));
    4.43  
    4.44    // Create a similar flow from n3 to n0, starting at time 1.1 seconds
    4.45 -  ooff = Create<OnOffApplication> (
    4.46 +  ooff = CreateObject<OnOffApplication> (
    4.47      n3, 
    4.48      n3ToN0,
    4.49      "Packet",
     5.1 --- a/examples/mixed-global-routing.cc	Sun Dec 30 19:36:44 2007 -0800
     5.2 +++ b/examples/mixed-global-routing.cc	Wed Jan 02 09:09:24 2008 +0100
     5.3 @@ -120,13 +120,13 @@
     5.4    CommandLine::Parse (argc, argv);
     5.5  
     5.6    NS_LOG_INFO ("Create nodes.");
     5.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     5.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     5.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    5.10 -  Ptr<Node> n3 = Create<InternetNode> ();
    5.11 -  Ptr<Node> n4 = Create<InternetNode> (); 
    5.12 -  Ptr<Node> n5 = Create<InternetNode> (); 
    5.13 -  Ptr<Node> n6 = Create<InternetNode> ();
    5.14 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    5.15 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    5.16 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    5.17 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
    5.18 +  Ptr<Node> n4 = CreateObject<InternetNode> (); 
    5.19 +  Ptr<Node> n5 = CreateObject<InternetNode> (); 
    5.20 +  Ptr<Node> n6 = CreateObject<InternetNode> ();
    5.21  
    5.22    // We create the channels first without any IP addressing information
    5.23    NS_LOG_INFO ("Create channels.");
    5.24 @@ -191,7 +191,7 @@
    5.25    // 210 bytes at a rate of 448 Kb/s
    5.26    NS_LOG_INFO ("Create Applications.");
    5.27    uint16_t port = 9;   // Discard port (RFC 863)
    5.28 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    5.29 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    5.30      n0, 
    5.31      InetSocketAddress ("10.1.3.2", port), 
    5.32      "Udp",
     6.1 --- a/examples/simple-alternate-routing.cc	Sun Dec 30 19:36:44 2007 -0800
     6.2 +++ b/examples/simple-alternate-routing.cc	Wed Jan 02 09:09:24 2008 +0100
     6.3 @@ -128,10 +128,10 @@
     6.4    // Here, we will explicitly create four nodes.  In more sophisticated
     6.5    // topologies, we could configure a node factory.
     6.6    NS_LOG_INFO ("Create nodes.");
     6.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     6.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     6.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    6.10 -  Ptr<Node> n3 = Create<InternetNode> ();
    6.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    6.12 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    6.13 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    6.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
    6.15  
    6.16    // We create the channels first without any IP addressing information
    6.17    NS_LOG_INFO ("Create channels.");
    6.18 @@ -182,7 +182,7 @@
    6.19    uint16_t port = 9;   // Discard port (RFC 863)
    6.20  
    6.21    // Create a flow from n3 to n1, starting at time 1.1 seconds
    6.22 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    6.23 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    6.24      n3, 
    6.25      InetSocketAddress ("10.1.1.1", port),
    6.26      "Udp",
    6.27 @@ -193,7 +193,7 @@
    6.28    ooff->Stop (Seconds (10.0));
    6.29  
    6.30    // Create a packet sink to receive these packets
    6.31 -  Ptr<PacketSink> sink = Create<PacketSink> (
    6.32 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
    6.33      n1, 
    6.34      InetSocketAddress (Ipv4Address::GetAny (), port), 
    6.35      "Udp");
     7.1 --- a/examples/simple-error-model.cc	Sun Dec 30 19:36:44 2007 -0800
     7.2 +++ b/examples/simple-error-model.cc	Wed Jan 02 09:09:24 2008 +0100
     7.3 @@ -97,10 +97,10 @@
     7.4    // Here, we will explicitly create four nodes.  In more sophisticated
     7.5    // topologies, we could configure a node factory.
     7.6    NS_LOG_INFO ("Create nodes.");
     7.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     7.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     7.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    7.10 -  Ptr<Node> n3 = Create<InternetNode> ();
    7.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    7.12 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    7.13 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    7.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
    7.15  
    7.16    // We create the channels first without any IP addressing information
    7.17    NS_LOG_INFO ("Create channels.");
    7.18 @@ -143,7 +143,7 @@
    7.19    // 210 bytes at a rate of 448 Kb/s
    7.20    NS_LOG_INFO ("Create Applications.");
    7.21    uint16_t port = 9;   // Discard port (RFC 863)
    7.22 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    7.23 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    7.24      n0, 
    7.25      InetSocketAddress ("10.1.3.2", port), 
    7.26      "Udp",
    7.27 @@ -154,7 +154,7 @@
    7.28    ooff->Stop (Seconds(10.0));
    7.29  
    7.30    // Create an optional packet sink to receive these packets
    7.31 -  Ptr<PacketSink> sink = Create<PacketSink> (
    7.32 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
    7.33      n3,
    7.34      InetSocketAddress (Ipv4Address::GetAny (), port),
    7.35      "Udp");
    7.36 @@ -163,7 +163,7 @@
    7.37    sink->Stop (Seconds (10.0));
    7.38  
    7.39    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
    7.40 -  ooff = Create<OnOffApplication> (
    7.41 +  ooff = CreateObject<OnOffApplication> (
    7.42      n3, 
    7.43      InetSocketAddress ("10.1.2.1", port), 
    7.44      "Udp",
    7.45 @@ -174,7 +174,7 @@
    7.46    ooff->Stop (Seconds(10.0));
    7.47  
    7.48    // Create a packet sink to receive these packets
    7.49 -  sink = Create<PacketSink> (
    7.50 +  sink = CreateObject<PacketSink> (
    7.51      n1,
    7.52      InetSocketAddress (Ipv4Address::GetAny (), port),
    7.53      "Udp");
    7.54 @@ -222,7 +222,7 @@
    7.55    sampleList.push_back (11);
    7.56    sampleList.push_back (17);
    7.57    // This time, we'll explicitly create the error model we want
    7.58 -  Ptr<ListErrorModel> pem = Create<ListErrorModel> ();
    7.59 +  Ptr<ListErrorModel> pem = CreateObject<ListErrorModel> ();
    7.60    pem->SetList (sampleList);
    7.61    nd2->AddReceiveErrorModel (pem);
    7.62  
     8.1 --- a/examples/simple-global-routing.cc	Sun Dec 30 19:36:44 2007 -0800
     8.2 +++ b/examples/simple-global-routing.cc	Wed Jan 02 09:09:24 2008 +0100
     8.3 @@ -122,10 +122,10 @@
     8.4    // Here, we will explicitly create four nodes.  In more sophisticated
     8.5    // topologies, we could configure a node factory.
     8.6    NS_LOG_INFO ("Create nodes.");
     8.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     8.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     8.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    8.10 -  Ptr<Node> n3 = Create<InternetNode> ();
    8.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    8.12 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    8.13 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    8.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
    8.15  
    8.16    // We create the channels first without any IP addressing information
    8.17    NS_LOG_INFO ("Create channels.");
    8.18 @@ -163,7 +163,7 @@
    8.19    // 210 bytes at a rate of 448 Kb/s
    8.20    NS_LOG_INFO ("Create Applications.");
    8.21    uint16_t port = 9;   // Discard port (RFC 863)
    8.22 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    8.23 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    8.24      n0, 
    8.25      InetSocketAddress ("10.1.3.2", port), 
    8.26      "Udp",
    8.27 @@ -175,7 +175,7 @@
    8.28  
    8.29    // Create a packet sink to receive these packets
    8.30    // The last argument "true" disables output from the Receive callback
    8.31 -  Ptr<PacketSink> sink = Create<PacketSink> (
    8.32 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
    8.33      n3, 
    8.34      InetSocketAddress (Ipv4Address::GetAny (), port), 
    8.35      "Udp");
    8.36 @@ -184,7 +184,7 @@
    8.37    sink->Stop (Seconds (10.0));
    8.38  
    8.39    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
    8.40 -  ooff = Create<OnOffApplication> (
    8.41 +  ooff = CreateObject<OnOffApplication> (
    8.42      n3, 
    8.43      InetSocketAddress ("10.1.2.1", port),
    8.44      "Udp",
    8.45 @@ -195,7 +195,7 @@
    8.46    ooff->Stop (Seconds (10.0));
    8.47  
    8.48    // Create a packet sink to receive these packets
    8.49 -  sink = Create<PacketSink> (
    8.50 +  sink = CreateObject<PacketSink> (
    8.51      n1, 
    8.52      InetSocketAddress (Ipv4Address::GetAny (), port), 
    8.53      "Udp");
     9.1 --- a/examples/simple-point-to-point-olsr.cc	Sun Dec 30 19:36:44 2007 -0800
     9.2 +++ b/examples/simple-point-to-point-olsr.cc	Wed Jan 02 09:09:24 2008 +0100
     9.3 @@ -118,10 +118,10 @@
     9.4    // Here, we will explicitly create four nodes.  In more sophisticated
     9.5    // topologies, we could configure a node factory.
     9.6    NS_LOG_INFO ("Create nodes.");
     9.7 -  Ptr<Node> n0 = Create<InternetNode> ();
     9.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
     9.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
    9.10 -  Ptr<Node> n3 = Create<InternetNode> ();
    9.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
    9.12 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
    9.13 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
    9.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
    9.15  
    9.16    // We create the channels first without any IP addressing information
    9.17    NS_LOG_INFO ("Create channels.");
    9.18 @@ -162,7 +162,7 @@
    9.19    // 210 bytes at a rate of 448 Kb/s
    9.20    NS_LOG_INFO ("Create Applications.");
    9.21    uint16_t port = 9;   // Discard port (RFC 863)
    9.22 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
    9.23 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
    9.24      n0, 
    9.25      InetSocketAddress ("10.1.3.2", port), 
    9.26      "Udp",
    9.27 @@ -173,7 +173,7 @@
    9.28    ooff->Stop (Seconds(10.0));
    9.29  
    9.30    // Create an optional packet sink to receive these packets
    9.31 -  Ptr<PacketSink> sink = Create<PacketSink> (
    9.32 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
    9.33      n3,
    9.34      InetSocketAddress (Ipv4Address::GetAny (), port),
    9.35      "Udp");
    9.36 @@ -182,7 +182,7 @@
    9.37    sink->Stop (Seconds (10.0));
    9.38  
    9.39    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
    9.40 -  ooff = Create<OnOffApplication> (
    9.41 +  ooff = CreateObject<OnOffApplication> (
    9.42      n3, 
    9.43      InetSocketAddress ("10.1.2.1", port), 
    9.44      "Udp",
    9.45 @@ -193,7 +193,7 @@
    9.46    ooff->Stop (Seconds(10.0));
    9.47  
    9.48    // Create a packet sink to receive these packets
    9.49 -  sink = Create<PacketSink> (
    9.50 +  sink = CreateObject<PacketSink> (
    9.51      n1,
    9.52      InetSocketAddress (Ipv4Address::GetAny (), port),
    9.53      "Udp");
    10.1 --- a/examples/simple-point-to-point.cc	Sun Dec 30 19:36:44 2007 -0800
    10.2 +++ b/examples/simple-point-to-point.cc	Wed Jan 02 09:09:24 2008 +0100
    10.3 @@ -117,10 +117,10 @@
    10.4    // Here, we will explicitly create four nodes.  In more sophisticated
    10.5    // topologies, we could configure a node factory.
    10.6    NS_LOG_INFO ("Create nodes.");
    10.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    10.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
    10.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
   10.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   10.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   10.12 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
   10.13 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
   10.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   10.15  
   10.16    // We create the channels first without any IP addressing information
   10.17    NS_LOG_INFO ("Create channels.");
   10.18 @@ -163,7 +163,7 @@
   10.19    // 210 bytes at a rate of 448 Kb/s
   10.20    NS_LOG_INFO ("Create Applications.");
   10.21    uint16_t port = 9;   // Discard port (RFC 863)
   10.22 -  Ptr<OnOffApplication> ooff = Create<OnOffApplication> (
   10.23 +  Ptr<OnOffApplication> ooff = CreateObject<OnOffApplication> (
   10.24      n0, 
   10.25      InetSocketAddress ("10.1.3.2", port), 
   10.26      "Udp",
   10.27 @@ -174,7 +174,7 @@
   10.28    ooff->Stop (Seconds(10.0));
   10.29  
   10.30    // Create an optional packet sink to receive these packets
   10.31 -  Ptr<PacketSink> sink = Create<PacketSink> (
   10.32 +  Ptr<PacketSink> sink = CreateObject<PacketSink> (
   10.33      n3,
   10.34      InetSocketAddress (Ipv4Address::GetAny (), port),
   10.35      "Udp");
   10.36 @@ -183,7 +183,7 @@
   10.37    sink->Stop (Seconds (10.0));
   10.38  
   10.39    // Create a similar flow from n3 to n1, starting at time 1.1 seconds
   10.40 -  ooff = Create<OnOffApplication> (
   10.41 +  ooff = CreateObject<OnOffApplication> (
   10.42      n3, 
   10.43      InetSocketAddress ("10.1.2.1", port), 
   10.44      "Udp",
   10.45 @@ -194,7 +194,7 @@
   10.46    ooff->Stop (Seconds(10.0));
   10.47  
   10.48    // Create a packet sink to receive these packets
   10.49 -  sink = Create<PacketSink> (
   10.50 +  sink = CreateObject<PacketSink> (
   10.51      n1,
   10.52      InetSocketAddress (Ipv4Address::GetAny (), port),
   10.53      "Udp");
    11.1 --- a/examples/udp-echo.cc	Sun Dec 30 19:36:44 2007 -0800
    11.2 +++ b/examples/udp-echo.cc	Wed Jan 02 09:09:24 2008 +0100
    11.3 @@ -100,10 +100,10 @@
    11.4  // Explicitly create the nodes required by the topology (shown above).
    11.5  //
    11.6    NS_LOG_INFO ("Create nodes.");
    11.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    11.8 -  Ptr<Node> n1 = Create<InternetNode> (); 
    11.9 -  Ptr<Node> n2 = Create<InternetNode> (); 
   11.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   11.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   11.12 +  Ptr<Node> n1 = CreateObject<InternetNode> (); 
   11.13 +  Ptr<Node> n2 = CreateObject<InternetNode> (); 
   11.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   11.15  
   11.16    NS_LOG_INFO ("Create channels.");
   11.17  //
   11.18 @@ -167,7 +167,7 @@
   11.19  //
   11.20    uint16_t port = 9;  // well-known echo port number
   11.21  
   11.22 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   11.23 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   11.24  //
   11.25  // Create a UdpEchoClient application to send UDP datagrams from node zero to
   11.26  // node one.
   11.27 @@ -176,7 +176,7 @@
   11.28    uint32_t maxPacketCount = 1;
   11.29    Time interPacketInterval = Seconds (1.);
   11.30  
   11.31 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
   11.32 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
   11.33      maxPacketCount, interPacketInterval, packetSize);
   11.34  //
   11.35  // Tell the applications when to start and stop.
    12.1 --- a/samples/main-adhoc-wifi.cc	Sun Dec 30 19:36:44 2007 -0800
    12.2 +++ b/samples/main-adhoc-wifi.cc	Wed Jan 02 09:09:24 2008 +0100
    12.3 @@ -45,10 +45,10 @@
    12.4  CreateAdhocNode (Ptr<WifiChannel> channel,
    12.5                   Vector position, const char *address)
    12.6  {
    12.7 -  Ptr<Node> node = Create<Node> ();  
    12.8 -  Ptr<AdhocWifiNetDevice> device = Create<AdhocWifiNetDevice> (node, Mac48Address (address));
    12.9 +  Ptr<Node> node = CreateObject<Node> ();  
   12.10 +  Ptr<AdhocWifiNetDevice> device = CreateObject<AdhocWifiNetDevice> (node, Mac48Address (address));
   12.11    device->Attach (channel);
   12.12 -  Ptr<MobilityModel> mobility = Create<StaticMobilityModel> ();
   12.13 +  Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
   12.14    mobility->SetPosition (position);
   12.15    node->AddInterface (mobility);
   12.16    
   12.17 @@ -108,7 +108,7 @@
   12.18  {
   12.19    g_bytesTotal = 0;
   12.20  
   12.21 -  Ptr<WifiChannel> channel = Create<WifiChannel> ();
   12.22 +  Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
   12.23  
   12.24    Ptr<Node> a = CreateAdhocNode (channel, 
   12.25                                   Vector (5.0,0.0,0.0),
   12.26 @@ -121,7 +121,7 @@
   12.27    destination.SetProtocol (1);
   12.28    destination.SetSingleDevice (0);
   12.29    destination.SetPhysicalAddress (Mac48Address ("00:00:00:00:00:02"));
   12.30 -  Ptr<Application> app = Create<OnOffApplication> (a, destination, 
   12.31 +  Ptr<Application> app = CreateObject<OnOffApplication> (a, destination, 
   12.32                                                     "Packet", 
   12.33                                                     ConstantVariable (250),
   12.34                                                     ConstantVariable (0),
    13.1 --- a/samples/main-ap-wifi.cc	Sun Dec 30 19:36:44 2007 -0800
    13.2 +++ b/samples/main-ap-wifi.cc	Wed Jan 02 09:09:24 2008 +0100
    13.3 @@ -71,12 +71,12 @@
    13.4                Ssid ssid, 
    13.5                Time at)
    13.6  {
    13.7 -  Ptr<Node> node = Create<Node> ();  
    13.8 -  Ptr<NqapWifiNetDevice> device = Create<NqapWifiNetDevice> (node, Mac48Address (macAddress));
    13.9 +  Ptr<Node> node = CreateObject<Node> ();  
   13.10 +  Ptr<NqapWifiNetDevice> device = CreateObject<NqapWifiNetDevice> (node, Mac48Address (macAddress));
   13.11    device->SetSsid (ssid);
   13.12    Simulator::Schedule (at, &NqapWifiNetDevice::StartBeaconing, device);
   13.13    device->Attach (channel);
   13.14 -  Ptr<MobilityModel> mobility = Create<StaticMobilityModel> ();
   13.15 +  Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
   13.16    mobility->SetPosition (position);
   13.17    node->AddInterface (mobility);
   13.18    return node;
   13.19 @@ -88,12 +88,12 @@
   13.20                 const char *macAddress,
   13.21                 Ssid ssid)
   13.22  {
   13.23 -  Ptr<Node> node = Create<Node> ();  
   13.24 -  Ptr<NqstaWifiNetDevice> device = Create<NqstaWifiNetDevice> (node, Mac48Address (macAddress));
   13.25 +  Ptr<Node> node = CreateObject<Node> ();  
   13.26 +  Ptr<NqstaWifiNetDevice> device = CreateObject<NqstaWifiNetDevice> (node, Mac48Address (macAddress));
   13.27    Simulator::ScheduleNow (&NqstaWifiNetDevice::StartActiveAssociation, device, 
   13.28                            ssid);
   13.29    device->Attach (channel);
   13.30 -  Ptr<MobilityModel> mobility = Create<StaticMobilityModel> ();
   13.31 +  Ptr<MobilityModel> mobility = CreateObject<StaticMobilityModel> ();
   13.32    mobility->SetPosition (position);
   13.33    node->AddInterface (mobility);
   13.34    return node;
   13.35 @@ -146,7 +146,7 @@
   13.36    DefaultValue::Bind ("WifiRateControlAlgorithm", "Aarf");
   13.37    //DefaultValue::Bind ("WifiRateControlAlgorithm", "Arf");
   13.38  
   13.39 -  Ptr<WifiChannel> channel = Create<WifiChannel> ();
   13.40 +  Ptr<WifiChannel> channel = CreateObject<WifiChannel> ();
   13.41    Ssid ssid = Ssid ("mathieu");
   13.42  
   13.43    Ptr<Node> a = CreateApNode (channel, 
   13.44 @@ -170,7 +170,7 @@
   13.45    destination.SetProtocol (1);
   13.46    destination.SetSingleDevice (0);
   13.47    destination.SetPhysicalAddress (Mac48Address ("00:00:00:00:00:03"));
   13.48 -  Ptr<Application> app = Create<OnOffApplication> (b, destination, 
   13.49 +  Ptr<Application> app = CreateObject<OnOffApplication> (b, destination, 
   13.50                                                     "Packet", 
   13.51                                                     ConstantVariable (42),
   13.52                                                     ConstantVariable (0));
    14.1 --- a/samples/main-component-manager.cc	Sun Dec 30 19:36:44 2007 -0800
    14.2 +++ b/samples/main-component-manager.cc	Wed Jan 02 09:09:24 2008 +0100
    14.3 @@ -17,10 +17,7 @@
    14.4  const ClassId AnObject::cid = MakeClassId<AnObject, int, double> ("AnObject", AnObject::iid);
    14.5  
    14.6  AnObject::AnObject (int a, double b)
    14.7 -{
    14.8 -  // enable our interface
    14.9 -  SetInterfaceId (AnObject::iid);
   14.10 -}
   14.11 +{}
   14.12  void
   14.13  AnObject::DoDispose (void)
   14.14  {
    15.1 --- a/samples/main-grid-topology.cc	Sun Dec 30 19:36:44 2007 -0800
    15.2 +++ b/samples/main-grid-topology.cc	Wed Jan 02 09:09:24 2008 +0100
    15.3 @@ -17,7 +17,7 @@
    15.4    // create an array of empty nodes for testing purposes 
    15.5    for (uint32_t i = 0; i < 120; i++)
    15.6      {
    15.7 -      nodes.push_back (Create<InternetNode> ());
    15.8 +      nodes.push_back (CreateObject<InternetNode> ());
    15.9      }
   15.10  
   15.11    // setup the grid itself: objects are layed out
    16.1 --- a/samples/main-object.cc	Sun Dec 30 19:36:44 2007 -0800
    16.2 +++ b/samples/main-object.cc	Wed Jan 02 09:09:24 2008 +0100
    16.3 @@ -14,10 +14,7 @@
    16.4  const InterfaceId AnObject::iid = MakeInterfaceId ("AnObject", Object::iid);
    16.5  
    16.6  AnObject::AnObject ()
    16.7 -{
    16.8 -  // enable our interface
    16.9 -  SetInterfaceId (AnObject::iid);
   16.10 -}
   16.11 +{}
   16.12  void
   16.13  AnObject::DoDispose (void)
   16.14  {
   16.15 @@ -68,7 +65,7 @@
   16.16    // enable our interface
   16.17    SetInterfaceId (YetAnotherObject::iid);
   16.18    // aggregated directly to another object.
   16.19 -  AddInterface (Create<AnObject> ());
   16.20 +  AddInterface (CreateObject<AnObject> ());
   16.21  }
   16.22  void
   16.23  YetAnotherObject::DoDispose (void)
   16.24 @@ -87,7 +84,7 @@
   16.25    Ptr<AnotherObject> anotherObject;
   16.26    Ptr<YetAnotherObject> yetAnotherObject;
   16.27  
   16.28 -  p = Create<AnObject> ();
   16.29 +  p = CreateObject<AnObject> ();
   16.30    // p gives you access to AnObject's interface
   16.31    anObject = p->QueryInterface<AnObject> (AnObject::iid);
   16.32    NS_ASSERT (anObject != 0);
   16.33 @@ -95,7 +92,7 @@
   16.34    anotherObject = p->QueryInterface<AnotherObject> (AnotherObject::iid);
   16.35    NS_ASSERT (anotherObject == 0);
   16.36  
   16.37 -  anotherObject = Create<AnotherObject> (1);
   16.38 +  anotherObject = CreateObject<AnotherObject> (1);
   16.39    // AnotherObject does not give you access to AnObject's interface
   16.40    anObject = anotherObject->QueryInterface<AnObject> (AnObject::iid);
   16.41    NS_ASSERT (anObject == 0);
   16.42 @@ -110,7 +107,7 @@
   16.43    NS_ASSERT (anotherObject != 0);
   16.44  
   16.45  
   16.46 -  yetAnotherObject = Create<YetAnotherObject> (2);
   16.47 +  yetAnotherObject = CreateObject<YetAnotherObject> (2);
   16.48    // gives you acess to AnObject interface too.
   16.49    anObject = yetAnotherObject->QueryInterface<AnObject> (AnObject::iid);
   16.50    NS_ASSERT (anObject != 0);
    17.1 --- a/samples/main-propagation-loss.cc	Sun Dec 30 19:36:44 2007 -0800
    17.2 +++ b/samples/main-propagation-loss.cc	Wed Jan 02 09:09:24 2008 +0100
    17.3 @@ -26,8 +26,8 @@
    17.4  static void
    17.5  PrintOne (double minTxpower, double maxTxpower, double stepTxpower, double min, double max, double step)
    17.6  {
    17.7 -  Ptr<StaticMobilityModel> a = Create<StaticMobilityModel> ();
    17.8 -  Ptr<StaticMobilityModel> b = Create<StaticMobilityModel> ();
    17.9 +  Ptr<StaticMobilityModel> a = CreateObject<StaticMobilityModel> ();
   17.10 +  Ptr<StaticMobilityModel> b = CreateObject<StaticMobilityModel> ();
   17.11    Ptr<PropagationLossModel> model = PropagationLossModel::CreateDefault ();
   17.12  
   17.13    a->SetPosition (Vector (0.0, 0.0, 0.0));
    18.1 --- a/samples/main-ptr.cc	Sun Dec 30 19:36:44 2007 -0800
    18.2 +++ b/samples/main-ptr.cc	Wed Jan 02 09:09:24 2008 +0100
    18.3 @@ -49,7 +49,7 @@
    18.4    {
    18.5      // Create a new object of type A, store it in global 
    18.6      // variable g_a
    18.7 -    Ptr<A> a = Create<A> ();
    18.8 +    Ptr<A> a = CreateObject<A> ();
    18.9      a->Method ();
   18.10      Ptr<A> prev = StoreA (a);
   18.11      NS_ASSERT (prev == 0);
   18.12 @@ -58,7 +58,7 @@
   18.13    {
   18.14      // Create a new object of type A, store it in global 
   18.15      // variable g_a, get a hold on the previous A object.
   18.16 -    Ptr<A> a = Create<A> ();
   18.17 +    Ptr<A> a = CreateObject<A> ();
   18.18      Ptr<A> prev = StoreA (a);
   18.19      // call method on object
   18.20      prev->Method ();
    19.1 --- a/samples/main-query-interface.cc	Sun Dec 30 19:36:44 2007 -0800
    19.2 +++ b/samples/main-query-interface.cc	Wed Jan 02 09:09:24 2008 +0100
    19.3 @@ -122,8 +122,6 @@
    19.4  AnImplementation::AnImplementation (void)
    19.5  {
    19.6    NS_LOG_FUNCTION;
    19.7 -  // enable our interface
    19.8 -  SetInterfaceId (AnImplementation::iid);
    19.9  }
   19.10  
   19.11  void
   19.12 @@ -233,7 +231,7 @@
   19.13  
   19.14  AnExtendedImplementation::AnExtendedImplementation (void)
   19.15  {
   19.16 -  pImpl = Create<AnImplementation> (); 
   19.17 +  pImpl = CreateObject<AnImplementation> (); 
   19.18    SetInterfaceId (AnExtendedImplementation::iid);
   19.19  }
   19.20  
    20.1 --- a/samples/main-random-topology.cc	Sun Dec 30 19:36:44 2007 -0800
    20.2 +++ b/samples/main-random-topology.cc	Wed Jan 02 09:09:24 2008 +0100
    20.3 @@ -38,7 +38,7 @@
    20.4    std::vector<Ptr<Object> > objects;
    20.5    for (uint32_t i = 0; i < 10000; i++)
    20.6      {
    20.7 -      Ptr<MobilityModelNotifier> notifier = Create<MobilityModelNotifier> ();
    20.8 +      Ptr<MobilityModelNotifier> notifier = CreateObject<MobilityModelNotifier> ();
    20.9        notifier->TraceConnect ("/course-change", MakeCallback (&CourseChange));
   20.10        objects.push_back (notifier);
   20.11      }
    21.1 --- a/samples/main-random-walk.cc	Sun Dec 30 19:36:44 2007 -0800
    21.2 +++ b/samples/main-random-walk.cc	Wed Jan 02 09:09:24 2008 +0100
    21.3 @@ -45,8 +45,8 @@
    21.4  
    21.5    for (uint32_t i = 0; i < 100; i++)
    21.6      {
    21.7 -      Ptr<Node> node = Create<Node> ();
    21.8 -      node->AddInterface (Create<MobilityModelNotifier> ());
    21.9 +      Ptr<Node> node = CreateObject<Node> ();
   21.10 +      node->AddInterface (CreateObject<MobilityModelNotifier> ());
   21.11      }
   21.12  
   21.13    topology.Layout (NodeList::Begin (), NodeList::End ());
    22.1 --- a/samples/main-simple.cc	Sun Dec 30 19:36:44 2007 -0800
    22.2 +++ b/samples/main-simple.cc	Wed Jan 02 09:09:24 2008 +0100
    22.3 @@ -40,7 +40,7 @@
    22.4  void
    22.5  RunSimulation (void)
    22.6  {
    22.7 -  Ptr<Node> a = Create<InternetNode> ();
    22.8 +  Ptr<Node> a = CreateObject<InternetNode> ();
    22.9  
   22.10    InterfaceId iid = InterfaceId::LookupByName ("Udp");
   22.11    Ptr<SocketFactory> socketFactory = a->QueryInterface<SocketFactory> (iid);
    23.1 --- a/src/common/error-model.cc	Sun Dec 30 19:36:44 2007 -0800
    23.2 +++ b/src/common/error-model.cc	Wed Jan 02 09:09:24 2008 +0100
    23.3 @@ -43,7 +43,6 @@
    23.4    m_enable (true) 
    23.5  {
    23.6    NS_LOG_FUNCTION;  
    23.7 -  SetInterfaceId (ErrorModel::iid);
    23.8  }
    23.9  
   23.10  ErrorModel::~ErrorModel ()
   23.11 @@ -130,7 +129,6 @@
   23.12    NS_LOG_FUNCTION;
   23.13    // Assume a uniform random variable if user does not specify
   23.14    m_ranvar = new UniformVariable ();
   23.15 -  SetInterfaceId (RateErrorModel::iid);
   23.16  }
   23.17  
   23.18  RateErrorModel::~RateErrorModel () 
   23.19 @@ -244,7 +242,6 @@
   23.20  ListErrorModel::ListErrorModel ()  
   23.21  {
   23.22    NS_LOG_FUNCTION;
   23.23 -  SetInterfaceId (ListErrorModel::iid);
   23.24  }
   23.25  
   23.26  ListErrorModel::~ListErrorModel () 
    24.1 --- a/src/common/error-model.h	Sun Dec 30 19:36:44 2007 -0800
    24.2 +++ b/src/common/error-model.h	Wed Jan 02 09:09:24 2008 +0100
    24.3 @@ -48,7 +48,7 @@
    24.4   * Typical code (simplified) to use an ErrorModel may look something like 
    24.5   * this:
    24.6   * \code 
    24.7 - * Ptr<ErrorModel> rem = Create<RateErrorModel> ();
    24.8 + * Ptr<ErrorModel> rem = CreateObject<RateErrorModel> ();
    24.9   * rem->SetRandomVariable (UniformVariable ());
   24.10   * rem->SetRate (0.001);
   24.11   * ...
    25.1 --- a/src/core/array-trace-resolver.cc	Sun Dec 30 19:36:44 2007 -0800
    25.2 +++ b/src/core/array-trace-resolver.cc	Wed Jan 02 09:09:24 2008 +0100
    25.3 @@ -211,7 +211,7 @@
    25.4    std::vector<Ptr<ObjectTraceTester> > vec;
    25.5    for (uint32_t i = 0; i < n; i++)
    25.6      {
    25.7 -      vec.push_back (Create<ObjectTraceTester> ());
    25.8 +      vec.push_back (CreateObject<ObjectTraceTester> ());
    25.9      }
   25.10    ArrayTraceResolver<ObjectTraceTesterIndex> resolver;
   25.11    resolver.SetIterators (vec.begin (), vec.end ());
    26.1 --- a/src/core/component-manager.cc	Sun Dec 30 19:36:44 2007 -0800
    26.2 +++ b/src/core/component-manager.cc	Wed Jan 02 09:09:24 2008 +0100
    26.3 @@ -241,9 +241,7 @@
    26.4  const ns3::InterfaceId B::iid = MakeInterfaceId ("B", Object::iid);
    26.5  
    26.6  B::B ()
    26.7 -{
    26.8 -  SetInterfaceId (B::iid);
    26.9 -}
   26.10 +{}
   26.11  
   26.12  
   26.13  class A : public ns3::Object
   26.14 @@ -277,8 +275,7 @@
   26.15      m_oneBoolInvoked (false),
   26.16      m_oneUi32Invoked (false)
   26.17  {
   26.18 -  SetInterfaceId (A::iid);
   26.19 -  ns3::Ptr<B> b = ns3::Create<B> ();
   26.20 +  ns3::Ptr<B> b = ns3::CreateObject<B> ();
   26.21    AddInterface (b);
   26.22  }
   26.23  
   26.24 @@ -288,8 +285,7 @@
   26.25      m_oneUi32Invoked (false),
   26.26      m_bool (bo)
   26.27  {
   26.28 -  SetInterfaceId (A::iid);
   26.29 -  ns3::Ptr<B> b = ns3::Create<B> ();
   26.30 +  ns3::Ptr<B> b = ns3::CreateObject<B> ();
   26.31    AddInterface (b);
   26.32  }
   26.33  
   26.34 @@ -299,8 +295,7 @@
   26.35      m_oneUi32Invoked (true),
   26.36      m_ui32 (i)
   26.37  {
   26.38 -  SetInterfaceId (A::iid);
   26.39 -  ns3::Ptr<B> b = ns3::Create<B> ();
   26.40 +  ns3::Ptr<B> b = ns3::CreateObject<B> ();
   26.41    AddInterface (b);
   26.42  }
   26.43  
    27.1 --- a/src/core/component-manager.h	Sun Dec 30 19:36:44 2007 -0800
    27.2 +++ b/src/core/component-manager.h	Wed Jan 02 09:09:24 2008 +0100
    27.3 @@ -428,7 +428,7 @@
    27.4  struct ObjectMaker<T,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> {
    27.5    static ns3::Ptr<ns3::Object> 
    27.6    MakeObject (void) {
    27.7 -    return ns3::Create<T> ();
    27.8 +    return ns3::CreateObject<T> ();
    27.9    }
   27.10  };
   27.11  
   27.12 @@ -436,7 +436,7 @@
   27.13  struct ObjectMaker<T,T1,ns3::empty,ns3::empty,ns3::empty,ns3::empty> {
   27.14    static ns3::Ptr<ns3::Object> 
   27.15    MakeObject (T1 a1) {
   27.16 -    return ns3::Create<T> (a1);
   27.17 +    return ns3::CreateObject<T> (a1);
   27.18    }
   27.19  };
   27.20  
   27.21 @@ -444,7 +444,7 @@
   27.22  struct ObjectMaker<T,T1,T2,ns3::empty,ns3::empty,ns3::empty> {
   27.23    static ns3::Ptr<ns3::Object> 
   27.24    MakeObject (T1 a1, T2 a2) {
   27.25 -    return ns3::Create<T> (a1, a2);
   27.26 +    return ns3::CreateObject<T> (a1, a2);
   27.27    }
   27.28  };
   27.29  
   27.30 @@ -452,7 +452,7 @@
   27.31  struct ObjectMaker<T,T1,T2,T3,ns3::empty,ns3::empty> {
   27.32    static ns3::Ptr<ns3::Object> 
   27.33    MakeObject (T1 a1, T2 a2, T3 a3) {
   27.34 -    return ns3::Create<T> (a1, a2, a3);
   27.35 +    return ns3::CreateObject<T> (a1, a2, a3);
   27.36    }
   27.37  };
   27.38  
   27.39 @@ -461,7 +461,7 @@
   27.40  struct ObjectMaker<T,T1,T2,T3,T4,ns3::empty> {
   27.41    static ns3::Ptr<ns3::Object> 
   27.42    MakeObject (T1 a1, T2 a2, T3 a3, T4 a4) {
   27.43 -    return ns3::Create<T> (a1, a2, a3, a4);
   27.44 +    return ns3::CreateObject<T> (a1, a2, a3, a4);
   27.45    }
   27.46  };
   27.47  
   27.48 @@ -470,7 +470,7 @@
   27.49  struct ObjectMaker {
   27.50    static ns3::Ptr<ns3::Object> 
   27.51    MakeObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) {
   27.52 -    return ns3::Create<T> (a1, a2, a3, a4, a5);
   27.53 +    return ns3::CreateObject<T> (a1, a2, a3, a4, a5);
   27.54    }
   27.55  };
   27.56  
    28.1 --- a/src/core/object.cc	Sun Dec 30 19:36:44 2007 -0800
    28.2 +++ b/src/core/object.cc	Wed Jan 02 09:09:24 2008 +0100
    28.3 @@ -406,9 +406,7 @@
    28.4  public:
    28.5    static const ns3::InterfaceId iid;
    28.6    BaseA ()
    28.7 -  {
    28.8 -    SetInterfaceId (BaseA::iid);
    28.9 -  }
   28.10 +  {}
   28.11    void BaseGenerateTrace (int16_t v)
   28.12    { m_source = v; }
   28.13    virtual void Dispose (void) {}
   28.14 @@ -428,9 +426,7 @@
   28.15  public:
   28.16    static const ns3::InterfaceId iid;
   28.17    DerivedA (int v)
   28.18 -  {
   28.19 -    SetInterfaceId (DerivedA::iid);
   28.20 -  }
   28.21 +  {}
   28.22    void DerivedGenerateTrace (int16_t v)
   28.23    { m_sourceDerived = v; }
   28.24    virtual void Dispose (void) {
   28.25 @@ -457,9 +453,7 @@
   28.26  public:
   28.27    static const ns3::InterfaceId iid;
   28.28    BaseB ()
   28.29 -  {
   28.30 -    SetInterfaceId (BaseB::iid);
   28.31 -  }
   28.32 +  {}
   28.33    void BaseGenerateTrace (int16_t v)
   28.34    { m_source = v; }
   28.35    virtual void Dispose (void) {}
   28.36 @@ -479,9 +473,7 @@
   28.37  public:
   28.38    static const ns3::InterfaceId iid;
   28.39    DerivedB (int v)
   28.40 -  {
   28.41 -    SetInterfaceId (DerivedB::iid);
   28.42 -  }
   28.43 +  {}
   28.44    void DerivedGenerateTrace (int16_t v)
   28.45    { m_sourceDerived = v; }
   28.46    virtual void Dispose (void) {
   28.47 @@ -553,17 +545,17 @@
   28.48  {
   28.49    bool result = true;
   28.50  
   28.51 -  Ptr<BaseA> baseA = Create<BaseA> ();
   28.52 +  Ptr<BaseA> baseA = CreateObject<BaseA> ();
   28.53    NS_TEST_ASSERT_EQUAL (baseA->QueryInterface<BaseA> (BaseA::iid), baseA);
   28.54    NS_TEST_ASSERT_EQUAL (baseA->QueryInterface<BaseA> (DerivedA::iid), 0);
   28.55    NS_TEST_ASSERT_EQUAL (baseA->QueryInterface<DerivedA> (DerivedA::iid), 0);
   28.56 -  baseA = Create<DerivedA> (10);
   28.57 +  baseA = CreateObject<DerivedA> (10);
   28.58    NS_TEST_ASSERT_EQUAL (baseA->QueryInterface<BaseA> (BaseA::iid), baseA);
   28.59    NS_TEST_ASSERT_EQUAL (baseA->QueryInterface<BaseA> (DerivedA::iid), baseA);
   28.60    NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface<DerivedA> (DerivedA::iid), 0);
   28.61  
   28.62 -  baseA = Create<BaseA> ();
   28.63 -  Ptr<BaseB> baseB = Create<BaseB> ();
   28.64 +  baseA = CreateObject<BaseA> ();
   28.65 +  Ptr<BaseB> baseB = CreateObject<BaseB> ();
   28.66    Ptr<BaseB> baseBCopy = baseB;
   28.67    baseA->AddInterface (baseB);
   28.68    NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface<BaseA> (BaseA::iid), 0);
   28.69 @@ -576,8 +568,8 @@
   28.70    NS_TEST_ASSERT_EQUAL (baseB->QueryInterface<DerivedA> (DerivedA::iid), 0);
   28.71    NS_TEST_ASSERT_UNEQUAL (baseBCopy->QueryInterface<BaseA> (BaseA::iid), 0);
   28.72  
   28.73 -  baseA = Create<DerivedA> (1);
   28.74 -  baseB = Create<DerivedB> (1);
   28.75 +  baseA = CreateObject<DerivedA> (1);
   28.76 +  baseB = CreateObject<DerivedB> (1);
   28.77    baseBCopy = baseB;
   28.78    baseA->AddInterface (baseB);
   28.79    NS_TEST_ASSERT_UNEQUAL (baseA->QueryInterface<DerivedB> (DerivedB::iid), 0);
   28.80 @@ -589,20 +581,20 @@
   28.81    NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface<DerivedB> (DerivedB::iid), 0);
   28.82    NS_TEST_ASSERT_UNEQUAL (baseB->QueryInterface<BaseB> (BaseB::iid), 0)
   28.83  
   28.84 -  baseA = Create<BaseA> ();
   28.85 -  baseB = Create<BaseB> ();
   28.86 +  baseA = CreateObject<BaseA> ();
   28.87 +  baseB = CreateObject<BaseB> ();
   28.88    baseA->AddInterface (baseB);
   28.89    baseA = 0;
   28.90    baseA = baseB->QueryInterface<BaseA> (BaseA::iid);
   28.91  
   28.92 -  baseA = Create<BaseA> ();
   28.93 +  baseA = CreateObject<BaseA> ();
   28.94    baseA->TraceConnect ("/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
   28.95    m_baseATrace = false;
   28.96    baseA->BaseGenerateTrace (1);
   28.97    NS_TEST_ASSERT (m_baseATrace);
   28.98    baseA->TraceDisconnect ("/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
   28.99  
  28.100 -  baseB = Create<BaseB> ();
  28.101 +  baseB = CreateObject<BaseB> ();
  28.102    baseB->TraceConnect ("/baseb-x",  MakeCallback (&ObjectTest::BaseBTrace, this));
  28.103    m_baseBTrace = false;
  28.104    baseB->BaseGenerateTrace (2);
  28.105 @@ -639,8 +631,8 @@
  28.106    baseA->TraceDisconnect ("/$BaseA/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
  28.107  
  28.108    Ptr<DerivedA> derivedA;
  28.109 -  derivedA = Create<DerivedA> (1);
  28.110 -  baseB = Create<BaseB> ();
  28.111 +  derivedA = CreateObject<DerivedA> (1);
  28.112 +  baseB = CreateObject<BaseB> ();
  28.113    derivedA->AddInterface (baseB);
  28.114    baseB->TraceConnect ("/$DerivedA/deriveda-x", MakeCallback (&ObjectTest::DerivedATrace, this));
  28.115    baseB->TraceConnect ("/$DerivedA/basea-x", MakeCallback (&ObjectTest::BaseATrace, this));
    29.1 --- a/src/core/object.h	Sun Dec 30 19:36:44 2007 -0800
    29.2 +++ b/src/core/object.h	Wed Jan 02 09:09:24 2008 +0100
    29.3 @@ -166,6 +166,38 @@
    29.4    virtual Ptr<TraceResolver> GetTraceResolver (void) const;
    29.5  protected:
    29.6    /**
    29.7 +   * This method is called by Object::Dispose.
    29.8 +   * Subclasses are expected to override this method and chain
    29.9 +   * up to their parent's implementation once they are done.
   29.10 +   */
   29.11 +  virtual void DoDispose (void);
   29.12 +private:
   29.13 +  friend class InterfaceIdTraceResolver;
   29.14 +  template <typename T>
   29.15 +  friend Ptr<T> CreateObject (void);
   29.16 +  template <typename T, typename T1>
   29.17 +  friend Ptr<T> CreateObject (T1 a1);
   29.18 +  template <typename T, typename T1, typename T2>
   29.19 +  friend Ptr<T> CreateObject (T1 a1, T2 a2);
   29.20 +  template <typename T, typename T1, typename T2, typename T3>
   29.21 +  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3);
   29.22 +  template <typename T, typename T1, typename T2, typename T3, typename T4>
   29.23 +  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4);
   29.24 +  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
   29.25 +  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   29.26 +  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
   29.27 +  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
   29.28 +  template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
   29.29 +  friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7);
   29.30 +
   29.31 +  Ptr<Object> DoQueryInterface (InterfaceId iid) const;
   29.32 +  void DoCollectSources (std::string path, const TraceContext &context, 
   29.33 +                         TraceResolver::SourceCollection *collection) const;
   29.34 +  void DoTraceAll (std::ostream &os, const TraceContext &context) const;
   29.35 +  bool Check (void) const;
   29.36 +  bool CheckLoose (void) const;
   29.37 +  void MaybeDelete (void) const;
   29.38 +  /**
   29.39     * \param iid an InterfaceId
   29.40     *
   29.41     * Every subclass which defines a new InterfaceId for itself
   29.42 @@ -173,21 +205,7 @@
   29.43     * from its constructor.
   29.44     */
   29.45    void SetInterfaceId (InterfaceId iid);
   29.46 -  /**
   29.47 -   * This method is called by Object::Dispose.
   29.48 -   * Subclasses are expected to override this method and chain
   29.49 -   * up to their parent's implementation once they are done.
   29.50 -   */
   29.51 -  virtual void DoDispose (void);
   29.52 -private:
   29.53 -  friend class InterfaceIdTraceResolver;
   29.54 -  Ptr<Object> DoQueryInterface (InterfaceId iid) const;
   29.55 -  void DoCollectSources (std::string path, const TraceContext &context, 
   29.56 -                         TraceResolver::SourceCollection *collection) const;
   29.57 -  void DoTraceAll (std::ostream &os, const TraceContext &context) const;
   29.58 -  bool Check (void) const;
   29.59 -  bool CheckLoose (void) const;
   29.60 -  void MaybeDelete (void) const;
   29.61 +
   29.62    mutable uint32_t m_count;
   29.63    InterfaceId m_iid;
   29.64    bool m_disposed;
   29.65 @@ -195,6 +213,30 @@
   29.66    Object *m_next;
   29.67  };
   29.68  
   29.69 +template <typename T>
   29.70 +Ptr<T> CreateObject (void);
   29.71 +
   29.72 +template <typename T, typename T1>
   29.73 +Ptr<T> CreateObject (T1 a1);
   29.74 +
   29.75 +template <typename T, typename T1, typename T2>
   29.76 +Ptr<T> CreateObject (T1 a1, T2 a2);
   29.77 +
   29.78 +template <typename T, typename T1, typename T2, typename T3>
   29.79 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3);
   29.80 +
   29.81 +template <typename T, typename T1, typename T2, typename T3, typename T4>
   29.82 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4);
   29.83 +
   29.84 +template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
   29.85 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   29.86 +
   29.87 +template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
   29.88 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6);
   29.89 +
   29.90 +template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
   29.91 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7);
   29.92 +
   29.93  } // namespace ns3
   29.94  
   29.95  namespace ns3 {
   29.96 @@ -227,6 +269,71 @@
   29.97    return 0;
   29.98  }
   29.99  
  29.100 +template <typename T>
  29.101 +Ptr<T> CreateObject (void)
  29.102 +{
  29.103 +  Ptr<T> p = Ptr<T> (new T (), false);
  29.104 +  p->SetInterfaceId (T::iid);
  29.105 +  return p;
  29.106 +}
  29.107 +
  29.108 +template <typename T, typename T1>
  29.109 +Ptr<T> CreateObject (T1 a1)
  29.110 +{
  29.111 +  Ptr<T> p = Ptr<T> (new T (a1), false);
  29.112 +  p->SetInterfaceId (T::iid);
  29.113 +  return p;
  29.114 +}
  29.115 +
  29.116 +template <typename T, typename T1, typename T2>
  29.117 +Ptr<T> CreateObject (T1 a1, T2 a2)
  29.118 +{
  29.119 +  Ptr<T> p = Ptr<T> (new T (a1, a2), false);
  29.120 +  p->SetInterfaceId (T::iid);
  29.121 +  return p;
  29.122 +}
  29.123 +
  29.124 +template <typename T, typename T1, typename T2, typename T3>
  29.125 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3)
  29.126 +{
  29.127 +  Ptr<T> p = Ptr<T> (new T (a1, a2, a3), false);
  29.128 +  p->SetInterfaceId (T::iid);
  29.129 +  return p;
  29.130 +}
  29.131 +
  29.132 +template <typename T, typename T1, typename T2, typename T3, typename T4>
  29.133 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4)
  29.134 +{
  29.135 +  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4), false);
  29.136 +  p->SetInterfaceId (T::iid);
  29.137 +  return p;
  29.138 +}
  29.139 +
  29.140 +template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5>
  29.141 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
  29.142 +{
  29.143 +  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5), false);
  29.144 +  p->SetInterfaceId (T::iid);
  29.145 +  return p;
  29.146 +}
  29.147 +
  29.148 +template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
  29.149 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
  29.150 +{
  29.151 +  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5, a6), false);
  29.152 +  p->SetInterfaceId (T::iid);
  29.153 +  return p;
  29.154 +}
  29.155 +
  29.156 +template <typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
  29.157 +Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
  29.158 +{
  29.159 +  Ptr<T> p = Ptr<T> (new T (a1, a2, a3, a4, a5, a6, a7), false);
  29.160 +  p->SetInterfaceId (T::iid);
  29.161 +  return p;
  29.162 +}
  29.163 +
  29.164 +
  29.165  } // namespace ns3
  29.166  
  29.167  #endif /* OBJECT_H */
    30.1 --- a/src/core/ptr.cc	Sun Dec 30 19:36:44 2007 -0800
    30.2 +++ b/src/core/ptr.cc	Wed Jan 02 09:09:24 2008 +0100
    30.3 @@ -98,7 +98,7 @@
    30.4    Callback<void> cb = MakeCallback (&PtrTest::DestroyNotify, this);
    30.5    m_nDestroyed = false;
    30.6    {
    30.7 -    Ptr<NoCount> p = Create<NoCount> (cb);
    30.8 +    Ptr<NoCount> p = CreateObject<NoCount> (cb);
    30.9    }
   30.10    if (m_nDestroyed != 1)
   30.11      {
   30.12 @@ -108,7 +108,7 @@
   30.13    m_nDestroyed = 0;
   30.14    {
   30.15      Ptr<NoCount> p;
   30.16 -    p = Create<NoCount> (cb);
   30.17 +    p = CreateObject<NoCount> (cb);
   30.18      p = p;
   30.19    }
   30.20    if (m_nDestroyed != 1)
   30.21 @@ -119,7 +119,7 @@
   30.22    m_nDestroyed = 0;
   30.23    {
   30.24      Ptr<NoCount> p1;
   30.25 -    p1 = Create<NoCount> (cb);
   30.26 +    p1 = CreateObject<NoCount> (cb);
   30.27      Ptr<NoCount> p2 = p1;
   30.28    }
   30.29    if (m_nDestroyed != 1)
   30.30 @@ -130,7 +130,7 @@
   30.31    m_nDestroyed = 0;
   30.32    {
   30.33      Ptr<NoCount> p1;
   30.34 -    p1 = Create<NoCount> (cb);
   30.35 +    p1 = CreateObject<NoCount> (cb);
   30.36      Ptr<NoCount> p2;
   30.37      p2 = p1;
   30.38    }
   30.39 @@ -142,8 +142,8 @@
   30.40    m_nDestroyed = 0;
   30.41    {
   30.42      Ptr<NoCount> p1;
   30.43 -    p1 = Create<NoCount> (cb);
   30.44 -    Ptr<NoCount> p2 = Create<NoCount> (cb);
   30.45 +    p1 = CreateObject<NoCount> (cb);
   30.46 +    Ptr<NoCount> p2 = CreateObject<NoCount> (cb);
   30.47      p2 = p1;
   30.48    }
   30.49    if (m_nDestroyed != 2)
   30.50 @@ -154,9 +154,9 @@
   30.51    m_nDestroyed = 0;
   30.52    {
   30.53      Ptr<NoCount> p1;
   30.54 -    p1 = Create<NoCount> (cb);
   30.55 +    p1 = CreateObject<NoCount> (cb);
   30.56      Ptr<NoCount> p2;
   30.57 -    p2 = Create<NoCount> (cb);
   30.58 +    p2 = CreateObject<NoCount> (cb);
   30.59      p2 = p1;
   30.60    }
   30.61    if (m_nDestroyed != 2)
   30.62 @@ -167,8 +167,8 @@
   30.63    m_nDestroyed = 0;
   30.64    {
   30.65      Ptr<NoCount> p1;
   30.66 -    p1 = Create<NoCount> (cb);
   30.67 -    p1 = Create<NoCount> (cb);
   30.68 +    p1 = CreateObject<NoCount> (cb);
   30.69 +    p1 = CreateObject<NoCount> (cb);
   30.70    }
   30.71    if (m_nDestroyed != 2)
   30.72      {
   30.73 @@ -180,8 +180,8 @@
   30.74      Ptr<NoCount> p1;
   30.75      {
   30.76        Ptr<NoCount> p2;
   30.77 -      p1 = Create<NoCount> (cb);
   30.78 -      p2 = Create<NoCount> (cb);
   30.79 +      p1 = CreateObject<NoCount> (cb);
   30.80 +      p2 = CreateObject<NoCount> (cb);
   30.81        p2 = p1;
   30.82      }
   30.83      if (m_nDestroyed != 1)
   30.84 @@ -199,8 +199,8 @@
   30.85      Ptr<NoCount> p1;
   30.86      {
   30.87        Ptr<NoCount> p2;
   30.88 -      p1 = Create<NoCount> (cb);
   30.89 -      p2 = Create<NoCount> (cb);
   30.90 +      p1 = CreateObject<NoCount> (cb);
   30.91 +      p2 = CreateObject<NoCount> (cb);
   30.92        p2 = CallTest (p1);
   30.93      }
   30.94      if (m_nDestroyed != 1)
   30.95 @@ -242,7 +242,7 @@
   30.96    {
   30.97      NoCount *raw;
   30.98      {
   30.99 -      Ptr<NoCount> p = Create<NoCount> (cb);
  30.100 +      Ptr<NoCount> p = CreateObject<NoCount> (cb);
  30.101        {
  30.102          Ptr<NoCount const> p1 = p;
  30.103        }
  30.104 @@ -259,7 +259,7 @@
  30.105  
  30.106    m_nDestroyed = 0;
  30.107    {
  30.108 -    Ptr<NoCount> p = Create<NoCount> (cb);
  30.109 +    Ptr<NoCount> p = CreateObject<NoCount> (cb);
  30.110      const NoCount *v1 = PeekPointer (p);
  30.111      NoCount *v2 = PeekPointer (p);
  30.112      v1->Nothing ();
  30.113 @@ -271,8 +271,8 @@
  30.114      }
  30.115  
  30.116    {
  30.117 -    Ptr<Object> p0 = Create<NoCount> (cb);
  30.118 -    Ptr<NoCount> p1 = Create<NoCount> (cb);
  30.119 +    Ptr<Object> p0 = CreateObject<NoCount> (cb);
  30.120 +    Ptr<NoCount> p1 = CreateObject<NoCount> (cb);
  30.121      if (p0 == p1)
  30.122        {
  30.123          ok = false;
  30.124 @@ -287,12 +287,12 @@
  30.125    }
  30.126  
  30.127    {
  30.128 -    Ptr<NoCount> p = Create<NoCount> (cb);
  30.129 +    Ptr<NoCount> p = CreateObject<NoCount> (cb);
  30.130      Callback<void> callback = MakeCallback (&NoCount::Nothing, p);
  30.131      callback ();
  30.132    }
  30.133    {
  30.134 -    Ptr<const NoCount> p = Create<NoCount> (cb);
  30.135 +    Ptr<const NoCount> p = CreateObject<NoCount> (cb);
  30.136      Callback<void> callback = MakeCallback (&NoCount::Nothing, p);
  30.137      callback ();
  30.138    }
  30.139 @@ -301,7 +301,7 @@
  30.140  #if 0
  30.141    // as expected, fails compilation.
  30.142    {
  30.143 -    Ptr<const Object> p = Create<NoCount> (cb);
  30.144 +    Ptr<const Object> p = CreateObject<NoCount> (cb);
  30.145      Callback<void> callback = MakeCallback (&NoCount::Nothing, p);
  30.146    }
  30.147    // local types are not allowed as arguments to a template.
    31.1 --- a/src/devices/csma/csma-ipv4-topology.cc	Sun Dec 30 19:36:44 2007 -0800
    31.2 +++ b/src/devices/csma/csma-ipv4-topology.cc	Wed Jan 02 09:09:24 2008 +0100
    31.3 @@ -42,7 +42,7 @@
    31.4    Ptr<Queue> q = Queue::CreateDefault ();
    31.5  
    31.6    // assume full-duplex
    31.7 -  Ptr<CsmaNetDevice> nd = Create<CsmaNetDevice> (node, addr, 
    31.8 +  Ptr<CsmaNetDevice> nd = CreateObject<CsmaNetDevice> (node, addr, 
    31.9      ns3::CsmaNetDevice::IP_ARP, true, true);
   31.10  
   31.11    nd->AddQueue(q);
   31.12 @@ -58,13 +58,13 @@
   31.13  {
   31.14    Ptr<Queue> q = Queue::CreateDefault ();
   31.15  
   31.16 -  Ptr<CsmaNetDevice> nd0 = Create<CsmaNetDevice> (n1, addr,
   31.17 +  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> (n1, addr,
   31.18                                                    ns3::CsmaNetDevice::LLC,
   31.19                                                    true, false);
   31.20    nd0->AddQueue(q);
   31.21    nd0->Attach (ch);
   31.22  
   31.23 -  Ptr<CsmaNetDevice> nd1 = Create<CsmaNetDevice> (n1, addr,
   31.24 +  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr,
   31.25                                                    ns3::CsmaNetDevice::LLC,
   31.26                                                    false, true);
   31.27    nd1->AddQueue(q);
   31.28 @@ -78,13 +78,13 @@
   31.29  {
   31.30    Ptr<Queue> q = Queue::CreateDefault ();
   31.31  
   31.32 -  Ptr<CsmaNetDevice> nd0 = Create<CsmaNetDevice> (n1, addr,
   31.33 +  Ptr<CsmaNetDevice> nd0 = CreateObject<CsmaNetDevice> (n1, addr,
   31.34                                                    ns3::CsmaNetDevice::RAW,
   31.35                                                    true, false);
   31.36    nd0->AddQueue(q);
   31.37    nd0->Attach (ch);
   31.38  
   31.39 -  Ptr<CsmaNetDevice> nd1 = Create<CsmaNetDevice> (n1, addr,
   31.40 +  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr,
   31.41                                                    ns3::CsmaNetDevice::RAW,
   31.42                                                    false, true);
   31.43    nd1->AddQueue(q);
    32.1 --- a/src/devices/csma/csma-topology.cc	Sun Dec 30 19:36:44 2007 -0800
    32.2 +++ b/src/devices/csma/csma-topology.cc	Wed Jan 02 09:09:24 2008 +0100
    32.3 @@ -36,7 +36,7 @@
    32.4    const DataRate& bps,
    32.5    const Time& delay)
    32.6  {
    32.7 -  Ptr<CsmaChannel> channel = Create<CsmaChannel> (bps, delay);
    32.8 +  Ptr<CsmaChannel> channel = CreateObject<CsmaChannel> (bps, delay);
    32.9  
   32.10    return channel;
   32.11  }
   32.12 @@ -48,7 +48,7 @@
   32.13    Ptr<CsmaChannel> ch,
   32.14    MacAddress addr)
   32.15  {
   32.16 -  Ptr<CsmaNetDevice> nd1 = Create<CsmaNetDevice> (n1, addr, 
   32.17 +  Ptr<CsmaNetDevice> nd1 = CreateObject<CsmaNetDevice> (n1, addr, 
   32.18                                                        ns3::CsmaNetDevice::ETHERNET_V1);
   32.19  
   32.20    Ptr<Queue> q = Queue::CreateDefault ();
   32.21 @@ -63,7 +63,7 @@
   32.22                                          Ptr<CsmaNetDevice> ndSrc,
   32.23                                          Ptr<CsmaNetDevice> ndDest)
   32.24  {
   32.25 -  Ptr<PacketSocket> socket = Create<PacketSocket> ();
   32.26 +  Ptr<PacketSocket> socket = CreateObject<PacketSocket> ();
   32.27    socket->Bind(ndSrc);
   32.28    socket->Connect(ndDest->GetAddress());
   32.29    app->Connect(socket);
   32.30 @@ -76,7 +76,7 @@
   32.31                                          Ptr<CsmaNetDevice> ndSrc,
   32.32                                          MacAddress macAddr)
   32.33  {
   32.34 -  Ptr<PacketSocket> socket = Create<PacketSocket> ();
   32.35 +  Ptr<PacketSocket> socket = CreateObject<PacketSocket> ();
   32.36    socket->Bind(ndSrc);
   32.37    socket->Connect(macAddr);
   32.38    app->Connect(socket);
    33.1 --- a/src/devices/point-to-point/point-to-point-topology.cc	Sun Dec 30 19:36:44 2007 -0800
    33.2 +++ b/src/devices/point-to-point/point-to-point-topology.cc	Wed Jan 02 09:09:24 2008 +0100
    33.3 @@ -45,15 +45,15 @@
    33.4    const DataRate& bps,
    33.5    const Time& delay)
    33.6  {
    33.7 -  Ptr<PointToPointChannel> channel = Create<PointToPointChannel> (bps, delay);
    33.8 +  Ptr<PointToPointChannel> channel = CreateObject<PointToPointChannel> (bps, delay);
    33.9  
   33.10 -  Ptr<PointToPointNetDevice> net1 = Create<PointToPointNetDevice> (n1);
   33.11 +  Ptr<PointToPointNetDevice> net1 = CreateObject<PointToPointNetDevice> (n1);
   33.12  
   33.13    Ptr<Queue> q = Queue::CreateDefault ();
   33.14    net1->AddQueue(q);
   33.15    net1->Attach (channel);
   33.16    
   33.17 -  Ptr<PointToPointNetDevice> net2 = Create<PointToPointNetDevice> (n2);
   33.18 +  Ptr<PointToPointNetDevice> net2 = CreateObject<PointToPointNetDevice> (n2);
   33.19  
   33.20    q = Queue::CreateDefault ();
   33.21    net2->AddQueue(q);
    34.1 --- a/src/devices/wifi/propagation-delay-model.cc	Sun Dec 30 19:36:44 2007 -0800
    34.2 +++ b/src/devices/wifi/propagation-delay-model.cc	Wed Jan 02 09:09:24 2008 +0100
    34.3 @@ -56,10 +56,10 @@
    34.4  {
    34.5    switch (g_modelType.GetValue ()) {
    34.6    case CONSTANT_SPEED:
    34.7 -    return Create<ConstantSpeedPropagationDelayModel> (g_speed.GetValue ());
    34.8 +    return CreateObject<ConstantSpeedPropagationDelayModel> (g_speed.GetValue ());
    34.9      break;
   34.10    case RANDOM:
   34.11 -    return Create<RandomPropagationDelayModel> ();
   34.12 +    return CreateObject<RandomPropagationDelayModel> ();
   34.13      break;
   34.14    default:
   34.15      NS_ASSERT (false);
    35.1 --- a/src/devices/wifi/propagation-loss-model.cc	Sun Dec 30 19:36:44 2007 -0800
    35.2 +++ b/src/devices/wifi/propagation-loss-model.cc	Wed Jan 02 09:09:24 2008 +0100
    35.3 @@ -89,13 +89,13 @@
    35.4  {
    35.5    switch (g_modelType.GetValue ()) {
    35.6    case FRIIS:
    35.7 -    return Create<FriisPropagationLossModel> ();
    35.8 +    return CreateObject<FriisPropagationLossModel> ();
    35.9      break;
   35.10    case RANDOM:
   35.11 -    return Create<RandomPropagationLossModel> ();
   35.12 +    return CreateObject<RandomPropagationLossModel> ();
   35.13      break;
   35.14    case LOG_DISTANCE:
   35.15 -    return Create<LogDistancePropagationLossModel> ();
   35.16 +    return CreateObject<LogDistancePropagationLossModel> ();
   35.17      break;
   35.18    default:
   35.19      NS_ASSERT (false);
   35.20 @@ -251,10 +251,10 @@
   35.21  {
   35.22    switch (g_logDistanceReferenceType.GetValue ()) {
   35.23    case RANDOM:
   35.24 -    return Create<RandomPropagationLossModel> ();
   35.25 +    return CreateObject<RandomPropagationLossModel> ();
   35.26      break;
   35.27    case FRIIS:
   35.28 -    return Create<FriisPropagationLossModel> ();
   35.29 +    return CreateObject<FriisPropagationLossModel> ();
   35.30      break;
   35.31    case LOG_DISTANCE:
   35.32    default:
   35.33 @@ -288,8 +288,8 @@
   35.34     *      
   35.35     * rx = rx0(tx) - 10 * n * log (d/d0)
   35.36     */
   35.37 -  static Ptr<StaticMobilityModel> zero = Create<StaticMobilityModel> (Vector (0.0, 0.0, 0.0));
   35.38 -  static Ptr<StaticMobilityModel> reference = Create<StaticMobilityModel> (Vector (m_referenceDistance, 0.0, 0.0));
   35.39 +  static Ptr<StaticMobilityModel> zero = CreateObject<StaticMobilityModel> (Vector (0.0, 0.0, 0.0));
   35.40 +  static Ptr<StaticMobilityModel> reference = CreateObject<StaticMobilityModel> (Vector (m_referenceDistance, 0.0, 0.0));
   35.41    double rx0 = m_reference->GetRxPower (txPowerDbm, zero, reference);
   35.42    double pathLossDb = 10 * m_exponent * log10 (distance / m_referenceDistance);
   35.43    double rxPowerDbm = rx0 - pathLossDb;
    36.1 --- a/src/devices/wifi/wifi-net-device.cc	Sun Dec 30 19:36:44 2007 -0800
    36.2 +++ b/src/devices/wifi/wifi-net-device.cc	Wed Jan 02 09:09:24 2008 +0100
    36.3 @@ -178,7 +178,7 @@
    36.4    EnableBroadcast (Mac48Address ("ff:ff:ff:ff:ff:ff"));
    36.5  
    36.6    // the physical layer.
    36.7 -  m_phy = Create<WifiPhy> (this);
    36.8 +  m_phy = CreateObject<WifiPhy> (this);
    36.9  
   36.10    // the rate control algorithm
   36.11    switch (WifiDefaultParameters::GetRateControlAlgorithm ()) {
    37.1 --- a/src/internet-node/arp-l3-protocol.cc	Sun Dec 30 19:36:44 2007 -0800
    37.2 +++ b/src/internet-node/arp-l3-protocol.cc	Wed Jan 02 09:09:24 2008 +0100
    37.3 @@ -40,7 +40,6 @@
    37.4    : m_node (node)
    37.5  {
    37.6    NS_LOG_FUNCTION;
    37.7 -  SetInterfaceId (ArpL3Protocol::iid);
    37.8  }
    37.9  
   37.10  ArpL3Protocol::~ArpL3Protocol ()
    38.1 --- a/src/internet-node/internet-node.cc	Sun Dec 30 19:36:44 2007 -0800
    38.2 +++ b/src/internet-node/internet-node.cc	Wed Jan 02 09:09:24 2008 +0100
    38.3 @@ -51,8 +51,8 @@
    38.4  void
    38.5  InternetNode::Construct (void)
    38.6  {
    38.7 -  Ptr<Ipv4L3Protocol> ipv4 = Create<Ipv4L3Protocol> (this);
    38.8 -  Ptr<ArpL3Protocol> arp = Create<ArpL3Protocol> (this);
    38.9 +  Ptr<Ipv4L3Protocol> ipv4 = CreateObject<Ipv4L3Protocol> (this);
   38.10 +  Ptr<ArpL3Protocol> arp = CreateObject<ArpL3Protocol> (this);
   38.11    // XXX remove the PeekPointer below.
   38.12    RegisterProtocolHandler (MakeCallback (&Ipv4L3Protocol::Receive, PeekPointer (ipv4)), 
   38.13                             Ipv4L3Protocol::PROT_NUMBER, 0);
   38.14 @@ -60,12 +60,12 @@
   38.15                             ArpL3Protocol::PROT_NUMBER, 0);
   38.16  
   38.17  
   38.18 -  Ptr<Ipv4L4Demux> ipv4L4Demux = Create<Ipv4L4Demux> (this);
   38.19 -  Ptr<UdpL4Protocol> udp = Create<UdpL4Protocol> (this);
   38.20 +  Ptr<Ipv4L4Demux> ipv4L4Demux = CreateObject<Ipv4L4Demux> (this);
   38.21 +  Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> (this);
   38.22    ipv4L4Demux->Insert (udp);
   38.23  
   38.24 -  Ptr<UdpImpl> udpImpl = Create<UdpImpl> (udp);
   38.25 -  Ptr<Ipv4Impl> ipv4Impl = Create<Ipv4Impl> (ipv4);
   38.26 +  Ptr<UdpImpl> udpImpl = CreateObject<UdpImpl> (udp);
   38.27 +  Ptr<Ipv4Impl> ipv4Impl = CreateObject<Ipv4Impl> (ipv4);
   38.28  
   38.29    Object::AddInterface (ipv4);
   38.30    Object::AddInterface (arp);
    39.1 --- a/src/internet-node/ipv4-l3-protocol.cc	Sun Dec 30 19:36:44 2007 -0800
    39.2 +++ b/src/internet-node/ipv4-l3-protocol.cc	Wed Jan 02 09:09:24 2008 +0100
    39.3 @@ -158,8 +158,7 @@
    39.4      m_node (node)
    39.5  {
    39.6    NS_LOG_FUNCTION;
    39.7 -  SetInterfaceId (Ipv4L3Protocol::iid);
    39.8 -  m_staticRouting = Create<Ipv4StaticRouting> ();
    39.9 +  m_staticRouting = CreateObject<Ipv4StaticRouting> ();
   39.10    AddRoutingProtocol (m_staticRouting, 0);
   39.11    SetupLoopback ();
   39.12  }
   39.13 @@ -185,7 +184,7 @@
   39.14  {
   39.15    NS_LOG_FUNCTION;
   39.16  
   39.17 -  Ptr<Ipv4LoopbackInterface> interface = Create<Ipv4LoopbackInterface> (m_node);
   39.18 +  Ptr<Ipv4LoopbackInterface> interface = CreateObject<Ipv4LoopbackInterface> (m_node);
   39.19    interface->SetAddress (Ipv4Address::GetLoopback ());
   39.20    interface->SetNetworkMask (Ipv4Mask::GetLoopback ());
   39.21    uint32_t index = AddIpv4Interface (interface);
   39.22 @@ -433,7 +432,7 @@
   39.23  {
   39.24    NS_LOG_FUNCTION;
   39.25    NS_LOG_PARAMS (this << &device);
   39.26 -  Ptr<Ipv4Interface> interface = Create<ArpIpv4Interface> (m_node, device);
   39.27 +  Ptr<Ipv4Interface> interface = CreateObject<ArpIpv4Interface> (m_node, device);
   39.28    return AddIpv4Interface (interface);
   39.29  }
   39.30  
    40.1 --- a/src/internet-node/ipv4-l4-demux.cc	Sun Dec 30 19:36:44 2007 -0800
    40.2 +++ b/src/internet-node/ipv4-l4-demux.cc	Wed Jan 02 09:09:24 2008 +0100
    40.3 @@ -63,9 +63,7 @@
    40.4  
    40.5  Ipv4L4Demux::Ipv4L4Demux (Ptr<Node> node)
    40.6    : m_node (node)
    40.7 -{
    40.8 -  SetInterfaceId (Ipv4L4Demux::iid);
    40.9 -}
   40.10 +{}
   40.11  
   40.12  Ipv4L4Demux::~Ipv4L4Demux()
   40.13  {}
    41.1 --- a/src/internet-node/udp-l4-protocol.cc	Sun Dec 30 19:36:44 2007 -0800
    41.2 +++ b/src/internet-node/udp-l4-protocol.cc	Wed Jan 02 09:09:24 2008 +0100
    41.3 @@ -68,7 +68,7 @@
    41.4  UdpL4Protocol::CreateSocket (void)
    41.5  {
    41.6    NS_LOG_FUNCTION;
    41.7 -  Ptr<Socket> socket = Create<UdpSocket> (m_node, this);
    41.8 +  Ptr<Socket> socket = CreateObject<UdpSocket> (m_node, this);
    41.9    return socket;
   41.10  }
   41.11  
    42.1 --- a/src/internet-node/udp-socket.cc	Sun Dec 30 19:36:44 2007 -0800
    42.2 +++ b/src/internet-node/udp-socket.cc	Wed Jan 02 09:09:24 2008 +0100
    42.3 @@ -383,9 +383,9 @@
    42.4    // Create topology
    42.5    
    42.6    // Receiver Node
    42.7 -  Ptr<Node> rxNode = Create<InternetNode> ();
    42.8 -  Ptr<PointToPointNetDevice> rxDev = Create<PointToPointNetDevice> (rxNode);
    42.9 -  rxDev->AddQueue(Create<DropTailQueue> ());
   42.10 +  Ptr<Node> rxNode = CreateObject<InternetNode> ();
   42.11 +  Ptr<PointToPointNetDevice> rxDev = CreateObject<PointToPointNetDevice> (rxNode);
   42.12 +  rxDev->AddQueue(CreateObject<DropTailQueue> ());
   42.13    Ptr<Ipv4> ipv4 = rxNode->QueryInterface<Ipv4> (Ipv4::iid);
   42.14    uint32_t netdev_idx = ipv4->AddInterface (rxDev);
   42.15    ipv4->SetAddress (netdev_idx, Ipv4Address ("10.0.0.1"));
   42.16 @@ -393,9 +393,9 @@
   42.17    ipv4->SetUp (netdev_idx);
   42.18  
   42.19    // Sender Node
   42.20 -  Ptr<Node> txNode = Create<InternetNode> ();
   42.21 -  Ptr<PointToPointNetDevice> txDev = Create<PointToPointNetDevice> (txNode);
   42.22 -  txDev->AddQueue(Create<DropTailQueue> ());
   42.23 +  Ptr<Node> txNode = CreateObject<InternetNode> ();
   42.24 +  Ptr<PointToPointNetDevice> txDev = CreateObject<PointToPointNetDevice> (txNode);
   42.25 +  txDev->AddQueue(CreateObject<DropTailQueue> ());
   42.26    ipv4 = txNode->QueryInterface<Ipv4> (Ipv4::iid);
   42.27    netdev_idx = ipv4->AddInterface (txDev);
   42.28    ipv4->SetAddress (netdev_idx, Ipv4Address ("10.0.0.2"));
   42.29 @@ -403,7 +403,7 @@
   42.30    ipv4->SetUp (netdev_idx);
   42.31  
   42.32    // link the two nodes
   42.33 -  Ptr<PointToPointChannel> channel = Create<PointToPointChannel> ();
   42.34 +  Ptr<PointToPointChannel> channel = CreateObject<PointToPointChannel> ();
   42.35    rxDev->Attach (channel);
   42.36    txDev->Attach (channel);
   42.37  
    43.1 --- a/src/mobility/hierarchical-mobility-model.cc	Sun Dec 30 19:36:44 2007 -0800
    43.2 +++ b/src/mobility/hierarchical-mobility-model.cc	Wed Jan 02 09:09:24 2008 +0100
    43.3 @@ -32,12 +32,12 @@
    43.4      m_parent->QueryInterface<MobilityModelNotifier> (MobilityModelNotifier::iid);
    43.5    if (childNotifier == 0)
    43.6      {
    43.7 -      childNotifier = Create<MobilityModelNotifier> ();
    43.8 +      childNotifier = CreateObject<MobilityModelNotifier> ();
    43.9        child->AddInterface (childNotifier);
   43.10      }
   43.11    if (parentNotifier == 0)
   43.12      {
   43.13 -      parentNotifier = Create<MobilityModelNotifier> ();
   43.14 +      parentNotifier = CreateObject<MobilityModelNotifier> ();
   43.15        parent->AddInterface (parentNotifier);
   43.16      }
   43.17    childNotifier->TraceConnect ("/course-changed", MakeCallback (&HierarchicalMobilityModel::ChildChanged, this));
    44.1 --- a/src/mobility/mobility-model-notifier.cc	Sun Dec 30 19:36:44 2007 -0800
    44.2 +++ b/src/mobility/mobility-model-notifier.cc	Wed Jan 02 09:09:24 2008 +0100
    44.3 @@ -29,9 +29,7 @@
    44.4  				    MobilityModelNotifier::iid);
    44.5  
    44.6  MobilityModelNotifier::MobilityModelNotifier ()
    44.7 -{
    44.8 -  SetInterfaceId (MobilityModelNotifier::iid);
    44.9 -}
   44.10 +{}
   44.11  
   44.12  void 
   44.13  MobilityModelNotifier::Notify (Ptr<const MobilityModel> position) const
    45.1 --- a/src/mobility/mobility-model.cc	Sun Dec 30 19:36:44 2007 -0800
    45.2 +++ b/src/mobility/mobility-model.cc	Wed Jan 02 09:09:24 2008 +0100
    45.3 @@ -26,9 +26,7 @@
    45.4  const InterfaceId MobilityModel::iid = MakeInterfaceId ("MobilityModel", Object::iid);
    45.5  
    45.6  MobilityModel::MobilityModel ()
    45.7 -{
    45.8 -  SetInterfaceId (MobilityModel::iid);
    45.9 -}
   45.10 +{}
   45.11  
   45.12  MobilityModel::~MobilityModel ()
   45.13  {}
    46.1 --- a/src/mobility/ns2-mobility-file-topology.cc	Sun Dec 30 19:36:44 2007 -0800
    46.2 +++ b/src/mobility/ns2-mobility-file-topology.cc	Wed Jan 02 09:09:24 2008 +0100
    46.3 @@ -53,7 +53,7 @@
    46.4      object->QueryInterface<StaticSpeedMobilityModel> (StaticSpeedMobilityModel::iid);
    46.5    if (model == 0)
    46.6      {
    46.7 -      model = Create<StaticSpeedMobilityModel> ();
    46.8 +      model = CreateObject<StaticSpeedMobilityModel> ();
    46.9        object->AddInterface (model);
   46.10      }
   46.11    return model;
    47.1 --- a/src/mobility/random-direction-2d-mobility-model.cc	Sun Dec 30 19:36:44 2007 -0800
    47.2 +++ b/src/mobility/random-direction-2d-mobility-model.cc	Wed Jan 02 09:09:24 2008 +0100
    47.3 @@ -103,7 +103,7 @@
    47.4        g_speedVariable.IsDirty () ||
    47.5        g_pauseVariable.IsDirty ())
    47.6      {
    47.7 -      parameters = Create<RandomDirection2dMobilityModelParameters> ();
    47.8 +      parameters = CreateObject<RandomDirection2dMobilityModelParameters> ();
    47.9        g_bounds.ClearDirtyFlag ();
   47.10        g_speedVariable.ClearDirtyFlag ();
   47.11        g_pauseVariable.ClearDirtyFlag ();
   47.12 @@ -115,14 +115,12 @@
   47.13  RandomDirection2dMobilityModel::RandomDirection2dMobilityModel ()
   47.14    : m_parameters (RandomDirection2dMobilityModelParameters::GetCurrent ())
   47.15  {
   47.16 -  SetInterfaceId (RandomDirection2dMobilityModel::iid);
   47.17    m_event = Simulator::ScheduleNow (&RandomDirection2dMobilityModel::Start, this);
   47.18  }
   47.19  RandomDirection2dMobilityModel::RandomDirection2dMobilityModel 
   47.20  (Ptr<RandomDirection2dMobilityModelParameters> parameters)
   47.21    : m_parameters (parameters)
   47.22  {
   47.23 -  SetInterfaceId (RandomDirection2dMobilityModel::iid);
   47.24    m_event = Simulator::ScheduleNow (&RandomDirection2dMobilityModel::Start, this);
   47.25  }
   47.26  void 
    48.1 --- a/src/mobility/random-position.cc	Sun Dec 30 19:36:44 2007 -0800
    48.2 +++ b/src/mobility/random-position.cc	Wed Jan 02 09:09:24 2008 +0100
    48.3 @@ -69,7 +69,6 @@
    48.4  
    48.5  RandomPosition::RandomPosition ()
    48.6  {
    48.7 -  Object::SetInterfaceId (RandomPosition::iid);
    48.8  }
    48.9  
   48.10  RandomPosition::~RandomPosition ()
    49.1 --- a/src/mobility/random-walk-2d-mobility-model.cc	Sun Dec 30 19:36:44 2007 -0800
    49.2 +++ b/src/mobility/random-walk-2d-mobility-model.cc	Wed Jan 02 09:09:24 2008 +0100
    49.3 @@ -126,7 +126,7 @@
    49.4        g_modeTime.IsDirty () ||
    49.5        g_rectangle.IsDirty ())
    49.6      {
    49.7 -      parameters = Create<RandomWalk2dMobilityModelParameters> ();
    49.8 +      parameters = CreateObject<RandomWalk2dMobilityModelParameters> ();
    49.9      }
   49.10    return parameters;
   49.11  }
   49.12 @@ -134,7 +134,6 @@
   49.13  RandomWalk2dMobilityModel::RandomWalk2dMobilityModel ()
   49.14    : m_parameters (RandomWalk2dMobilityModelParameters::GetCurrent ())
   49.15  {
   49.16 -  SetInterfaceId (RandomWalk2dMobilityModel::iid);
   49.17    m_event = Simulator::ScheduleNow (&RandomWalk2dMobilityModel::Start, this);
   49.18  }
   49.19  
    50.1 --- a/src/mobility/random-waypoint-mobility-model.cc	Sun Dec 30 19:36:44 2007 -0800
    50.2 +++ b/src/mobility/random-waypoint-mobility-model.cc	Wed Jan 02 09:09:24 2008 +0100
    50.3 @@ -96,7 +96,7 @@
    50.4        g_pause.IsDirty () ||
    50.5        g_speed.IsDirty ())
    50.6      {
    50.7 -      parameters = Create<RandomWaypointMobilityModelParameters> ();
    50.8 +      parameters = CreateObject<RandomWaypointMobilityModelParameters> ();
    50.9      }
   50.10    return parameters;
   50.11  }
    51.1 --- a/src/mobility/static-mobility-model.cc	Sun Dec 30 19:36:44 2007 -0800
    51.2 +++ b/src/mobility/static-mobility-model.cc	Wed Jan 02 09:09:24 2008 +0100
    51.3 @@ -25,14 +25,10 @@
    51.4                                                                             MobilityModel::iid);
    51.5    
    51.6  StaticMobilityModel::StaticMobilityModel ()
    51.7 -{
    51.8 -  SetInterfaceId (StaticMobilityModel::iid);
    51.9 -}
   51.10 +{}
   51.11  StaticMobilityModel::StaticMobilityModel (const Vector &position)
   51.12    : m_position (position)
   51.13 -{
   51.14 -  SetInterfaceId (StaticMobilityModel::iid);
   51.15 -}
   51.16 +{}
   51.17  StaticMobilityModel::~StaticMobilityModel ()
   51.18  {}
   51.19  
    52.1 --- a/src/mobility/static-speed-mobility-model.cc	Sun Dec 30 19:36:44 2007 -0800
    52.2 +++ b/src/mobility/static-speed-mobility-model.cc	Wed Jan 02 09:09:24 2008 +0100
    52.3 @@ -30,20 +30,14 @@
    52.4  
    52.5  
    52.6  StaticSpeedMobilityModel::StaticSpeedMobilityModel ()
    52.7 -{
    52.8 -  SetInterfaceId (StaticSpeedMobilityModel::iid);
    52.9 -}
   52.10 +{}
   52.11  StaticSpeedMobilityModel::StaticSpeedMobilityModel (const Vector &position)
   52.12    : m_helper (position)
   52.13 -{
   52.14 -  SetInterfaceId (StaticSpeedMobilityModel::iid);
   52.15 -}
   52.16 +{}
   52.17  StaticSpeedMobilityModel::StaticSpeedMobilityModel (const Vector &position,
   52.18                                                      const Vector &speed)
   52.19    : m_helper (position, speed)
   52.20 -{
   52.21 -  SetInterfaceId (StaticSpeedMobilityModel::iid);
   52.22 -}
   52.23 +{}
   52.24  
   52.25  StaticSpeedMobilityModel::~StaticSpeedMobilityModel ()
   52.26  {}
    53.1 --- a/src/node/channel.cc	Sun Dec 30 19:36:44 2007 -0800
    53.2 +++ b/src/node/channel.cc	Wed Jan 02 09:09:24 2008 +0100
    53.3 @@ -30,7 +30,6 @@
    53.4    : m_name("Channel")
    53.5  {
    53.6    NS_LOG_FUNCTION;
    53.7 -  SetInterfaceId (Channel::iid);
    53.8  }
    53.9  
   53.10  Channel::Channel (std::string name)
   53.11 @@ -38,7 +37,6 @@
   53.12  {
   53.13    NS_LOG_FUNCTION;
   53.14    NS_LOG_PARAMS (this << name);
   53.15 -  SetInterfaceId (Channel::iid);
   53.16  }
   53.17  
   53.18  Channel::~Channel ()
    54.1 --- a/src/node/ipv4.cc	Sun Dec 30 19:36:44 2007 -0800
    54.2 +++ b/src/node/ipv4.cc	Wed Jan 02 09:09:24 2008 +0100
    54.3 @@ -28,9 +28,7 @@
    54.4  const InterfaceId Ipv4::iid = MakeInterfaceId ("Ipv4", Object::iid);
    54.5  
    54.6  Ipv4::Ipv4 ()
    54.7 -{
    54.8 -  SetInterfaceId (Ipv4::iid);
    54.9 -}
   54.10 +{}
   54.11  
   54.12  Ipv4::~Ipv4 ()
   54.13  {}
    55.1 --- a/src/node/net-device.cc	Sun Dec 30 19:36:44 2007 -0800
    55.2 +++ b/src/node/net-device.cc	Wed Jan 02 09:09:24 2008 +0100
    55.3 @@ -47,7 +47,6 @@
    55.4    m_isPointToPoint (false)
    55.5  {
    55.6    NS_LOG_FUNCTION;
    55.7 -  SetInterfaceId (NetDevice::iid);
    55.8    m_node->AddDevice (this);
    55.9  }
   55.10  
    56.1 --- a/src/node/node.cc	Sun Dec 30 19:36:44 2007 -0800
    56.2 +++ b/src/node/node.cc	Wed Jan 02 09:09:24 2008 +0100
    56.3 @@ -106,9 +106,8 @@
    56.4  void
    56.5  Node::Construct (void)
    56.6  {
    56.7 -  SetInterfaceId (Node::iid);
    56.8    m_id = NodeList::Add (this);
    56.9 -  Ptr<PacketSocketFactory> socketFactory = Create<PacketSocketFactory> ();
   56.10 +  Ptr<PacketSocketFactory> socketFactory = CreateObject<PacketSocketFactory> ();
   56.11    AddInterface (socketFactory);
   56.12  }
   56.13    
    57.1 --- a/src/node/packet-socket-factory.cc	Sun Dec 30 19:36:44 2007 -0800
    57.2 +++ b/src/node/packet-socket-factory.cc	Wed Jan 02 09:09:24 2008 +0100
    57.3 @@ -28,14 +28,12 @@
    57.4                                                                SocketFactory::iid);
    57.5  
    57.6  PacketSocketFactory::PacketSocketFactory ()
    57.7 -{
    57.8 -  SetInterfaceId (PacketSocketFactory::iid);
    57.9 -}
   57.10 +{}
   57.11  
   57.12  Ptr<Socket> PacketSocketFactory::CreateSocket (void)
   57.13  {
   57.14    Ptr<Node> node = QueryInterface<Node> (Node::iid);
   57.15 -  Ptr<PacketSocket> socket = Create<PacketSocket> (node);
   57.16 +  Ptr<PacketSocket> socket = CreateObject<PacketSocket> (node);
   57.17    return socket;
   57.18  } 
   57.19  } // namespace ns3
    58.1 --- a/src/node/queue.cc	Sun Dec 30 19:36:44 2007 -0800
    58.2 +++ b/src/node/queue.cc	Wed Jan 02 09:09:24 2008 +0100
    58.3 @@ -106,7 +106,6 @@
    58.4    m_nTotalDroppedPackets(0)
    58.5  {
    58.6    NS_LOG_FUNCTION;
    58.7 -  SetInterfaceId (Queue::iid);
    58.8  }
    58.9  
   58.10  Queue::~Queue()
    59.1 --- a/src/node/socket-factory.cc	Sun Dec 30 19:36:44 2007 -0800
    59.2 +++ b/src/node/socket-factory.cc	Wed Jan 02 09:09:24 2008 +0100
    59.3 @@ -25,8 +25,6 @@
    59.4  const InterfaceId SocketFactory::iid = MakeInterfaceId ("SocketFactory", Object::iid);
    59.5  
    59.6  SocketFactory::SocketFactory ()
    59.7 -{
    59.8 -  SetInterfaceId (SocketFactory::iid);
    59.9 -}
   59.10 +{}
   59.11  
   59.12  } // namespace ns3
    60.1 --- a/src/node/udp.cc	Sun Dec 30 19:36:44 2007 -0800
    60.2 +++ b/src/node/udp.cc	Wed Jan 02 09:09:24 2008 +0100
    60.3 @@ -25,8 +25,6 @@
    60.4  const InterfaceId Udp::iid = MakeInterfaceId ("Udp", SocketFactory::iid);
    60.5  
    60.6  Udp::Udp ()
    60.7 -{
    60.8 -  SetInterfaceId (Udp::iid);
    60.9 -}
   60.10 +{}
   60.11  
   60.12  } // namespace ns3
    61.1 --- a/src/routing/global-routing/global-route-manager-impl.cc	Sun Dec 30 19:36:44 2007 -0800
    61.2 +++ b/src/routing/global-routing/global-route-manager-impl.cc	Wed Jan 02 09:09:24 2008 +0100
    61.3 @@ -366,7 +366,7 @@
    61.4        NS_LOG_LOGIC ("Adding GlobalRouter interface to node " << 
    61.5          node->GetId ());
    61.6  
    61.7 -      Ptr<GlobalRouter> globalRouter = Create<GlobalRouter> ();
    61.8 +      Ptr<GlobalRouter> globalRouter = CreateObject<GlobalRouter> ();
    61.9        node->AddInterface (globalRouter);
   61.10      }
   61.11  }
    62.1 --- a/src/routing/global-routing/global-router-interface.cc	Sun Dec 30 19:36:44 2007 -0800
    62.2 +++ b/src/routing/global-routing/global-router-interface.cc	Wed Jan 02 09:09:24 2008 +0100
    62.3 @@ -438,7 +438,6 @@
    62.4    : m_LSAs()
    62.5  {
    62.6    NS_LOG_FUNCTION;
    62.7 -  SetInterfaceId (GlobalRouter::iid);
    62.8    m_routerId.Set(GlobalRouteManager::AllocateRouterId ());
    62.9  }
   62.10  
    63.1 --- a/src/routing/olsr/olsr-agent-impl.cc	Sun Dec 30 19:36:44 2007 -0800
    63.2 +++ b/src/routing/olsr/olsr-agent-impl.cc	Wed Jan 02 09:09:24 2008 +0100
    63.3 @@ -161,9 +161,6 @@
    63.4    m_midTimer.SetFunction (&AgentImpl::MidTimerExpire, this);
    63.5    m_queuedMessagesTimer.SetFunction (&AgentImpl::SendQueuedMessages, this);
    63.6  
    63.7 -
    63.8 -  SetInterfaceId (AgentImpl::iid);
    63.9 -
   63.10    // Aggregate with the Node, so that OLSR dies when the node is destroyed.
   63.11    node->AddInterface (this);
   63.12  
   63.13 @@ -234,7 +231,7 @@
   63.14  
   63.15    NS_LOG_DEBUG ("Starting OLSR on node " << m_mainAddress);
   63.16  
   63.17 -  m_routingTable = Create<RoutingTable> (m_ipv4, m_mainAddress);
   63.18 +  m_routingTable = CreateObject<RoutingTable> (m_ipv4, m_mainAddress);
   63.19    // Add OLSR as routing protocol, with slightly lower priority than
   63.20    // static routing.
   63.21    m_ipv4->AddRoutingProtocol (m_routingTable, -10);
    64.1 --- a/tutorial/ipv4-bus-network.cc	Sun Dec 30 19:36:44 2007 -0800
    64.2 +++ b/tutorial/ipv4-bus-network.cc	Wed Jan 02 09:09:24 2008 +0100
    64.3 @@ -56,7 +56,7 @@
    64.4  
    64.5    for (uint32_t i = 0; i < n; ++i)
    64.6      {
    64.7 -      Ptr<Node> node = Create<InternetNode> ();
    64.8 +      Ptr<Node> node = CreateObject<InternetNode> ();
    64.9        uint32_t nd = CsmaIpv4Topology::AddIpv4CsmaNetDevice (node, m_channel, 
   64.10          Mac48Address::Allocate ());
   64.11        Ipv4Address address = Ipv4AddressGenerator::AllocateAddress (mask, 
    65.1 --- a/tutorial/point-to-point-ipv4-topology.cc	Sun Dec 30 19:36:44 2007 -0800
    65.2 +++ b/tutorial/point-to-point-ipv4-topology.cc	Wed Jan 02 09:09:24 2008 +0100
    65.3 @@ -33,7 +33,7 @@
    65.4    const DataRate& bps,
    65.5    const Time& delay)
    65.6  {
    65.7 -  return Create<PointToPointChannel> (bps, delay);
    65.8 +  return CreateObject<PointToPointChannel> (bps, delay);
    65.9  }
   65.10  
   65.11    uint32_t
   65.12 @@ -43,7 +43,7 @@
   65.13  {
   65.14    NS_ASSERT (channel->GetNDevices () <= 1);
   65.15  
   65.16 -  Ptr<PointToPointNetDevice> nd = Create<PointToPointNetDevice> (node);
   65.17 +  Ptr<PointToPointNetDevice> nd = CreateObject<PointToPointNetDevice> (node);
   65.18  
   65.19    Ptr<Queue> q = Queue::CreateDefault ();
   65.20    nd->AddQueue(q);
    66.1 --- a/tutorial/tutorial-bus-network.cc	Sun Dec 30 19:36:44 2007 -0800
    66.2 +++ b/tutorial/tutorial-bus-network.cc	Wed Jan 02 09:09:24 2008 +0100
    66.3 @@ -41,11 +41,11 @@
    66.4    uint32_t port = 7;
    66.5  
    66.6    Ptr<Node> n0 = bus.GetNode (0);
    66.7 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.0.1", port, 
    66.8 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.0.1", port, 
    66.9      1, Seconds(1.), 1024);
   66.10  
   66.11    Ptr<Node> n1 = bus.GetNode (1);
   66.12 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   66.13 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   66.14  
   66.15    server->Start(Seconds(1.));
   66.16    client->Start(Seconds(2.));
    67.1 --- a/tutorial/tutorial-csma-echo-ascii-trace.cc	Sun Dec 30 19:36:44 2007 -0800
    67.2 +++ b/tutorial/tutorial-csma-echo-ascii-trace.cc	Wed Jan 02 09:09:24 2008 +0100
    67.3 @@ -39,10 +39,10 @@
    67.4  
    67.5    NS_LOG_INFO ("UDP Echo Simulation");
    67.6  
    67.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    67.8 -  Ptr<Node> n1 = Create<InternetNode> ();
    67.9 -  Ptr<Node> n2 = Create<InternetNode> ();
   67.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   67.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   67.12 +  Ptr<Node> n1 = CreateObject<InternetNode> ();
   67.13 +  Ptr<Node> n2 = CreateObject<InternetNode> ();
   67.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   67.15  
   67.16    Ptr<CsmaChannel> lan = 
   67.17      CsmaTopology::CreateCsmaChannel (DataRate (5000000), MilliSeconds (2));
   67.18 @@ -66,10 +66,10 @@
   67.19  
   67.20    uint16_t port = 7;
   67.21  
   67.22 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
   67.23 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
   67.24      1, Seconds(1.), 1024);
   67.25  
   67.26 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   67.27 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   67.28  
   67.29    server->Start(Seconds(1.));
   67.30    client->Start(Seconds(2.));
    68.1 --- a/tutorial/tutorial-csma-echo-pcap-trace.cc	Sun Dec 30 19:36:44 2007 -0800
    68.2 +++ b/tutorial/tutorial-csma-echo-pcap-trace.cc	Wed Jan 02 09:09:24 2008 +0100
    68.3 @@ -40,10 +40,10 @@
    68.4  
    68.5    NS_LOG_INFO ("UDP Echo Simulation");
    68.6  
    68.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    68.8 -  Ptr<Node> n1 = Create<InternetNode> ();
    68.9 -  Ptr<Node> n2 = Create<InternetNode> ();
   68.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   68.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   68.12 +  Ptr<Node> n1 = CreateObject<InternetNode> ();
   68.13 +  Ptr<Node> n2 = CreateObject<InternetNode> ();
   68.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   68.15  
   68.16    Ptr<CsmaChannel> lan = 
   68.17      CsmaTopology::CreateCsmaChannel (DataRate (5000000), MilliSeconds (2));
   68.18 @@ -67,10 +67,10 @@
   68.19  
   68.20    uint16_t port = 7;
   68.21  
   68.22 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
   68.23 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
   68.24      1, Seconds(1.), 1024);
   68.25  
   68.26 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   68.27 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   68.28  
   68.29    server->Start(Seconds(1.));
   68.30    client->Start(Seconds(2.));
    69.1 --- a/tutorial/tutorial-csma-echo.cc	Sun Dec 30 19:36:44 2007 -0800
    69.2 +++ b/tutorial/tutorial-csma-echo.cc	Wed Jan 02 09:09:24 2008 +0100
    69.3 @@ -38,10 +38,10 @@
    69.4  
    69.5    NS_LOG_INFO ("UDP Echo Simulation");
    69.6  
    69.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    69.8 -  Ptr<Node> n1 = Create<InternetNode> ();
    69.9 -  Ptr<Node> n2 = Create<InternetNode> ();
   69.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   69.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   69.12 +  Ptr<Node> n1 = CreateObject<InternetNode> ();
   69.13 +  Ptr<Node> n2 = CreateObject<InternetNode> ();
   69.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   69.15  
   69.16    Ptr<CsmaChannel> lan = 
   69.17      CsmaTopology::CreateCsmaChannel (DataRate (5000000), MilliSeconds (2));
   69.18 @@ -65,10 +65,10 @@
   69.19  
   69.20    uint16_t port = 7;
   69.21  
   69.22 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
   69.23 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
   69.24      1, Seconds(1.), 1024);
   69.25  
   69.26 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   69.27 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   69.28  
   69.29    server->Start(Seconds(1.));
   69.30    client->Start(Seconds(2.));
    70.1 --- a/tutorial/tutorial-linear-dumbbell.cc	Sun Dec 30 19:36:44 2007 -0800
    70.2 +++ b/tutorial/tutorial-linear-dumbbell.cc	Wed Jan 02 09:09:24 2008 +0100
    70.3 @@ -56,10 +56,10 @@
    70.4  //
    70.5  // Create the lan on the left side of the dumbbell.
    70.6  //
    70.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    70.8 -  Ptr<Node> n1 = Create<InternetNode> ();
    70.9 -  Ptr<Node> n2 = Create<InternetNode> ();
   70.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   70.11 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   70.12 +  Ptr<Node> n1 = CreateObject<InternetNode> ();
   70.13 +  Ptr<Node> n2 = CreateObject<InternetNode> ();
   70.14 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   70.15  
   70.16    Ptr<CsmaChannel> lan1 = 
   70.17      CsmaTopology::CreateCsmaChannel (DataRate (10000000), MilliSeconds (2));
   70.18 @@ -83,10 +83,10 @@
   70.19  //
   70.20  // Create the lan on the right side of the dumbbell.
   70.21  //
   70.22 -  Ptr<Node> n4 = Create<InternetNode> ();
   70.23 -  Ptr<Node> n5 = Create<InternetNode> ();
   70.24 -  Ptr<Node> n6 = Create<InternetNode> ();
   70.25 -  Ptr<Node> n7 = Create<InternetNode> ();
   70.26 +  Ptr<Node> n4 = CreateObject<InternetNode> ();
   70.27 +  Ptr<Node> n5 = CreateObject<InternetNode> ();
   70.28 +  Ptr<Node> n6 = CreateObject<InternetNode> ();
   70.29 +  Ptr<Node> n7 = CreateObject<InternetNode> ();
   70.30  
   70.31    Ptr<CsmaChannel> lan2 = 
   70.32      CsmaTopology::CreateCsmaChannel (DataRate (10000000), MilliSeconds (2));
   70.33 @@ -124,19 +124,19 @@
   70.34  //
   70.35    uint16_t port = 7;
   70.36  
   70.37 -  Ptr<UdpEchoClient> client0 = Create<UdpEchoClient> (n0, "10.1.2.1", port, 
   70.38 +  Ptr<UdpEchoClient> client0 = CreateObject<UdpEchoClient> (n0, "10.1.2.1", port, 
   70.39      100, Seconds(.01), 1024);
   70.40 -  Ptr<UdpEchoClient> client1 = Create<UdpEchoClient> (n1, "10.1.2.2", port, 
   70.41 +  Ptr<UdpEchoClient> client1 = CreateObject<UdpEchoClient> (n1, "10.1.2.2", port, 
   70.42      100, Seconds(.01), 1024);
   70.43 -  Ptr<UdpEchoClient> client2 = Create<UdpEchoClient> (n2, "10.1.2.3", port, 
   70.44 +  Ptr<UdpEchoClient> client2 = CreateObject<UdpEchoClient> (n2, "10.1.2.3", port, 
   70.45      100, Seconds(.01), 1024);
   70.46 -  Ptr<UdpEchoClient> client3 = Create<UdpEchoClient> (n3, "10.1.2.4", port, 
   70.47 +  Ptr<UdpEchoClient> client3 = CreateObject<UdpEchoClient> (n3, "10.1.2.4", port, 
   70.48      100, Seconds(.01), 1024);
   70.49  
   70.50 -  Ptr<UdpEchoServer> server4 = Create<UdpEchoServer> (n4, port);
   70.51 -  Ptr<UdpEchoServer> server5 = Create<UdpEchoServer> (n5, port);
   70.52 -  Ptr<UdpEchoServer> server6 = Create<UdpEchoServer> (n6, port);
   70.53 -  Ptr<UdpEchoServer> server7 = Create<UdpEchoServer> (n7, port);
   70.54 +  Ptr<UdpEchoServer> server4 = CreateObject<UdpEchoServer> (n4, port);
   70.55 +  Ptr<UdpEchoServer> server5 = CreateObject<UdpEchoServer> (n5, port);
   70.56 +  Ptr<UdpEchoServer> server6 = CreateObject<UdpEchoServer> (n6, port);
   70.57 +  Ptr<UdpEchoServer> server7 = CreateObject<UdpEchoServer> (n7, port);
   70.58  
   70.59    server4->Start(Seconds(1.));
   70.60    server5->Start(Seconds(1.));
    71.1 --- a/tutorial/tutorial-point-to-point.cc	Sun Dec 30 19:36:44 2007 -0800
    71.2 +++ b/tutorial/tutorial-point-to-point.cc	Wed Jan 02 09:09:24 2008 +0100
    71.3 @@ -47,8 +47,8 @@
    71.4  
    71.5    NS_LOG_INFO ("Point to Point Topology Simulation");
    71.6  
    71.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    71.8 -  Ptr<Node> n1 = Create<InternetNode> ();
    71.9 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   71.10 +  Ptr<Node> n1 = CreateObject<InternetNode> ();
   71.11  
   71.12    Ptr<PointToPointChannel> link = PointToPointTopology::AddPointToPointLink (
   71.13      n0, n1, DataRate (38400), MilliSeconds (20));
   71.14 @@ -58,10 +58,10 @@
   71.15  
   71.16    uint16_t port = 7;
   71.17  
   71.18 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
   71.19 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
   71.20      1, Seconds(1.), 1024);
   71.21  
   71.22 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   71.23 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   71.24  
   71.25    server->Start(Seconds(1.));
   71.26    client->Start(Seconds(2.));
    72.1 --- a/tutorial/tutorial-star-routing.cc	Sun Dec 30 19:36:44 2007 -0800
    72.2 +++ b/tutorial/tutorial-star-routing.cc	Wed Jan 02 09:09:24 2008 +0100
    72.3 @@ -51,13 +51,13 @@
    72.4  
    72.5    NS_LOG_INFO ("Star Topology with Routing Simulation");
    72.6  
    72.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    72.8 -  Ptr<Node> n1 = Create<InternetNode> ();
    72.9 -  Ptr<Node> n2 = Create<InternetNode> ();
   72.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   72.11 -  Ptr<Node> n4 = Create<InternetNode> ();
   72.12 -  Ptr<Node> n5 = Create<InternetNode> ();
   72.13 -  Ptr<Node> n6 = Create<InternetNode> ();
   72.14 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   72.15 +  Ptr<Node> n1 = CreateObject<InternetNode> ();
   72.16 +  Ptr<Node> n2 = CreateObject<InternetNode> ();
   72.17 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   72.18 +  Ptr<Node> n4 = CreateObject<InternetNode> ();
   72.19 +  Ptr<Node> n5 = CreateObject<InternetNode> ();
   72.20 +  Ptr<Node> n6 = CreateObject<InternetNode> ();
   72.21  
   72.22    Ptr<PointToPointChannel> link01 = 
   72.23      PointToPointIpv4Topology::CreateChannel (DataRate (38400), 
   72.24 @@ -145,10 +145,10 @@
   72.25  
   72.26    uint16_t port = 7;
   72.27  
   72.28 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n4, "10.1.1.2", port, 
   72.29 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n4, "10.1.1.2", port, 
   72.30      1, Seconds(1.), 1024);
   72.31  
   72.32 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   72.33 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   72.34  
   72.35    server->Start(Seconds(1.));
   72.36    client->Start(Seconds(2.));
    73.1 --- a/tutorial/tutorial-star.cc	Sun Dec 30 19:36:44 2007 -0800
    73.2 +++ b/tutorial/tutorial-star.cc	Wed Jan 02 09:09:24 2008 +0100
    73.3 @@ -51,13 +51,13 @@
    73.4  
    73.5    NS_LOG_INFO ("Star Topology Simulation");
    73.6  
    73.7 -  Ptr<Node> n0 = Create<InternetNode> ();
    73.8 -  Ptr<Node> n1 = Create<InternetNode> ();
    73.9 -  Ptr<Node> n2 = Create<InternetNode> ();
   73.10 -  Ptr<Node> n3 = Create<InternetNode> ();
   73.11 -  Ptr<Node> n4 = Create<InternetNode> ();
   73.12 -  Ptr<Node> n5 = Create<InternetNode> ();
   73.13 -  Ptr<Node> n6 = Create<InternetNode> ();
   73.14 +  Ptr<Node> n0 = CreateObject<InternetNode> ();
   73.15 +  Ptr<Node> n1 = CreateObject<InternetNode> ();
   73.16 +  Ptr<Node> n2 = CreateObject<InternetNode> ();
   73.17 +  Ptr<Node> n3 = CreateObject<InternetNode> ();
   73.18 +  Ptr<Node> n4 = CreateObject<InternetNode> ();
   73.19 +  Ptr<Node> n5 = CreateObject<InternetNode> ();
   73.20 +  Ptr<Node> n6 = CreateObject<InternetNode> ();
   73.21  
   73.22    Ptr<PointToPointChannel> link01 = 
   73.23      PointToPointIpv4Topology::CreateChannel (DataRate (38400), 
   73.24 @@ -145,10 +145,10 @@
   73.25  
   73.26    uint16_t port = 7;
   73.27  
   73.28 -  Ptr<UdpEchoClient> client = Create<UdpEchoClient> (n0, "10.1.1.2", port, 
   73.29 +  Ptr<UdpEchoClient> client = CreateObject<UdpEchoClient> (n0, "10.1.1.2", port, 
   73.30      1, Seconds(1.), 1024);
   73.31  
   73.32 -  Ptr<UdpEchoServer> server = Create<UdpEchoServer> (n1, port);
   73.33 +  Ptr<UdpEchoServer> server = CreateObject<UdpEchoServer> (n1, port);
   73.34  
   73.35    server->Start(Seconds(1.));
   73.36    client->Start(Seconds(2.));
    74.1 --- a/utils/bench-object.cc	Sun Dec 30 19:36:44 2007 -0800
    74.2 +++ b/utils/bench-object.cc	Wed Jan 02 09:09:24 2008 +0100
    74.3 @@ -28,7 +28,7 @@
    74.4    std::vector< Ptr<BaseA> > objlist;
    74.5  
    74.6    for (int i = 0; i < nobjects; ++i)
    74.7 -    objlist.push_back (Create<BaseA> ());
    74.8 +    objlist.push_back (CreateObject<BaseA> ());
    74.9  
   74.10    for (int swapCounter = nswaps; swapCounter; --swapCounter)
   74.11      {
    75.1 --- a/utils/mobility-generator.cc	Sun Dec 30 19:36:44 2007 -0800
    75.2 +++ b/utils/mobility-generator.cc	Wed Jan 02 09:09:24 2008 +0100
    75.3 @@ -45,7 +45,7 @@
    75.4  	  uint32_t n = atoi (*argv + strlen ("--n="));
    75.5  	  for (uint32_t i = 0; i < n; i++)
    75.6  	    {
    75.7 -	      Ptr<MobilityModelNotifier> notifier = Create<MobilityModelNotifier> ();
    75.8 +	      Ptr<MobilityModelNotifier> notifier = CreateObject<MobilityModelNotifier> ();
    75.9  	      notifier->RegisterListener (MakeCallback (&CourseChange));
   75.10  	      objects.push_back (notifier);
   75.11  	    }
    76.1 --- a/utils/mobility-visualizer-model.cc	Sun Dec 30 19:36:44 2007 -0800
    76.2 +++ b/utils/mobility-visualizer-model.cc	Wed Jan 02 09:09:24 2008 +0100
    76.3 @@ -92,8 +92,8 @@
    76.4  
    76.5    for (uint32_t i = 0; i < g_numNodes; i++)
    76.6      {
    76.7 -      Ptr<Node> node = Create<Node> ();
    76.8 -      node->AddInterface (Create<MobilityModelNotifier> ());
    76.9 +      Ptr<Node> node = CreateObject<Node> ();
   76.10 +      node->AddInterface (CreateObject<MobilityModelNotifier> ());
   76.11      }
   76.12  
   76.13    topology.Layout (NodeList::Begin (), NodeList::End ());
    77.1 --- a/utils/print-introspected-doxygen.cc	Sun Dec 30 19:36:44 2007 -0800
    77.2 +++ b/utils/print-introspected-doxygen.cc	Wed Jan 02 09:09:24 2008 +0100
    77.3 @@ -116,12 +116,12 @@
    77.4  
    77.5  int main (int argc, char *argv[])
    77.6  {
    77.7 -  Ptr<Node> node = Create<InternetNode> ();
    77.8 -  node->AddInterface (Create<MobilityModelNotifier> ());
    77.9 +  Ptr<Node> node = CreateObject<InternetNode> ();
   77.10 +  node->AddInterface (CreateObject<MobilityModelNotifier> ());
   77.11  
   77.12 -  Ptr<PointToPointNetDevice> p2p = Create<PointToPointNetDevice> (node);
   77.13 +  Ptr<PointToPointNetDevice> p2p = CreateObject<PointToPointNetDevice> (node);
   77.14    p2p->AddQueue (Queue::CreateDefault ());
   77.15 -  Ptr<CsmaNetDevice> csma = Create<CsmaNetDevice> (node);
   77.16 +  Ptr<CsmaNetDevice> csma = CreateObject<CsmaNetDevice> (node);
   77.17    csma->AddQueue (Queue::CreateDefault ());
   77.18  
   77.19    TraceResolver::SourceCollection collection;