View | Details | Raw Unified | Return to bug 786
Collapse All | Expand All

(-)a/bindings/python/ns3modulegen.py (+1 lines)
 Lines 87-92    Link Here 
87
    ns3modulegen_core_customizations.CommandLine_customizations(root_module)
87
    ns3modulegen_core_customizations.CommandLine_customizations(root_module)
88
    ns3modulegen_core_customizations.TypeId_customizations(root_module)
88
    ns3modulegen_core_customizations.TypeId_customizations(root_module)
89
    ns3modulegen_core_customizations.add_std_ofstream(root_module)
89
    ns3modulegen_core_customizations.add_std_ofstream(root_module)
90
    ns3modulegen_core_customizations.add_ipv4_address_tp_hash(root_module)
90
91
91
92
92
    for local_module in LOCAL_MODULES:
93
    for local_module in LOCAL_MODULES:
(-)a/bindings/python/ns3modulegen_core_customizations.py (+11 lines)
 Lines 547-549    Link Here 
547
                              Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")])
547
                              Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")])
548
    ofstream.add_method('close', None, [])
548
    ofstream.add_method('close', None, [])
549
549
550
def add_ipv4_address_tp_hash(module):
551
    module.body.writeln('''
552
long
553
_ns3_Ipv4Address_tp_hash (PyObject *obj)
554
{
555
   PyNs3Ipv4Address *addr = reinterpret_cast<PyNs3Ipv4Address *> (obj);
556
   return static_cast<long> (ns3::Ipv4AddressHash () (*addr->obj));
557
}
558
''')
559
    module.header.writeln('long _ns3_Ipv4Address_tp_hash (PyObject *obj);')
560
    module['Ipv4Address'].pytype.slots['tp_hash'] = "_ns3_Ipv4Address_tp_hash"

Return to bug 786