From 7a62df07e2d0f06d2a825a53b867ac9bc8b5be2f Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Fri, 15 Apr 2011 13:23:48 +0200 Subject: [PATCH] make scanner work --- src/core/bindings/modulegen_customizations.py | 30 ------------------- src/core/bindings/scan-header.h | 6 ---- 2 files changed, 36 deletions(-) diff --git a/src/core/bindings/modulegen_customizations.py b/src/core/bindings/modulegen_customizations.py index 7ebff3855..c409b3e9b 100644 --- a/src/core/bindings/modulegen_customizations.py +++ b/src/core/bindings/modulegen_customizations.py @@ -441,41 +441,11 @@ _ns3_Ipv4Address_tp_hash (PyObject *obj) module['Ipv4Address'].pytype.slots['tp_hash'] = "_ns3_Ipv4Address_tp_hash" -def add_scalar_operators(root_module): - # Scalar implicitly converts to Time, but pybindgen gccxml parser - # cannot pick up operators supported through implicit conversions, - # so we add them manually here. - cls = root_module['ns3::Scalar'] - - cls.add_binary_numeric_operator('*', root_module['ns3::Scalar'], root_module['ns3::Scalar'], param('ns3::Scalar const &', 'right')) - cls.add_binary_numeric_operator('+', root_module['ns3::Scalar'], root_module['ns3::Scalar'], param('ns3::Scalar const &', 'right')) - cls.add_binary_numeric_operator('-', root_module['ns3::Scalar'], root_module['ns3::Scalar'], param('ns3::Scalar const &', 'right')) - cls.add_binary_numeric_operator('/', root_module['ns3::Scalar'], root_module['ns3::Scalar'], param('ns3::Scalar const &', 'right')) - - cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Scalar'], param('ns3::Time const &', 'right')) - cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Scalar'], param('ns3::Time const &', 'right')) - - root_module['ns3::Time'].add_binary_numeric_operator( - '*', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Scalar const &', 'right')) - - root_module['ns3::Time'].add_binary_numeric_operator( - '-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Scalar const &', 'right')) - - cls.add_binary_comparison_operator('<') - cls.add_binary_comparison_operator('>') - cls.add_binary_comparison_operator('!=') - cls.add_output_stream_operator() - cls.add_binary_comparison_operator('<=') - cls.add_binary_comparison_operator('==') - cls.add_binary_comparison_operator('>=') - - def post_register_types(root_module): Simulator_customizations(root_module) CommandLine_customizations(root_module) TypeId_customizations(root_module) add_std_ofstream(root_module) - add_scalar_operators(root_module) enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',') diff --git a/src/core/bindings/scan-header.h b/src/core/bindings/scan-header.h index 3951ac84a..af0937136 100644 --- a/src/core/bindings/scan-header.h +++ b/src/core/bindings/scan-header.h @@ -20,12 +20,6 @@ namespace Time t1, t2, t3; t1 = t2 + t3; t1 = t2 - t3; - TimeSquare tsq = t2*t3; - Time tsqdiv = tsq/Seconds(1); - Scalar scal = t2/t3; - TimeInvert inv = scal/t3; - t1 = scal*t1; - t1 = t1/scal; t1 < t2; t1 <= t2; t1 == t2;