Reconcile changes with Mathieu's latest
authorGeorge Riley<riley@ece.gatech.edu>
Tue, 28 Aug 2007 09:55:21 -0400
changeset 1304 642d6798feaa
parent 1303 9856d1175cbb (current diff)
parent 1302 7dd6ea991e80 (diff)
child 1305 27dd3e15308a
Reconcile changes with Mathieu's latest
SConstruct
src/devices/csma/csma-net-device.h
src/devices/point-to-point/point-to-point-net-device.h
src/node/net-device.cc
src/node/net-device.h
--- a/SConstruct	Fri Aug 24 11:44:11 2007 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,521 +0,0 @@
-## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-import os.path
-import build
-
-version_file = open ('VERSION', 'r')
-version = version_file.readline ()
-version_file.close ()
-version = version.strip ()
-
-ns3 = build.Ns3()
-ns3.build_dir = 'build-dir'
-ns3.version = version
-ns3.name = 'ns3'
-ns3.distname = 'ns'
-ns3.doxygen_config = os.path.join('doc', 'doxygen.conf')
-ns3.add_extra_dist(os.path.join('doc', 'main.txt'))
-ns3.add_extra_dist ('doc/architecture.pdf')
-ns3.add_extra_dist ('doc/contributing.txt')
-ns3.add_extra_dist ('doc/build.txt')
-ns3.add_extra_dist ('doc/codingstd.txt')
-ns3.add_extra_dist ('doc/mercurial.txt')
-ns3.add_extra_dist ('README')
-ns3.add_extra_dist ('RELEASE_NOTES')
-ns3.add_extra_dist ('AUTHORS')
-ns3.add_extra_dist ('VERSION')
-
-ns3.add_extra_dist('doc/build-waf.txt')
-ns3.add_extra_dist('ns3/_placeholder_')
-for wscript in [
-    "src/core/wscript",
-    "src/node/wscript",
-    "src/devices/p2p/wscript",
-    "src/common/wscript",
-    "src/applications/wscript",
-    "src/simulator/wscript",
-    "src/internet-node/wscript",
-    "src/wscript",
-    "utils/wscript",
-    "samples/wscript",
-    "examples/wscript",
-    "wscript",
-    ]:
-    ns3.add_extra_dist(wscript)
-ns3.add_extra_dist('waf')
-ns3.add_extra_dist('waf.bat')
-
-#
-# The Core module
-#
-core = build.Ns3Module('core', 'src/core')
-ns3.add(core)
-core.add_sources([
-    'callback-test.cc',
-    'debug.cc',
-    'assert.cc',
-    'ptr.cc',
-    'object.cc',
-    'test.cc',
-    'random-variable.cc',
-    'rng-stream.cc',
-    'uid-manager.cc',
-    'default-value.cc',
-    'command-line.cc',
-    'type-name.cc',
-    'component-manager.cc',
-    ])
-env = Environment()
-if env['PLATFORM'] == 'posix' or env['PLATFORM'] == 'darwin' or env['PLATFORM'] == 'cygwin':
-    core.add_external_dep('pthread')
-    core.add_sources([
-        'unix-system-wall-clock-ms.cc',
-        ])
-elif env['PLATFORM'] == 'win32':
-    core.add_sources([
-        'win32-system-wall-clock-ms.cc',
-        ])
-core.add_headers ([
-    'uid-manager.h',
-    'singleton.h',
-])
-core.add_inst_headers([
-    'system-wall-clock-ms.h',
-    'empty.h',
-    'callback.h',
-    'ptr.h',
-    'object.h',
-    'debug.h',
-    'assert.h',
-    'fatal-error.h',
-    'test.h',
-    'random-variable.h',
-    'rng-stream.h',
-    'default-value.h',
-    'command-line.h',
-    'type-name.h',
-    'component-manager.h',
-    ])
-
-def config_core (env, config):
-    retval = []
-    # XXX This check is primitive but it should be
-    # good enough for now.
-    if config.CheckCHeader ('stdlib.h') == 1:
-        retval.append ('#define HAVE_STDLIB_H 1')
-        retval.append ('#define HAVE_GETENV 1')
-    else:
-        retval.append ('#undef HAVE_STDLIB_H')
-        retval.append ('#undef HAVE_GETENV')
-    return retval
-core.add_config (config_core)
-
-#
-# The Simulator module
-#
-simu = build.Ns3Module('simulator', 'src/simulator')
-ns3.add(simu)
-simu.add_dep('core')
-simu.add_external_dep('m')
-simu.add_sources([
-    'high-precision.cc',
-    'time.cc',
-    'event-id.cc',
-    'scheduler.cc',
-    'scheduler-factory.cc',
-    'scheduler-list.cc',
-    'scheduler-heap.cc',
-    'scheduler-map.cc',
-    'event-impl.cc',
-    'simulator.cc',
-    ])
-simu.add_headers([
-    'scheduler-heap.h',
-    'scheduler-map.h',
-    'scheduler-list.h'
-    ])
-simu.add_inst_headers([
-    'high-precision.h',
-    'nstime.h',
-    'event-id.h',
-    'event-impl.h',
-    'simulator.h',
-    'scheduler.h',
-    'scheduler-factory.h',
-    'simulation-singleton.h',
-    ])
-high_precision_as_double = ARGUMENTS.get('high-precision-as-double', 'n')
-if high_precision_as_double == 'y':
-    simu.add_inst_header ('high-precision-double.h')
-    simu.add_source ('high-precision-double.cc')
-else:
-    simu.add_inst_headers ([
-        'high-precision-128.h',
-        'cairo-wideint-private.h'
-        ])
-    simu.add_sources ([
-        'high-precision-128.cc',
-        'cairo-wideint.c',
-        ])
-
-def config_simulator (env, config):
-    retval = []
-    high_precision_as_double = ARGUMENTS.get('high-precision-as-double', 'n')
-    if high_precision_as_double == 'y':
-        retval.append ('#define USE_HIGH_PRECISION_DOUBLE 1')
-    else:
-        retval.append ('#undef USE_HIGH_PRECISION_DOUBLE')
-    if config.CheckCHeader ('stdint.h') == 1:
-        retval.append ('#define HAVE_STDINT_H 1')
-    elif config.CheckCHeader ('inttypes.h') == 1:
-        retval.append ('#define HAVE_INTTYPES_H 1')
-    elif config.CheckCHeader ('sys/inttypes.h') == 1:
-        retval.append ('#define HAVE_SYS_INT_TYPES_H 1')
-    return retval
-simu.add_config (config_simulator)
-    
-#
-# The Common module
-#
-common = build.Ns3Module('common', 'src/common')
-common.add_deps(['core', 'simulator'])
-ns3.add(common)
-common.add_sources([
-    'buffer.cc',
-    'chunk.cc',
-    'header.cc',
-    'trailer.cc',
-    'packet-printer.cc',
-    'packet-metadata.cc',
-    'packet.cc',
-    'tags.cc',
-    'pcap-writer.cc',
-    'variable-tracer-test.cc',
-    'trace-context.cc',
-    'trace-resolver.cc',
-    'callback-trace-source.cc',
-    'empty-trace-resolver.cc',
-    'composite-trace-resolver.cc',
-    'trace-root.cc',
-    'data-rate.cc',
-    ])
-common.add_headers ([
-    ])
-common.add_inst_headers([
-    'buffer.h',
-    'chunk.h',
-    'header.h',
-    'trailer.h',
-    'tags.h',
-    'packet.h',
-    'packet-printer.h',
-    'packet-metadata.h',
-    'uv-trace-source.h',
-    'sv-trace-source.h',
-    'fv-trace-source.h',
-    'pcap-writer.h',
-    'callback-trace-source.h',
-    'trace-context.h',
-    'trace-resolver.h',
-    'empty-trace-resolver.h',
-    'composite-trace-resolver.h',
-    'array-trace-resolver.h',
-    'trace-root.h',
-    'terminal-trace-resolver.h',
-    'data-rate.h',
-    ])
-
-#
-# The Node module
-#
-node = build.Ns3Module ('node', 'src/node')
-ns3.add (node)
-node.add_deps (['core', 'common', 'simulator'])
-node.add_sources ([
-    'node.cc',
-    'ipv4-address.cc',
-    'net-device.cc',
-    'mac-address.cc',
-    'llc-snap-header.cc',
-    'ipv4-route.cc',
-    'queue.cc',
-    'drop-tail-queue.cc',
-    'channel.cc',
-    'node-list.cc',
-    'socket.cc',
-    'socket-factory.cc',
-    'udp.cc',
-    'ipv4.cc',
-    'application.cc',
-    ])
-node.add_inst_headers ([
-    'node.h',
-    'ipv4-address.h',
-    'net-device.h',
-    'mac-address.h',
-    'ipv4-route.h',
-    'queue.h',
-    'drop-tail-queue.h',
-    'llc-snap-header.h',
-    'channel.h',
-    'node-list.h',
-    'socket.h',
-    'socket-factory.h',
-    'udp.h',
-    'ipv4.h',
-    'application.h',
-    ])
-
-#
-# The Applications module
-#
-applications = build.Ns3Module ('applications', 'src/applications')
-ns3.add (applications)
-applications.add_deps (['node'])
-applications.add_sources ([
-    'onoff-application.cc',
-])
-applications.add_inst_headers ([
-    'onoff-application.h',
-])
-
-#
-# The Internet Node module
-#
-inode = build.Ns3Module ('internet-node', 'src/internet-node')
-ns3.add (inode)
-inode.add_deps (['node', 'routing'])
-inode.add_sources ([
-    'internet-node.cc',
-    'l3-demux.cc',
-    'l3-protocol.cc',
-    'ipv4-l4-demux.cc',
-    'ipv4-l4-protocol.cc',
-    'ipv4-header.cc',
-    'udp-header.cc',
-    'ipv4-checksum.cc',
-    'ipv4-interface.cc',
-    'ipv4-l3-protocol.cc',
-    'ipv4-end-point.cc',
-    'udp-l4-protocol.cc',
-    'arp-header.cc',
-    'arp-cache.cc',
-    'arp-ipv4-interface.cc',
-    'arp-l3-protocol.cc',
-    'ipv4-loopback-interface.cc',
-    'header-utils.cc',
-    'udp-socket.cc',
-    'ipv4-end-point-demux.cc',
-    'arp-private.cc',
-    'ipv4-impl.cc',
-    'ipv4-private.cc',
-    'ascii-trace.cc',
-    'pcap-trace.cc',
-    'udp-impl.cc',
-])
-inode.add_headers ([
-    'ipv4-checksum.h',
-    'arp-header.h',
-    'arp-cache.h',
-    'arp-l3-protocol.h',
-    'ipv4-loopback-interface.h',
-    'l3-demux.h',
-    'header-utils.h',
-    'arp-ipv4-interface.h',
-    'udp-socket.h',
-    'udp-l4-protocol.h',
-    'arp-private.h',
-    'ipv4-impl.h',
-    'ipv4-private.h',
-    'ipv4-l3-protocol.h',
-    'l3-protocol.h',
-    'ipv4-l4-protocol.h',
-    'ipv4-l4-demux.h',
-    'ipv4-end-point-demux.h',
-    'ipv4-end-point.h',
-    'ipv4-header.h',
-    'ipv4-interface.h',
-    'udp-header.h',
-    'sgi-hashmap.h',
-    'udp-impl.h',
-])
-inode.add_inst_headers ([
-    'internet-node.h',
-    'ascii-trace.h',
-    'pcap-trace.h',
-    'ipv4-header.h',
-    'udp-header.h',
-])
-
-#
-# The Point-to-point module
-#
-p2p = build.Ns3Module ('p2p', 'src/devices/p2p')
-ns3.add (p2p)
-p2p.add_deps (['node'])
-p2p.add_sources ([
-    'p2p-net-device.cc',
-    'p2p-channel.cc',
-    'p2p-topology.cc',
-    ])
-p2p.add_inst_headers ([
-    'p2p-net-device.h',
-    'p2p-channel.h',
-    'p2p-topology.h',
-    ])
-
-#
-# The Routing module
-#
-routing = build.Ns3Module('routing', 'src/routing')
-routing.add_deps(['core', 'node'])
-ns3.add(routing)
-routing.add_sources([
-    'routing-environment.cc',
-    'static-router.cc',
-    'static-route-manager.cc',
-    'static-route-manager-impl.cc',
-    'candidate-queue.cc',
-    ])
-routing.add_headers ([
-    'candidate-queue.h',
-    'static-route-manager-impl.h',
-    ])
-routing.add_inst_headers([
-    'routing-environment.h',
-    'static-router.h',
-    'static-route-manager.h',
-    ])
-
-# utils
-run_tests = build.Ns3Module('run-tests', 'utils')
-ns3.add(run_tests)
-run_tests.set_executable()
-run_tests.add_deps(['core', 'simulator', 'common', 'routing'])
-run_tests.add_source('run-tests.cc')
-
-bench_object = build.Ns3Module('bench-object', 'utils')
-ns3.add(bench_object)
-bench_object.set_executable()
-bench_object.add_deps(['core'])
-bench_object.add_source('bench-object.cc')
-
-bench_packets = build.Ns3Module('bench-packets', 'utils')
-ns3.add(bench_packets)
-bench_packets.set_executable()
-bench_packets.add_deps (['core', 'common'])
-bench_packets.add_source('bench-packets.cc')
-
-bench_simu = build.Ns3Module('bench-simulator', 'utils')
-ns3.add(bench_simu)
-bench_simu.set_executable()
-bench_simu.add_dep('simulator')
-bench_simu.add_source('bench-simulator.cc')
-
-replay_simu = build.Ns3Module('replay-simulation', 'utils')
-ns3.add(replay_simu)
-replay_simu.set_executable()
-replay_simu.add_dep('simulator')
-replay_simu.add_source('replay-simulation.cc')
-
-
-# samples
-sample_debug = build.Ns3Module('sample-debug', 'samples')
-sample_debug.set_executable()
-ns3.add(sample_debug)
-sample_debug.add_dep('core')
-sample_debug.add_source('main-debug.cc')
-sample_debug.add_source('main-debug-other.cc')
-
-sample_packet_printer = build.Ns3Module('sample-packet-printer', 'samples')
-sample_packet_printer.set_executable()
-ns3.add(sample_packet_printer)
-sample_packet_printer.add_deps (['common', 'internet-node'])
-sample_packet_printer.add_source('main-packet-printer.cc')
-
-sample_callback = build.Ns3Module('sample-callback', 'samples')
-sample_callback.set_executable()
-ns3.add(sample_callback)
-sample_callback.add_dep('core')
-sample_callback.add_source('main-callback.cc')
-
-sample_ptr = build.Ns3Module('sample-ptr', 'samples')
-sample_ptr.set_executable()
-ns3.add(sample_ptr)
-sample_ptr.add_dep('core')
-sample_ptr.add_source('main-ptr.cc')
-
-sample_trace = build.Ns3Module('sample-trace', 'samples')
-#ns3.add(sample_trace)
-sample_trace.add_dep('common')
-sample_trace.set_executable()
-sample_trace.add_source('main-trace.cc')
-
-sample_query_interface = build.Ns3Module('sample-query-interface', 'samples')
-ns3.add(sample_query_interface)
-sample_query_interface.add_dep('common')
-sample_query_interface.set_executable()
-sample_query_interface.add_source('main-query-interface.cc')
-
-sample_simu = build.Ns3Module('sample-simulator', 'samples')
-ns3.add(sample_simu)
-sample_simu.set_executable()
-sample_simu.add_dep('simulator')
-sample_simu.add_source('main-simulator.cc')
-
-sample_packet = build.Ns3Module('sample-packet', 'samples')
-ns3.add(sample_packet)
-sample_packet.set_executable()
-sample_packet.add_dep('common')
-sample_packet.add_source('main-packet.cc')
-
-sample_test = build.Ns3Module('sample-test', 'samples')
-sample_test.set_executable()
-ns3.add(sample_test)
-sample_test.add_dep('core')
-sample_test.add_source('main-test.cc')
-
-sample_simple = build.Ns3Module('sample-simple', 'samples')
-sample_simple.set_executable()
-ns3.add(sample_simple)
-sample_simple.add_deps(['core', 'simulator', 'node', 'internet-node', 'routing'])
-sample_simple.add_source('main-simple.cc')
-
-sample_sp2p = build.Ns3Module('sample-simple-p2p', 'samples')
-sample_sp2p.set_executable()
-#n3.add(sample_sp2p)
-sample_sp2p.add_deps(['core', 'simulator', 'node', 'internet-node', 'p2p'])
-sample_sp2p.add_source('main-simple-p2p.cc')
-
-sample_default_value = build.Ns3Module('sample-default-value', 'samples')
-sample_default_value.set_executable()
-ns3.add(sample_default_value)
-sample_default_value.add_deps(['core', 'simulator', 'node', 'p2p'])
-sample_default_value.add_source('main-default-value.cc')
-
-sample_object = build.Ns3Module('sample-object', 'samples')
-sample_object.set_executable()
-ns3.add(sample_object)
-sample_object.add_deps(['core'])
-sample_object.add_source('main-object.cc')
-
-sample_component_manager = build.Ns3Module('sample-component-manager', 'samples')
-sample_component_manager.set_executable()
-ns3.add(sample_component_manager)
-sample_component_manager.add_deps(['core'])
-sample_component_manager.add_source('main-component-manager.cc')
-
-# examples
-example_simple_p2p = build.Ns3Module('simple-p2p', 'examples')
-example_simple_p2p.set_executable()
-ns3.add(example_simple_p2p)
-example_simple_p2p.add_deps(['core', 'simulator', 'node', 'p2p', 'internet-node', 'applications', 'routing'])
-example_simple_p2p.add_source('simple-p2p.cc')
-
-example_static_routing = build.Ns3Module('simple-static-routing', 'examples')
-example_static_routing.set_executable()
-ns3.add(example_static_routing)
-example_static_routing.add_deps(['core', 'simulator', 'node', 'p2p', 'internet-node', 'applications', 'routing'])
-example_static_routing.add_source('simple-static-routing.cc')
-
-ns3.generate_dependencies()
--- a/src/applications/onoff-application.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/applications/onoff-application.h	Tue Aug 28 09:55:21 2007 -0400
@@ -28,13 +28,13 @@
 #include "ns3/application.h"
 #include "ns3/event-id.h"
 #include "ns3/ptr.h"
+#include "ns3/data-rate.h"
 
 namespace ns3 {
 
 class Address;
 class RandomVariable;
 class Socket;
-class DataRate;
 
 /**
  * \brief Generate traffic to a single destination according to an
--- a/src/devices/csma/csma-net-device.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/devices/csma/csma-net-device.h	Tue Aug 28 09:55:21 2007 -0400
@@ -421,8 +421,8 @@
    * @see class CallBackTraceSource
    * @see class TraceResolver
    */
-  CallbackTraceSource<Packet &> m_rxTrace;
-  CallbackTraceSource<Packet &> m_dropTrace;
+  CallbackTraceSource<const Packet &> m_rxTrace;
+  CallbackTraceSource<const Packet &> m_dropTrace;
 
 };
 
--- a/src/devices/point-to-point/point-to-point-net-device.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/devices/point-to-point/point-to-point-net-device.h	Tue Aug 28 09:55:21 2007 -0400
@@ -290,7 +290,7 @@
    * @see class CallBackTraceSource
    * @see class TraceResolver
    */
-  CallbackTraceSource<Packet &> m_rxTrace;
+  CallbackTraceSource<const Packet &> m_rxTrace;
   /** 
    * Default data rate.  Used for all newly created p2p net devices
    */
--- a/src/internet-node/ascii-trace.cc	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/internet-node/ascii-trace.cc	Tue Aug 28 09:55:21 2007 -0400
@@ -92,7 +92,7 @@
   m_os << std::endl;
 }
 void 
-AsciiTrace::LogDevRx (TraceContext const &context, Packet &p)
+AsciiTrace::LogDevRx (TraceContext const &context, const Packet &p)
 {
   m_os << "r " << Simulator::Now ().GetSeconds () << " ";
   context.Print (m_os);
--- a/src/internet-node/ascii-trace.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/internet-node/ascii-trace.h	Tue Aug 28 09:55:21 2007 -0400
@@ -40,7 +40,7 @@
   void LogDevQueueEnqueue (TraceContext const &context, const Packet &p);
   void LogDevQueueDequeue (TraceContext const &context, const Packet &p);
   void LogDevQueueDrop (TraceContext const &context, const Packet &p);
-  void LogDevRx (TraceContext const &context, Packet &p);
+  void LogDevRx (TraceContext const &context, const Packet &p);
   std::ofstream m_os;
 };
 
--- a/src/mobility/mobility-model.cc	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/mobility/mobility-model.cc	Tue Aug 28 09:55:21 2007 -0400
@@ -52,9 +52,9 @@
 }
 
 double 
-MobilityModel::GetDistanceFrom (const MobilityModel &other) const
+MobilityModel::GetDistanceFrom (Ptr<const MobilityModel> other) const
 {
-  Position oPosition = other.DoGet ();
+  Position oPosition = other->DoGet ();
   Position position = DoGet ();
   return CalculateDistance (position, oPosition);
 }
--- a/src/mobility/mobility-model.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/mobility/mobility-model.h	Tue Aug 28 09:55:21 2007 -0400
@@ -57,7 +57,7 @@
    * \param position a reference to another mobility model
    * \returns the distance between the two objects. Unit is meters.
    */
-  double GetDistanceFrom (const MobilityModel &position) const;
+  double GetDistanceFrom (Ptr<const MobilityModel> position) const;
 protected:
   /**
    * Must be invoked by subclasses when the course of the
--- a/src/node/inet-socket-address.cc	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/node/inet-socket-address.cc	Tue Aug 28 09:55:21 2007 -0400
@@ -1,3 +1,24 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2005 INRIA
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+
 #include "inet-socket-address.h"
 #include "ns3/assert.h"
 
--- a/src/node/inet-socket-address.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/node/inet-socket-address.h	Tue Aug 28 09:55:21 2007 -0400
@@ -1,5 +1,26 @@
-#ifndef IPV4_TRANSPORT_ADDRESS_H
-#define IPV4_TRANSPORT_ADDRESS_H
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2005 INRIA
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ */
+
+#ifndef INET_SOCKET_ADDRESS_H
+#define INET_SOCKET_ADDRESS_H
 
 #include "address.h"
 #include "ipv4-address.h"
@@ -93,4 +114,4 @@
 } // namespace ns3
 
 
-#endif /* IPV4_TRANSPORT_ADDRESS_H */
+#endif /* INET_SOCKET_ADDRESS_H */
--- a/src/node/net-device.cc	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/node/net-device.cc	Tue Aug 28 09:55:21 2007 -0400
@@ -197,7 +197,7 @@
 
 // Receive packets from below
 bool
-NetDevice::ForwardUp( Packet& p, uint32_t param, const Address &from)
+NetDevice::ForwardUp(Packet& p, uint16_t param, const Address &from)
 {
   bool retval = false;
 
--- a/src/node/net-device.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/node/net-device.h	Tue Aug 28 09:55:21 2007 -0400
@@ -251,7 +251,7 @@
    * forwards it to the higher layers by calling this method
    * which is responsible for passing it up to the Rx callback.
    */
-  bool ForwardUp (Packet& p, uint32_t param, const Address &address);
+  bool ForwardUp (Packet& p, uint16_t param, const Address &address);
 
 
   /**
--- a/src/routing/global-routing/global-route-manager-impl.cc	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/routing/global-routing/global-route-manager-impl.cc	Tue Aug 28 09:55:21 2007 -0400
@@ -337,8 +337,7 @@
 {
   NS_DEBUG ("GlobalRouteManagerImpl::SelectRouterNodes ()");
 
-  typedef std::vector < Ptr<Node> >::iterator Iterator;
-  for (Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
+  for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
       NS_DEBUG ("GlobalRouteManagerImpl::SelectRouterNodes (): "
@@ -366,8 +365,7 @@
 //
 // Walk the list of nodes looking for the GlobalRouter Interface.
 //
-  typedef std::vector < Ptr<Node> >::iterator Iterator;
-  for (Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
+  for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
 
@@ -448,8 +446,7 @@
 //
 // Walk the list of nodes in the system.
 //
-  typedef std::vector < Ptr<Node> >::iterator Iterator;
-  for (Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
+  for (NodeList::Iterator i = NodeList::Begin (); i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
 //
@@ -1113,7 +1110,7 @@
 // the node at the root of the SPF tree.  This is the node for which we are
 // building the routing table.
 //
-  std::vector<Ptr<Node> >::iterator i = NodeList::Begin (); 
+  NodeList::Iterator i = NodeList::Begin (); 
   for (; i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
@@ -1186,7 +1183,7 @@
 // the node at the root of the SPF tree.  This is the node for which we are
 // building the routing table.
 //
-  std::vector<Ptr<Node> >::iterator i = NodeList::Begin (); 
+  NodeList::Iterator i = NodeList::Begin (); 
   for (; i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
@@ -1277,7 +1274,7 @@
 // ID corresponding to the root vertex.  This is the one we're going to write
 // the routing information to.
 //
-  std::vector<Ptr<Node> >::iterator i = NodeList::Begin (); 
+  NodeList::Iterator i = NodeList::Begin (); 
   for (; i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
@@ -1398,7 +1395,7 @@
 // ID corresponding to the root vertex.  This is the one we're going to write
 // the routing information to.
 //
-  std::vector<Ptr<Node> >::iterator i = NodeList::Begin (); 
+  NodeList::Iterator i = NodeList::Begin (); 
   for (; i != NodeList::End (); i++)
     {
       Ptr<Node> node = *i;
--- a/src/simulator/simulator.cc	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/simulator/simulator.cc	Tue Aug 28 09:55:21 2007 -0400
@@ -539,13 +539,14 @@
 public:
   SimulatorTests ();
   // only here for testing of Ptr<>
-  void Ref (void);
-  void Unref (void);
+  void Ref (void) const;
+  void Unref (void) const;
   virtual ~SimulatorTests ();
   virtual bool RunTests (void);
 private:
   uint64_t NowUs ();
   bool RunOneTest (void);
+  void RunTestsConst (void) const;
   void A (int a);
   void B (int b);
   void C (int c);
@@ -566,6 +567,24 @@
   void cbaz3 (const int &, const int &, const int &);
   void cbaz4 (const int &, const int &, const int &, const int &);
   void cbaz5 (const int &, const int &, const int &, const int &, const int &);
+
+  void bar0c (void) const;
+  void bar1c (int) const;
+  void bar2c (int, int) const;
+  void bar3c (int, int, int) const;
+  void bar4c (int, int, int, int) const;
+  void bar5c (int, int, int, int, int) const;
+  void baz1c (int &) const;
+  void baz2c (int &, int &) const;
+  void baz3c (int &, int &, int &) const;
+  void baz4c (int &, int &, int &, int &) const;
+  void baz5c (int &, int &, int &, int &, int &) const;
+  void cbaz1c (const int &) const;
+  void cbaz2c (const int &, const int &) const;
+  void cbaz3c (const int &, const int &, const int &) const;
+  void cbaz4c (const int &, const int &, const int &, const int &) const;
+  void cbaz5c (const int &, const int &, const int &, const int &, const int &) const;
+
   void destroy (void);
   
   bool m_b;
@@ -583,10 +602,10 @@
 SimulatorTests::~SimulatorTests ()
 {}
 void 
-SimulatorTests::Ref (void)
+SimulatorTests::Ref (void) const
 {}
 void 
-SimulatorTests::Unref (void)
+SimulatorTests::Unref (void) const
 {}
 uint64_t
 SimulatorTests::NowUs (void)
@@ -689,6 +708,57 @@
 SimulatorTests::cbaz5 (const int &, const int &, const int &, const int &, const int &)
 {}
 
+void 
+SimulatorTests::bar0c (void) const
+{}
+void 
+SimulatorTests::bar1c (int) const
+{}
+void 
+SimulatorTests::bar2c (int, int) const
+{}
+void 
+SimulatorTests::bar3c (int, int, int) const
+{}
+void 
+SimulatorTests::bar4c (int, int, int, int) const
+{}
+void 
+SimulatorTests::bar5c (int, int, int, int, int) const
+{}
+
+void
+SimulatorTests::baz1c (int &) const
+{}
+void
+SimulatorTests::baz2c (int &, int &) const
+{}
+void
+SimulatorTests::baz3c (int &, int &, int &) const
+{}
+void 
+SimulatorTests::baz4c (int &, int &, int &, int &) const
+{}
+void 
+SimulatorTests::baz5c (int &, int &, int &, int &, int &) const
+{}
+
+void
+SimulatorTests::cbaz1c (const int &) const
+{}
+void
+SimulatorTests::cbaz2c (const int &, const int &) const
+{}
+void
+SimulatorTests::cbaz3c (const int &, const int &, const int &) const
+{}
+void 
+SimulatorTests::cbaz4c (const int &, const int &, const int &, const int &) const
+{}
+void 
+SimulatorTests::cbaz5c (const int &, const int &, const int &, const int &, const int &) const
+{}
+
 bool
 SimulatorTests::RunOneTest (void)
 {
@@ -723,6 +793,80 @@
     }
   return ok;
 }
+void
+SimulatorTests::RunTestsConst (void) const
+{
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar0c, this);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar1c, this, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar2c, this, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar3c, this, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar4c, this, 0, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar5c, this, 0, 0, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar0c, Ptr<const SimulatorTests> (this));
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar1c, Ptr<const SimulatorTests> (this), 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar2c, Ptr<const SimulatorTests> (this), 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar3c, Ptr<const SimulatorTests> (this), 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar4c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::bar5c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz1c, this, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz2c, this, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz3c, this, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz4c, this, 0, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::cbaz5c, this, 0, 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar0c, this);
+  Simulator::ScheduleNow (&SimulatorTests::bar1c, this, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar2c, this, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar3c, this, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar4c, this, 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar5c, this, 0, 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::cbaz1c, this, 0);
+  Simulator::ScheduleNow (&SimulatorTests::cbaz2c, this, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::cbaz3c, this, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::cbaz4c, this, 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::cbaz5c, this, 0, 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar0c, Ptr<const SimulatorTests> (this));
+  Simulator::ScheduleNow (&SimulatorTests::bar1c, Ptr<const SimulatorTests> (this), 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar2c, Ptr<const SimulatorTests> (this), 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar3c, Ptr<const SimulatorTests> (this), 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar4c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::bar5c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar0c, this);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar1c, this, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar2c, this, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar3c, this, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar4c, this, 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar5c, this, 0, 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::cbaz1c, this, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::cbaz2c, this, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::cbaz3c, this, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::cbaz4c, this, 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::cbaz5c, this, 0, 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar0c, Ptr<const SimulatorTests> (this));
+  Simulator::ScheduleDestroy (&SimulatorTests::bar1c, Ptr<const SimulatorTests> (this), 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar2c, Ptr<const SimulatorTests> (this), 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar3c, Ptr<const SimulatorTests> (this), 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar4c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::bar5c, Ptr<const SimulatorTests> (this), 0, 0, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz1c, this, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz2c, this, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz3c, this, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz4c, this, 0, 0, 0, 0);
+  Simulator::Schedule (Seconds (0.0), &SimulatorTests::baz5c, this, 0, 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::baz1c, this, 0);
+  Simulator::ScheduleNow (&SimulatorTests::baz2c, this, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::baz3c, this, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::baz4c, this, 0, 0, 0, 0);
+  Simulator::ScheduleNow (&SimulatorTests::baz5c, this, 0, 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::baz1c, this, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::baz2c, this, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::baz3c, this, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::baz4c, this, 0, 0, 0, 0);
+  Simulator::ScheduleDestroy (&SimulatorTests::baz5c, this, 0, 0, 0, 0, 0);
+
+  Simulator::Run ();
+  Simulator::Destroy ();
+}
+
 bool 
 SimulatorTests::RunTests (void)
 {
@@ -870,6 +1014,8 @@
   Simulator::ScheduleDestroy (&SimulatorTests::baz5, this, 0, 0, 0, 0, 0);
 #endif
 
+  RunTestsConst ();
+
   EventId nowId = Simulator::ScheduleNow (&foo0);
   m_destroyId = Simulator::ScheduleDestroy (&SimulatorTests::destroy, this);
   if (m_destroyId.IsExpired ())
--- a/src/simulator/simulator.h	Fri Aug 24 11:44:11 2007 -0400
+++ b/src/simulator/simulator.h	Tue Aug 28 09:55:21 2007 -0400
@@ -163,8 +163,8 @@
    * @param obj the object on which to invoke the member method
    * @returns an id for the scheduled event.
    */
-  template <typename T, typename OBJ>
-  static EventId Schedule (Time const &time, void (T::*mem_ptr) (void), OBJ obj);
+  template <typename MEM, typename OBJ>
+  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj);
   /**
    * @param time the relative expiration time of the event.
    * @param mem_ptr member method pointer to invoke
@@ -172,8 +172,8 @@
    * @param a1 the first argument to pass to the invoked method
    * @returns an id for the scheduled event.
    */
-  template <typename T, typename OBJ, typename U1, typename T1>
-  static EventId Schedule (Time const &time, void (T::*mem_ptr) (U1), OBJ obj, T1 a1);
+  template <typename MEM, typename OBJ, typename T1>
+  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1);
   /**
    * @param time the relative expiration time of the event.
    * @param mem_ptr member method pointer to invoke
@@ -182,8 +182,8 @@
    * @param a2 the second argument to pass to the invoked method
    * @returns an id for the scheduled event.
    */
-  template <typename T, typename OBJ, typename U1, typename U2, typename T1, typename T2>
-  static EventId Schedule (Time const &time, void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2);
+  template <typename MEM, typename OBJ, typename T1, typename T2>
+  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
   /**
    * @param time the relative expiration time of the event.
    * @param mem_ptr member method pointer to invoke
@@ -193,10 +193,9 @@
    * @param a3 the third argument to pass to the invoked method
    * @returns an id for the scheduled event.
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3>
-  static EventId Schedule (Time const &time, void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3);
+  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
   /**
    * @param time the relative expiration time of the event.
    * @param mem_ptr member method pointer to invoke
@@ -207,10 +206,9 @@
    * @param a4 the fourth argument to pass to the invoked method
    * @returns an id for the scheduled event.
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4>
-  static EventId Schedule (Time const &time, void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
+  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
   /**
    * @param time the relative expiration time of the event.
    * @param mem_ptr member method pointer to invoke
@@ -222,10 +220,9 @@
    * @param a5 the fifth argument to pass to the invoked method
    * @returns an id for the scheduled event.
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4, typename U5,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static EventId Schedule (Time const &time, void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
+  static EventId Schedule (Time const &time, MEM mem_ptr, OBJ obj, 
                            T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   /**
    * @param time the relative expiration time of the event.
@@ -295,27 +292,25 @@
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
    */
-  template <typename T, typename OBJ>
-  static EventId ScheduleNow (void (T::*mem_ptr) (void), OBJ obj);
+  template <typename MEM, typename OBJ>
+  static EventId ScheduleNow (MEM mem_ptr, OBJ obj);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
    * @param a1 the first argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1,  
+  template <typename MEM, typename OBJ, 
             typename T1>
-  static EventId ScheduleNow (void (T::*mem_ptr) (U1), OBJ obj, T1 a1);
+  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
    * @param a1 the first argument to pass to the invoked method
    * @param a2 the second argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2>
-  static EventId ScheduleNow (void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2);
+  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
@@ -323,10 +318,9 @@
    * @param a2 the second argument to pass to the invoked method
    * @param a3 the third argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3>
-  static EventId ScheduleNow (void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3);
+  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
@@ -335,11 +329,10 @@
    * @param a3 the third argument to pass to the invoked method
    * @param a4 the fourth argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4>
-  static EventId ScheduleNow (void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, 
-                           T1 a1, T2 a2, T3 a3, T4 a4);
+  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
+                              T1 a1, T2 a2, T3 a3, T4 a4);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
@@ -349,11 +342,10 @@
    * @param a4 the fourth argument to pass to the invoked method
    * @param a5 the fifth argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4, typename U5,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static EventId ScheduleNow (void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
-                           T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+  static EventId ScheduleNow (MEM mem_ptr, OBJ obj, 
+                              T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   /**
    * @param f the function to invoke
    */
@@ -414,27 +406,25 @@
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
    */
-  template <typename T, typename OBJ>
-  static EventId ScheduleDestroy (void (T::*mem_ptr) (void), OBJ obj);
+  template <typename MEM, typename OBJ>
+  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
    * @param a1 the first argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1,
+  template <typename MEM, typename OBJ, 
             typename T1>
-  static EventId ScheduleDestroy (void (T::*mem_ptr) (U1), OBJ obj, T1 a1);
+  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
    * @param a1 the first argument to pass to the invoked method
    * @param a2 the second argument to pass to the invoked method
    */
-  template <typename T, typename OBJ,
-            typename U1, typename U2,
+  template <typename MEM, typename OBJ,
             typename T1, typename T2>
-  static EventId ScheduleDestroy (void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2);
+  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
@@ -442,10 +432,9 @@
    * @param a2 the second argument to pass to the invoked method
    * @param a3 the third argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3>
-  static EventId ScheduleDestroy (void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3);
+  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
@@ -454,11 +443,10 @@
    * @param a3 the third argument to pass to the invoked method
    * @param a4 the fourth argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4>
-  static EventId ScheduleDestroy (void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, 
-                               T1 a1, T2 a2, T3 a3, T4 a4);
+  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
+                                  T1 a1, T2 a2, T3 a3, T4 a4);
   /**
    * @param mem_ptr member method pointer to invoke
    * @param obj the object on which to invoke the member method
@@ -468,11 +456,10 @@
    * @param a4 the fourth argument to pass to the invoked method
    * @param a5 the fifth argument to pass to the invoked method
    */
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4, typename U5,
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static EventId ScheduleDestroy (void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
-                               T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+  static EventId ScheduleDestroy (MEM mem_ptr, OBJ obj, 
+                                  T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   /**
    * @param f the function to invoke
    */
@@ -569,29 +556,24 @@
   Simulator ();
   ~Simulator ();
 
-  template <typename T, typename OBJ>
-  static Ptr<EventImpl> MakeEvent (void (T::*mem_ptr) (void), OBJ obj);
-  template <typename T, typename OBJ, 
-            typename U1,
+  template <typename MEM, typename OBJ>
+  static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj);
+  template <typename MEM, typename OBJ, 
             typename T1>
-  static Ptr<EventImpl> MakeEvent (void (T::*mem_ptr) (U1), OBJ obj, T1 a1);
-  template <typename T, typename OBJ, 
-            typename U1, typename U2,
+  static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1);
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2>
-  static Ptr<EventImpl> MakeEvent (void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2);
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3,
+  static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2);
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3>
-  static Ptr<EventImpl> MakeEvent (void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3);
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4,
+  static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3);
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4>
-  static Ptr<EventImpl> MakeEvent (void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
-  template <typename T, typename OBJ, 
-            typename U1, typename U2, typename U3, typename U4, typename U5,
+  static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4);
+  template <typename MEM, typename OBJ, 
             typename T1, typename T2, typename T3, typename T4, typename T5>
-  static Ptr<EventImpl> MakeEvent (void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
-                               T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
+  static Ptr<EventImpl> MakeEvent (MEM mem_ptr, OBJ obj, 
+                                   T1 a1, T2 a2, T3 a3, T4 a4, T5 a5);
   static Ptr<EventImpl> MakeEvent (void (*f) (void));
   template <typename U1, 
             typename T1>
@@ -649,14 +631,13 @@
   }
 };
 
-template <typename T, typename OBJ>
-Ptr<EventImpl> Simulator::MakeEvent (void (T::*mem_ptr) (void), OBJ obj) 
+template <typename MEM, typename OBJ>
+Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj) 
 {
   // zero argument version
   class EventMemberImpl0 : public EventImpl {
   public:
-    typedef void (T::*F)(void);
-    EventMemberImpl0 (OBJ obj, F function) 
+    EventMemberImpl0 (OBJ obj, MEM function) 
       : m_obj (obj), 
         m_function (function)
     {}
@@ -666,22 +647,20 @@
       (EventMemberImplObjTraits<OBJ>::GetReference (m_obj).*m_function) (); 
     }
     OBJ m_obj;
-    F m_function;
+    MEM m_function;
   } * ev = new EventMemberImpl0 (obj, mem_ptr);
   return Ptr<EventImpl> (ev, false);
 }
 
 
-template <typename T, typename OBJ, 
-          typename U1,
+template <typename MEM, typename OBJ, 
           typename T1>
-Ptr<EventImpl> Simulator::MakeEvent (void (T::*mem_ptr) (U1), OBJ obj, T1 a1)
+Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1)
 {
   // one argument version
   class EventMemberImpl1 : public EventImpl {
   public:
-    typedef void (T::*F)(U1);
-    EventMemberImpl1 (OBJ obj, F function, T1 a1) 
+    EventMemberImpl1 (OBJ obj, MEM function, T1 a1) 
       : m_obj (obj), 
         m_function (function),
         m_a1 (a1)
@@ -693,23 +672,20 @@
       (EventMemberImplObjTraits<OBJ>::GetReference (m_obj).*m_function) (m_a1);
     }
     OBJ m_obj;
-    F m_function;
+    MEM m_function;
     typename TypeTraits<T1>::ReferencedType m_a1;
   } *ev = new EventMemberImpl1 (obj, mem_ptr, a1);
   return Ptr<EventImpl> (ev, false);
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2>
-Ptr<EventImpl> Simulator::MakeEvent (void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2) 
+Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2) 
 {
   // two argument version
   class EventMemberImpl2 : public EventImpl {
   public:
-    typedef void (T::*F)(U1, U2);
-      
-    EventMemberImpl2 (OBJ obj, F function, T1 a1, T2 a2) 
+    EventMemberImpl2 (OBJ obj, MEM function, T1 a1, T2 a2) 
       : m_obj (obj), 
         m_function (function),
         m_a1 (a1),
@@ -722,24 +698,21 @@
       (EventMemberImplObjTraits<OBJ>::GetReference (m_obj).*m_function) (m_a1, m_a2);
     }
     OBJ m_obj;
-    F m_function;
+    MEM m_function;
     typename TypeTraits<T1>::ReferencedType m_a1;
     typename TypeTraits<T2>::ReferencedType m_a2;
   } *ev = new EventMemberImpl2 (obj, mem_ptr, a1, a2);
   return Ptr<EventImpl> (ev, false);
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3>
-Ptr<EventImpl> Simulator::MakeEvent (void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3) 
+Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
 {
   // three argument version
   class EventMemberImpl3 : public EventImpl {
   public:
-    typedef void (T::*F)(U1,U2,U3);
-      
-    EventMemberImpl3 (OBJ obj, F function, T1 a1, T2 a2, T3 a3) 
+    EventMemberImpl3 (OBJ obj, MEM function, T1 a1, T2 a2, T3 a3) 
       : m_obj (obj), 
         m_function (function),
         m_a1 (a1),
@@ -753,7 +726,7 @@
       (EventMemberImplObjTraits<OBJ>::GetReference (m_obj).*m_function) (m_a1, m_a2, m_a3);
     }
     OBJ m_obj;
-    F m_function;
+    MEM m_function;
     typename TypeTraits<T1>::ReferencedType m_a1;
     typename TypeTraits<T2>::ReferencedType m_a2;
     typename TypeTraits<T3>::ReferencedType m_a3;
@@ -761,17 +734,14 @@
   return Ptr<EventImpl> (ev, false);
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3, typename U4,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4>
-Ptr<EventImpl> Simulator::MakeEvent (void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
+Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
 {
   // four argument version
   class EventMemberImpl4 : public EventImpl {
   public:
-    typedef void (T::*F)(U1, U2, U3, U4);
-          
-    EventMemberImpl4 (OBJ obj, F function, T1 a1, T2 a2, T3 a3, T4 a4) 
+    EventMemberImpl4 (OBJ obj, MEM function, T1 a1, T2 a2, T3 a3, T4 a4) 
       : m_obj (obj), 
         m_function (function),
         m_a1 (a1),
@@ -786,7 +756,7 @@
       (EventMemberImplObjTraits<OBJ>::GetReference (m_obj).*m_function) (m_a1, m_a2, m_a3, m_a4);
     }
     OBJ m_obj;
-    F m_function;
+    MEM m_function;
     typename TypeTraits<T1>::ReferencedType m_a1;
     typename TypeTraits<T2>::ReferencedType m_a2;
     typename TypeTraits<T3>::ReferencedType m_a3;
@@ -795,18 +765,15 @@
   return Ptr<EventImpl> (ev, false);
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3, typename U4, typename U5,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4, typename T5>
-Ptr<EventImpl> Simulator::MakeEvent (void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
-                                 T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
+Ptr<EventImpl> Simulator::MakeEvent (MEM mem_ptr, OBJ obj, 
+                                     T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
   // five argument version
   class EventMemberImpl5 : public EventImpl {
   public:
-    typedef void (T::*F)(U1, U2, U3, U4, U5);
-      
-    EventMemberImpl5 (OBJ obj, F function, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
+    EventMemberImpl5 (OBJ obj, MEM function, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
       : m_obj (obj), 
         m_function (function),
         m_a1 (a1),
@@ -822,7 +789,7 @@
       (EventMemberImplObjTraits<OBJ>::GetReference (m_obj).*m_function) (m_a1, m_a2, m_a3, m_a4, m_a5);
     }
     OBJ m_obj;
-    F m_function;
+    MEM m_function;
     typename TypeTraits<T1>::ReferencedType m_a1;
     typename TypeTraits<T2>::ReferencedType m_a2;
     typename TypeTraits<T3>::ReferencedType m_a3;
@@ -975,50 +942,45 @@
   return Ptr<EventImpl> (ev, false);
 }
 
-template <typename T, typename OBJ>
-EventId Simulator::Schedule (Time const &time, void (T::*mem_ptr) (void), OBJ obj) 
+template <typename MEM, typename OBJ>
+EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj) 
 {
   return Schedule (time, MakeEvent (mem_ptr, obj));
 }
 
 
-template <typename T, typename OBJ,
-          typename U1,
+template <typename MEM, typename OBJ,
           typename T1>
-EventId Simulator::Schedule (Time const &time, void (T::*mem_ptr) (U1), OBJ obj, T1 a1) 
+EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1) 
 {
   return Schedule (time, MakeEvent (mem_ptr, obj, a1));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2>
-EventId Simulator::Schedule (Time const &time, void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2)
+EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2)
 {
   return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2));
 }
 
-template <typename T, typename OBJ,
-          typename U1, typename U2, typename U3,
+template <typename MEM, typename OBJ,
           typename T1, typename T2, typename T3>
-EventId Simulator::Schedule (Time const &time, void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3) 
+EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
 {
   return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3, typename U4,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4>
-EventId Simulator::Schedule (Time const &time, void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
+EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
 {
   return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3, typename U4, typename U5,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4, typename T5>
-EventId Simulator::Schedule (Time const &time, void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
-  						 T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
+EventId Simulator::Schedule (Time const &time, MEM mem_ptr, OBJ obj, 
+                             T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
   return Schedule (time, MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
 }
@@ -1060,55 +1022,50 @@
 
 
 
-template <typename T, typename OBJ>
+template <typename MEM, typename OBJ>
 EventId
-Simulator::ScheduleNow (void (T::*mem_ptr) (void), OBJ obj) 
+Simulator::ScheduleNow (MEM mem_ptr, OBJ obj) 
 {
   return ScheduleNow (MakeEvent (mem_ptr, obj));
 }
 
 
-template <typename T, typename OBJ, 
-          typename U1,
+template <typename MEM, typename OBJ, 
           typename T1>
 EventId
-Simulator::ScheduleNow (void (T::*mem_ptr) (U1), OBJ obj, T1 a1) 
+Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1) 
 {
   return ScheduleNow (MakeEvent (mem_ptr, obj, a1));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2>
 EventId
-Simulator::ScheduleNow (void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2) 
+Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2) 
 {
   return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3>
 EventId
-Simulator::ScheduleNow (void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3) 
+Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
 {
   return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3, typename U4,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4>
 EventId
-Simulator::ScheduleNow (void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
+Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
 {
   return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3, typename U4, typename U5,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4, typename T5>
 EventId
-Simulator::ScheduleNow (void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
+Simulator::ScheduleNow (MEM mem_ptr, OBJ obj, 
                         T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
   return ScheduleNow (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));
@@ -1156,55 +1113,50 @@
 
 
 
-template <typename T, typename OBJ>
+template <typename MEM, typename OBJ>
 EventId
-Simulator::ScheduleDestroy (void (T::*mem_ptr) (void), OBJ obj) 
+Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj) 
 {
   return ScheduleDestroy (MakeEvent (mem_ptr, obj));
 }
 
 
-template <typename T, typename OBJ, 
-          typename U1,
+template <typename MEM, typename OBJ, 
           typename T1>
 EventId
-Simulator::ScheduleDestroy (void (T::*mem_ptr) (U1), OBJ obj, T1 a1) 
+Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1) 
 {
   return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2>
 EventId
-Simulator::ScheduleDestroy (void (T::*mem_ptr) (U1,U2), OBJ obj, T1 a1, T2 a2) 
+Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2) 
 {
   return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3>
 EventId
-Simulator::ScheduleDestroy (void (T::*mem_ptr) (U1,U2,U3), OBJ obj, T1 a1, T2 a2, T3 a3) 
+Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3) 
 {
   return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3));
 }
 
-template <typename T, typename OBJ,
-          typename U1, typename U2, typename U3, typename U4,
+template <typename MEM, typename OBJ,
           typename T1, typename T2, typename T3, typename T4>
 EventId
-Simulator::ScheduleDestroy (void (T::*mem_ptr) (U1,U2,U3,U4), OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
+Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, T1 a1, T2 a2, T3 a3, T4 a4) 
 {
   return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4));
 }
 
-template <typename T, typename OBJ, 
-          typename U1, typename U2, typename U3, typename U4, typename U5,
+template <typename MEM, typename OBJ, 
           typename T1, typename T2, typename T3, typename T4, typename T5>
 EventId
-Simulator::ScheduleDestroy (void (T::*mem_ptr) (U1,U2,U3,U4,U5), OBJ obj, 
+Simulator::ScheduleDestroy (MEM mem_ptr, OBJ obj, 
                             T1 a1, T2 a2, T3 a3, T4 a4, T5 a5) 
 {
   return ScheduleDestroy (MakeEvent (mem_ptr, obj, a1, a2, a3, a4, a5));