Exemplo n.º 1
0
def register_types(module):
    root_module = module.get_root()
    
    ## data-output-interface.h: ns3::DataOutputCallback [class]
    module.add_class('DataOutputCallback', allow_subclassing=True)
    ## data-calculator.h: ns3::DataCalculator [class]
    module.add_class('DataCalculator', parent=root_module['ns3::Object'])
    ## data-collector.h: ns3::DataCollector [class]
    module.add_class('DataCollector', parent=root_module['ns3::Object'])
    ## data-output-interface.h: ns3::DataOutputInterface [class]
    module.add_class('DataOutputInterface', parent=root_module['ns3::Object'])
    ## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator<unsigned int> [class]
    module.add_class('MinMaxAvgTotalCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
    ## omnet-data-output.h: ns3::OmnetDataOutput [class]
    module.add_class('OmnetDataOutput', parent=root_module['ns3::DataOutputInterface'])
    ## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator [class]
    module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
    ## sqlite-data-output.h: ns3::SqliteDataOutput [class]
    module.add_class('SqliteDataOutput', parent=root_module['ns3::DataOutputInterface'])
    ## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator [class]
    module.add_class('TimeMinMaxAvgTotalCalculator', parent=root_module['ns3::DataCalculator'])
    ## basic-data-calculators.h: ns3::CounterCalculator<unsigned int> [class]
    module.add_class('CounterCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
    ## packet-data-calculators.h: ns3::PacketCounterCalculator [class]
    module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >'])
    typehandlers.add_type_alias('std::list< ns3::Ptr< ns3::DataCalculator >, std::allocator< ns3::Ptr< ns3::DataCalculator > > >', 'ns3::DataCalculatorList')
    typehandlers.add_type_alias('std::list< std::pair< std::string, std::string >, std::allocator< std::pair< std::string, std::string > > >', 'ns3::MetadataList')
    
    ## Register a nested module for the namespace Config
    
    nested_module = module.add_cpp_namespace('Config')
    register_types_ns3_Config(nested_module)
    
    
    ## Register a nested module for the namespace TimeStepPrecision
    
    nested_module = module.add_cpp_namespace('TimeStepPrecision')
    register_types_ns3_TimeStepPrecision(nested_module)
    
    
    ## Register a nested module for the namespace addressUtils
    
    nested_module = module.add_cpp_namespace('addressUtils')
    register_types_ns3_addressUtils(nested_module)
    
    
    ## Register a nested module for the namespace internal
    
    nested_module = module.add_cpp_namespace('internal')
    register_types_ns3_internal(nested_module)
    
    
    ## Register a nested module for the namespace olsr
    
    nested_module = module.add_cpp_namespace('olsr')
    register_types_ns3_olsr(nested_module)
Exemplo n.º 2
0
def register_types(module):
    root_module = module.get_root()
    
    # ns-3 core
    module.add_class('AttributeValue', import_from_module='ns.core')
    module.add_class('Object', import_from_module='ns.core')

    # ns-3 network
    module.add_class('Application', import_from_module='ns.network')
    module.add_class('ApplicationContainer', import_from_module='ns.network')
    module.add_class('Node', import_from_module='ns.network')
    module.add_class('NodeContainer', import_from_module='ns.network')
    module.add_class('Ipv4RoutingProtocol', import_from_module='ns.network')
    module.add_class('Ipv4StaticRoutingHelper', import_from_module='ns.network')
    module.add_class('Time', import_from_module='ns.core')

    # DCE 
    module.add_class('DceApplication', parent=root_module['ns3::Application'])
    module.add_class('DceApplicationHelper', allow_subclassing=True)
    ## dce-manager-helper.h: ns3::ProcStatus [class]
    module.add_class('ProcStatus')
    module.add_class('DceManagerHelper', parent=root_module['ns3::Object'])
    module.add_class('Ipv4DceRoutingHelper', parent=root_module['ns3::Ipv4StaticRoutingHelper'])
    module.add_class('LinuxStackHelper')
    module.add_class('CcnClientHelper', parent=root_module['ns3::DceApplicationHelper'])

    # Containers
    module.add_container('std::vector< std::string >', 'std::string', container_type=u'vector')
    module.add_container('std::vector< ns3::ProcStatus >', 'ns3::ProcStatus', container_type=u'vector')
    module.add_container('std::vector< std::pair< std::string, std::string > >', 'std::pair< std::basic_string< char, std::char_traits< char >, std::allocator< char > >, std::basic_string< char, std::char_traits< char >, std::allocator< char > > >', container_type=u'vector')
    
    # Types
    typehandlers.add_type_alias(u'unsigned int', u'ns3::uid_t')
    typehandlers.add_type_alias(u'unsigned int*', u'ns3::uid_t*')
    typehandlers.add_type_alias(u'unsigned int&', u'ns3::uid_t&')
Exemplo n.º 3
0
def register_types(module):
    root_module = module.get_root()

    # ns-3 core
    module.add_class('AttributeValue', import_from_module='ns.core')
    module.add_class('Object', import_from_module='ns.core')

    # ns-3 network
    module.add_class('Application', import_from_module='ns.network')
    module.add_class('ApplicationContainer', import_from_module='ns.network')
    module.add_class('Node', import_from_module='ns.network')
    module.add_class('NodeContainer', import_from_module='ns.network')
    module.add_class('Ipv4RoutingProtocol', import_from_module='ns.network')
    module.add_class('Ipv4StaticRoutingHelper',
                     import_from_module='ns.network')
    module.add_class('Time', import_from_module='ns.core')

    # DCE
    module.add_class('DceApplication', parent=root_module['ns3::Application'])
    module.add_class('DceApplicationHelper', allow_subclassing=True)
    ## dce-manager-helper.h: ns3::ProcStatus [class]
    module.add_class('ProcStatus')
    module.add_class('DceManagerHelper', parent=root_module['ns3::Object'])
    module.add_class('Ipv4DceRoutingHelper',
                     parent=root_module['ns3::Ipv4StaticRoutingHelper'])
    module.add_class('LinuxStackHelper')
    module.add_class('CcnClientHelper',
                     parent=root_module['ns3::DceApplicationHelper'])

    # Containers
    module.add_container('std::vector< std::string >',
                         'std::string',
                         container_type=u'vector')
    module.add_container('std::vector< ns3::ProcStatus >',
                         'ns3::ProcStatus',
                         container_type=u'vector')
    module.add_container(
        'std::vector< std::pair< std::string, std::string > >',
        'std::pair< std::basic_string< char, std::char_traits< char >, std::allocator< char > >, std::basic_string< char, std::char_traits< char >, std::allocator< char > > >',
        container_type=u'vector')

    # Types
    typehandlers.add_type_alias(u'unsigned int', u'ns3::uid_t')
    typehandlers.add_type_alias(u'unsigned int*', u'ns3::uid_t*')
    typehandlers.add_type_alias(u'unsigned int&', u'ns3::uid_t&')
def register_types(module):
    root_module = module.get_root()
    
    ## flow-monitor-helper.h: ns3::FlowMonitorHelper [class]
    module.add_class('FlowMonitorHelper')
    ## histogram.h: ns3::Histogram [class]
    module.add_class('Histogram')
    ## simple-ref-count.h: ns3::SimpleRefCount<ns3::FlowClassifier, ns3::empty, ns3::DefaultDeleter<ns3::FlowClassifier> > [class]
    module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::FlowClassifier', 'ns3::empty', 'ns3::DefaultDeleter<ns3::FlowClassifier>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
    ## simple-ref-count.h: ns3::SimpleRefCount<ns3::FlowProbe, ns3::empty, ns3::DefaultDeleter<ns3::FlowProbe> > [class]
    module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::FlowProbe', 'ns3::empty', 'ns3::DefaultDeleter<ns3::FlowProbe>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
    ## flow-classifier.h: ns3::FlowClassifier [class]
    module.add_class('FlowClassifier', parent=root_module['ns3::SimpleRefCount< ns3::FlowClassifier, ns3::empty, ns3::DefaultDeleter<ns3::FlowClassifier> >'])
    ## flow-monitor.h: ns3::FlowMonitor [class]
    module.add_class('FlowMonitor', parent=root_module['ns3::Object'])
    ## flow-monitor.h: ns3::FlowMonitor::FlowStats [struct]
    module.add_class('FlowStats', outer_class=root_module['ns3::FlowMonitor'])
    ## flow-probe.h: ns3::FlowProbe [class]
    module.add_class('FlowProbe', parent=root_module['ns3::SimpleRefCount< ns3::FlowProbe, ns3::empty, ns3::DefaultDeleter<ns3::FlowProbe> >'])
    ## flow-probe.h: ns3::FlowProbe::FlowStats [struct]
    module.add_class('FlowStats', outer_class=root_module['ns3::FlowProbe'])
    ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier [class]
    module.add_class('Ipv4FlowClassifier', parent=root_module['ns3::FlowClassifier'])
    ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple [struct]
    module.add_class('FiveTuple', outer_class=root_module['ns3::Ipv4FlowClassifier'])
    ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe [class]
    module.add_class('Ipv4FlowProbe', parent=root_module['ns3::FlowProbe'])
    ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::DropReason [enumeration]
    module.add_enum('DropReason', ['DROP_NO_ROUTE', 'DROP_TTL_EXPIRE', 'DROP_BAD_CHECKSUM', 'DROP_QUEUE', 'DROP_INTERFACE_DOWN', 'DROP_ROUTE_ERROR', 'DROP_INVALID_REASON'], outer_class=root_module['ns3::Ipv4FlowProbe'])
    module.add_container('std::map< unsigned int, ns3::FlowMonitor::FlowStats >', ('unsigned int', 'ns3::FlowMonitor::FlowStats'), container_type='map')
    module.add_container('std::map< unsigned int, ns3::FlowProbe::FlowStats >', ('unsigned int', 'ns3::FlowProbe::FlowStats'), container_type='map')
    typehandlers.add_type_alias('uint32_t', 'ns3::FlowPacketId')
    typehandlers.add_type_alias('uint32_t*', 'ns3::FlowPacketId*')
    typehandlers.add_type_alias('uint32_t&', 'ns3::FlowPacketId&')
    typehandlers.add_type_alias('uint32_t', 'ns3::FlowId')
    typehandlers.add_type_alias('uint32_t*', 'ns3::FlowId*')
    typehandlers.add_type_alias('uint32_t&', 'ns3::FlowId&')
    
    ## Register a nested module for the namespace Config
    
    nested_module = module.add_cpp_namespace('Config')
    register_types_ns3_Config(nested_module)
    
    
    ## Register a nested module for the namespace FatalImpl
    
    nested_module = module.add_cpp_namespace('FatalImpl')
    register_types_ns3_FatalImpl(nested_module)
    
    
    ## Register a nested module for the namespace addressUtils
    
    nested_module = module.add_cpp_namespace('addressUtils')
    register_types_ns3_addressUtils(nested_module)
    
    
    ## Register a nested module for the namespace aodv
    
    nested_module = module.add_cpp_namespace('aodv')
    register_types_ns3_aodv(nested_module)
    
    
    ## Register a nested module for the namespace dot11s
    
    nested_module = module.add_cpp_namespace('dot11s')
    register_types_ns3_dot11s(nested_module)
    
    
    ## Register a nested module for the namespace dsdv
    
    nested_module = module.add_cpp_namespace('dsdv')
    register_types_ns3_dsdv(nested_module)
    
    
    ## Register a nested module for the namespace flame
    
    nested_module = module.add_cpp_namespace('flame')
    register_types_ns3_flame(nested_module)
    
    
    ## Register a nested module for the namespace internal
    
    nested_module = module.add_cpp_namespace('internal')
    register_types_ns3_internal(nested_module)
    
    
    ## Register a nested module for the namespace olsr
    
    nested_module = module.add_cpp_namespace('olsr')
    register_types_ns3_olsr(nested_module)
Exemplo n.º 5
0
def register_types(module):
    root_module = module.get_root()
    
    ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class]
    module.add_class('Ipv4NixVectorRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
    typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >', 'ns3::NixMap_t')
    typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >*', 'ns3::NixMap_t*')
    typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >&', 'ns3::NixMap_t&')
    typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >', 'ns3::Ipv4RouteMap_t')
    typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >*', 'ns3::Ipv4RouteMap_t*')
    typehandlers.add_type_alias('std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >&', 'ns3::Ipv4RouteMap_t&')
    
    ## Register a nested module for the namespace Config
    
    nested_module = module.add_cpp_namespace('Config')
    register_types_ns3_Config(nested_module)
    
    
    ## Register a nested module for the namespace FatalImpl
    
    nested_module = module.add_cpp_namespace('FatalImpl')
    register_types_ns3_FatalImpl(nested_module)
    
    
    ## Register a nested module for the namespace addressUtils
    
    nested_module = module.add_cpp_namespace('addressUtils')
    register_types_ns3_addressUtils(nested_module)
    
    
    ## Register a nested module for the namespace aodv
    
    nested_module = module.add_cpp_namespace('aodv')
    register_types_ns3_aodv(nested_module)
    
    
    ## Register a nested module for the namespace dot11s
    
    nested_module = module.add_cpp_namespace('dot11s')
    register_types_ns3_dot11s(nested_module)
    
    
    ## Register a nested module for the namespace dsdv
    
    nested_module = module.add_cpp_namespace('dsdv')
    register_types_ns3_dsdv(nested_module)
    
    
    ## Register a nested module for the namespace flame
    
    nested_module = module.add_cpp_namespace('flame')
    register_types_ns3_flame(nested_module)
    
    
    ## Register a nested module for the namespace internal
    
    nested_module = module.add_cpp_namespace('internal')
    register_types_ns3_internal(nested_module)
    
    
    ## Register a nested module for the namespace olsr
    
    nested_module = module.add_cpp_namespace('olsr')
    register_types_ns3_olsr(nested_module)
def register_types(module):
    root_module = module.get_root()

    ## ipv4-nix-vector-routing.h: ns3::Ipv4NixVectorRouting [class]
    module.add_class('Ipv4NixVectorRouting',
                     parent=root_module['ns3::Ipv4RoutingProtocol'])
    typehandlers.add_type_alias(
        'std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >',
        'ns3::NixMap_t')
    typehandlers.add_type_alias(
        'std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >*',
        'ns3::NixMap_t*')
    typehandlers.add_type_alias(
        'std::map< ns3::Ipv4Address, ns3::Ptr< ns3::NixVector >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::NixVector > > > >&',
        'ns3::NixMap_t&')
    typehandlers.add_type_alias(
        'std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >',
        'ns3::Ipv4RouteMap_t')
    typehandlers.add_type_alias(
        'std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >*',
        'ns3::Ipv4RouteMap_t*')
    typehandlers.add_type_alias(
        'std::map< ns3::Ipv4Address, ns3::Ptr< ns3::Ipv4Route >, std::less< ns3::Ipv4Address >, std::allocator< std::pair< ns3::Ipv4Address const, ns3::Ptr< ns3::Ipv4Route > > > >&',
        'ns3::Ipv4RouteMap_t&')

    ## Register a nested module for the namespace Config

    nested_module = module.add_cpp_namespace('Config')
    register_types_ns3_Config(nested_module)

    ## Register a nested module for the namespace FatalImpl

    nested_module = module.add_cpp_namespace('FatalImpl')
    register_types_ns3_FatalImpl(nested_module)

    ## Register a nested module for the namespace addressUtils

    nested_module = module.add_cpp_namespace('addressUtils')
    register_types_ns3_addressUtils(nested_module)

    ## Register a nested module for the namespace aodv

    nested_module = module.add_cpp_namespace('aodv')
    register_types_ns3_aodv(nested_module)

    ## Register a nested module for the namespace dot11s

    nested_module = module.add_cpp_namespace('dot11s')
    register_types_ns3_dot11s(nested_module)

    ## Register a nested module for the namespace flame

    nested_module = module.add_cpp_namespace('flame')
    register_types_ns3_flame(nested_module)

    ## Register a nested module for the namespace internal

    nested_module = module.add_cpp_namespace('internal')
    register_types_ns3_internal(nested_module)

    ## Register a nested module for the namespace olsr

    nested_module = module.add_cpp_namespace('olsr')
    register_types_ns3_olsr(nested_module)
Exemplo n.º 7
0
def register_types(module):
    root_module = module.get_root()

    ## histogram.h: ns3::Histogram [class]
    module.add_class('Histogram')
    ## simple-ref-count.h: ns3::SimpleRefCount<ns3::FlowClassifier, ns3::empty, ns3::DefaultDeleter<ns3::FlowClassifier> > [class]
    module.add_class('SimpleRefCount',
                     automatic_type_narrowing=True,
                     template_parameters=[
                         'ns3::FlowClassifier', 'ns3::empty',
                         'ns3::DefaultDeleter<ns3::FlowClassifier>'
                     ],
                     parent=root_module['ns3::empty'],
                     memory_policy=cppclass.ReferenceCountingMethodsPolicy(
                         incref_method='Ref',
                         decref_method='Unref',
                         peekref_method='GetReferenceCount'))
    ## simple-ref-count.h: ns3::SimpleRefCount<ns3::FlowProbe, ns3::empty, ns3::DefaultDeleter<ns3::FlowProbe> > [class]
    module.add_class('SimpleRefCount',
                     automatic_type_narrowing=True,
                     template_parameters=[
                         'ns3::FlowProbe', 'ns3::empty',
                         'ns3::DefaultDeleter<ns3::FlowProbe>'
                     ],
                     parent=root_module['ns3::empty'],
                     memory_policy=cppclass.ReferenceCountingMethodsPolicy(
                         incref_method='Ref',
                         decref_method='Unref',
                         peekref_method='GetReferenceCount'))
    ## flow-classifier.h: ns3::FlowClassifier [class]
    module.add_class(
        'FlowClassifier',
        parent=root_module[
            'ns3::SimpleRefCount< ns3::FlowClassifier, ns3::empty, ns3::DefaultDeleter<ns3::FlowClassifier> >']
    )
    ## flow-monitor.h: ns3::FlowMonitor [class]
    module.add_class('FlowMonitor', parent=root_module['ns3::Object'])
    ## flow-monitor.h: ns3::FlowMonitor::FlowStats [struct]
    module.add_class('FlowStats', outer_class=root_module['ns3::FlowMonitor'])
    ## flow-probe.h: ns3::FlowProbe [class]
    module.add_class(
        'FlowProbe',
        parent=root_module[
            'ns3::SimpleRefCount< ns3::FlowProbe, ns3::empty, ns3::DefaultDeleter<ns3::FlowProbe> >']
    )
    ## flow-probe.h: ns3::FlowProbe::FlowStats [struct]
    module.add_class('FlowStats', outer_class=root_module['ns3::FlowProbe'])
    ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier [class]
    module.add_class('Ipv4FlowClassifier',
                     parent=root_module['ns3::FlowClassifier'])
    ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple [struct]
    module.add_class('FiveTuple',
                     outer_class=root_module['ns3::Ipv4FlowClassifier'])
    ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe [class]
    module.add_class('Ipv4FlowProbe', parent=root_module['ns3::FlowProbe'])
    ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::DropReason [enumeration]
    module.add_enum('DropReason', [
        'DROP_NO_ROUTE', 'DROP_TTL_EXPIRE', 'DROP_BAD_CHECKSUM',
        'DROP_INVALID_REASON'
    ],
                    outer_class=root_module['ns3::Ipv4FlowProbe'])
    module.add_container(
        'std::map< unsigned int, ns3::FlowMonitor::FlowStats >',
        ('unsigned int', 'ns3::FlowMonitor::FlowStats'),
        container_type='map')
    module.add_container('std::map< unsigned int, ns3::FlowProbe::FlowStats >',
                         ('unsigned int', 'ns3::FlowProbe::FlowStats'),
                         container_type='map')
    typehandlers.add_type_alias('uint32_t', 'ns3::FlowPacketId')
    typehandlers.add_type_alias('uint32_t*', 'ns3::FlowPacketId*')
    typehandlers.add_type_alias('uint32_t&', 'ns3::FlowPacketId&')
    typehandlers.add_type_alias('uint32_t', 'ns3::FlowId')
    typehandlers.add_type_alias('uint32_t*', 'ns3::FlowId*')
    typehandlers.add_type_alias('uint32_t&', 'ns3::FlowId&')

    ## Register a nested module for the namespace Config

    nested_module = module.add_cpp_namespace('Config')
    register_types_ns3_Config(nested_module)

    ## Register a nested module for the namespace TimeStepPrecision

    nested_module = module.add_cpp_namespace('TimeStepPrecision')
    register_types_ns3_TimeStepPrecision(nested_module)

    ## Register a nested module for the namespace addressUtils

    nested_module = module.add_cpp_namespace('addressUtils')
    register_types_ns3_addressUtils(nested_module)

    ## Register a nested module for the namespace aodv

    nested_module = module.add_cpp_namespace('aodv')
    register_types_ns3_aodv(nested_module)

    ## Register a nested module for the namespace dot11s

    nested_module = module.add_cpp_namespace('dot11s')
    register_types_ns3_dot11s(nested_module)

    ## Register a nested module for the namespace flame

    nested_module = module.add_cpp_namespace('flame')
    register_types_ns3_flame(nested_module)

    ## Register a nested module for the namespace internal

    nested_module = module.add_cpp_namespace('internal')
    register_types_ns3_internal(nested_module)

    ## Register a nested module for the namespace olsr

    nested_module = module.add_cpp_namespace('olsr')
    register_types_ns3_olsr(nested_module)
def register_types(module):
    root_module = module.get_root()

    ## histogram.h: ns3::Histogram [class]
    module.add_class("Histogram")
    ## simple-ref-count.h: ns3::SimpleRefCount<ns3::FlowClassifier, ns3::empty, ns3::DefaultDeleter<ns3::FlowClassifier> > [class]
    module.add_class(
        "SimpleRefCount",
        automatic_type_narrowing=True,
        template_parameters=["ns3::FlowClassifier", "ns3::empty", "ns3::DefaultDeleter<ns3::FlowClassifier>"],
        parent=root_module["ns3::empty"],
        memory_policy=cppclass.ReferenceCountingMethodsPolicy(
            incref_method="Ref", decref_method="Unref", peekref_method="GetReferenceCount"
        ),
    )
    ## simple-ref-count.h: ns3::SimpleRefCount<ns3::FlowProbe, ns3::empty, ns3::DefaultDeleter<ns3::FlowProbe> > [class]
    module.add_class(
        "SimpleRefCount",
        automatic_type_narrowing=True,
        template_parameters=["ns3::FlowProbe", "ns3::empty", "ns3::DefaultDeleter<ns3::FlowProbe>"],
        parent=root_module["ns3::empty"],
        memory_policy=cppclass.ReferenceCountingMethodsPolicy(
            incref_method="Ref", decref_method="Unref", peekref_method="GetReferenceCount"
        ),
    )
    ## flow-classifier.h: ns3::FlowClassifier [class]
    module.add_class(
        "FlowClassifier",
        parent=root_module[
            "ns3::SimpleRefCount< ns3::FlowClassifier, ns3::empty, ns3::DefaultDeleter<ns3::FlowClassifier> >"
        ],
    )
    ## flow-monitor.h: ns3::FlowMonitor [class]
    module.add_class("FlowMonitor", parent=root_module["ns3::Object"])
    ## flow-monitor.h: ns3::FlowMonitor::FlowStats [struct]
    module.add_class("FlowStats", outer_class=root_module["ns3::FlowMonitor"])
    ## flow-probe.h: ns3::FlowProbe [class]
    module.add_class(
        "FlowProbe",
        parent=root_module["ns3::SimpleRefCount< ns3::FlowProbe, ns3::empty, ns3::DefaultDeleter<ns3::FlowProbe> >"],
    )
    ## flow-probe.h: ns3::FlowProbe::FlowStats [struct]
    module.add_class("FlowStats", outer_class=root_module["ns3::FlowProbe"])
    ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier [class]
    module.add_class("Ipv4FlowClassifier", parent=root_module["ns3::FlowClassifier"])
    ## ipv4-flow-classifier.h: ns3::Ipv4FlowClassifier::FiveTuple [struct]
    module.add_class("FiveTuple", outer_class=root_module["ns3::Ipv4FlowClassifier"])
    ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe [class]
    module.add_class("Ipv4FlowProbe", parent=root_module["ns3::FlowProbe"])
    ## ipv4-flow-probe.h: ns3::Ipv4FlowProbe::DropReason [enumeration]
    module.add_enum(
        "DropReason",
        ["DROP_NO_ROUTE", "DROP_TTL_EXPIRE", "DROP_BAD_CHECKSUM", "DROP_QUEUE", "DROP_INVALID_REASON"],
        outer_class=root_module["ns3::Ipv4FlowProbe"],
    )
    module.add_container(
        "std::map< unsigned int, ns3::FlowMonitor::FlowStats >",
        ("unsigned int", "ns3::FlowMonitor::FlowStats"),
        container_type="map",
    )
    module.add_container(
        "std::map< unsigned int, ns3::FlowProbe::FlowStats >",
        ("unsigned int", "ns3::FlowProbe::FlowStats"),
        container_type="map",
    )
    typehandlers.add_type_alias("uint32_t", "ns3::FlowPacketId")
    typehandlers.add_type_alias("uint32_t*", "ns3::FlowPacketId*")
    typehandlers.add_type_alias("uint32_t&", "ns3::FlowPacketId&")
    typehandlers.add_type_alias("uint32_t", "ns3::FlowId")
    typehandlers.add_type_alias("uint32_t*", "ns3::FlowId*")
    typehandlers.add_type_alias("uint32_t&", "ns3::FlowId&")

    ## Register a nested module for the namespace Config

    nested_module = module.add_cpp_namespace("Config")
    register_types_ns3_Config(nested_module)

    ## Register a nested module for the namespace FatalImpl

    nested_module = module.add_cpp_namespace("FatalImpl")
    register_types_ns3_FatalImpl(nested_module)

    ## Register a nested module for the namespace TimeStepPrecision

    nested_module = module.add_cpp_namespace("TimeStepPrecision")
    register_types_ns3_TimeStepPrecision(nested_module)

    ## Register a nested module for the namespace addressUtils

    nested_module = module.add_cpp_namespace("addressUtils")
    register_types_ns3_addressUtils(nested_module)

    ## Register a nested module for the namespace aodv

    nested_module = module.add_cpp_namespace("aodv")
    register_types_ns3_aodv(nested_module)

    ## Register a nested module for the namespace dot11s

    nested_module = module.add_cpp_namespace("dot11s")
    register_types_ns3_dot11s(nested_module)

    ## Register a nested module for the namespace flame

    nested_module = module.add_cpp_namespace("flame")
    register_types_ns3_flame(nested_module)

    ## Register a nested module for the namespace internal

    nested_module = module.add_cpp_namespace("internal")
    register_types_ns3_internal(nested_module)

    ## Register a nested module for the namespace olsr

    nested_module = module.add_cpp_namespace("olsr")
    register_types_ns3_olsr(nested_module)
Exemplo n.º 9
0
def register_types(module):
    root_module = module.get_root()
    
    ## data-output-interface.h: ns3::DataOutputCallback [class]
    module.add_class('DataOutputCallback', allow_subclassing=True)
    ## data-calculator.h: ns3::StatisticalSummary [class]
    module.add_class('StatisticalSummary', allow_subclassing=True)
    ## data-calculator.h: ns3::DataCalculator [class]
    module.add_class('DataCalculator', parent=root_module['ns3::Object'])
    ## data-collector.h: ns3::DataCollector [class]
    module.add_class('DataCollector', parent=root_module['ns3::Object'])
    ## data-output-interface.h: ns3::DataOutputInterface [class]
    module.add_class('DataOutputInterface', parent=root_module['ns3::Object'])
    ## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator<unsigned int> [class]
    module.add_class('MinMaxAvgTotalCalculator', template_parameters=['unsigned int'], parent=[root_module['ns3::DataCalculator'], root_module['ns3::StatisticalSummary']])
    ## omnet-data-output.h: ns3::OmnetDataOutput [class]
    module.add_class('OmnetDataOutput', parent=root_module['ns3::DataOutputInterface'])
    ## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator [class]
    module.add_class('PacketSizeMinMaxAvgTotalCalculator', parent=root_module['ns3::MinMaxAvgTotalCalculator< unsigned int >'])
    ## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator [class]
    module.add_class('TimeMinMaxAvgTotalCalculator', parent=root_module['ns3::DataCalculator'])
    ## basic-data-calculators.h: ns3::CounterCalculator<unsigned int> [class]
    module.add_class('CounterCalculator', template_parameters=['unsigned int'], parent=root_module['ns3::DataCalculator'])
    ## packet-data-calculators.h: ns3::PacketCounterCalculator [class]
    module.add_class('PacketCounterCalculator', parent=root_module['ns3::CounterCalculator< unsigned int >'])
    typehandlers.add_type_alias('std::list< std::pair< std::string, std::string >, std::allocator< std::pair< std::string, std::string > > >', 'ns3::MetadataList')
    typehandlers.add_type_alias('std::list< std::pair< std::string, std::string >, std::allocator< std::pair< std::string, std::string > > >*', 'ns3::MetadataList*')
    typehandlers.add_type_alias('std::list< std::pair< std::string, std::string >, std::allocator< std::pair< std::string, std::string > > >&', 'ns3::MetadataList&')
    typehandlers.add_type_alias('std::list< ns3::Ptr< ns3::DataCalculator >, std::allocator< ns3::Ptr< ns3::DataCalculator > > >', 'ns3::DataCalculatorList')
    typehandlers.add_type_alias('std::list< ns3::Ptr< ns3::DataCalculator >, std::allocator< ns3::Ptr< ns3::DataCalculator > > >*', 'ns3::DataCalculatorList*')
    typehandlers.add_type_alias('std::list< ns3::Ptr< ns3::DataCalculator >, std::allocator< ns3::Ptr< ns3::DataCalculator > > >&', 'ns3::DataCalculatorList&')
    
    ## Register a nested module for the namespace Config
    
    nested_module = module.add_cpp_namespace('Config')
    register_types_ns3_Config(nested_module)
    
    
    ## Register a nested module for the namespace FatalImpl
    
    nested_module = module.add_cpp_namespace('FatalImpl')
    register_types_ns3_FatalImpl(nested_module)
    
    
    ## Register a nested module for the namespace addressUtils
    
    nested_module = module.add_cpp_namespace('addressUtils')
    register_types_ns3_addressUtils(nested_module)
    
    
    ## Register a nested module for the namespace aodv
    
    nested_module = module.add_cpp_namespace('aodv')
    register_types_ns3_aodv(nested_module)
    
    
    ## Register a nested module for the namespace dot11s
    
    nested_module = module.add_cpp_namespace('dot11s')
    register_types_ns3_dot11s(nested_module)
    
    
    ## Register a nested module for the namespace dsdv
    
    nested_module = module.add_cpp_namespace('dsdv')
    register_types_ns3_dsdv(nested_module)
    
    
    ## Register a nested module for the namespace flame
    
    nested_module = module.add_cpp_namespace('flame')
    register_types_ns3_flame(nested_module)
    
    
    ## Register a nested module for the namespace internal
    
    nested_module = module.add_cpp_namespace('internal')
    register_types_ns3_internal(nested_module)
    
    
    ## Register a nested module for the namespace olsr
    
    nested_module = module.add_cpp_namespace('olsr')
    register_types_ns3_olsr(nested_module)
Exemplo n.º 10
0
def register_types(module):
    root_module = module.get_root()
    
    ## ff-mac-common.h (module 'lte'): ns3::Result_e [enumeration]
    module.add_enum('Result_e', ['SUCCESS', 'FAILURE'], import_from_module='ns.lte')
    ## ff-mac-common.h (module 'lte'): ns3::SetupRelease_e [enumeration]
    module.add_enum('SetupRelease_e', ['setup', 'release'], import_from_module='ns.lte')
    ## ff-mac-common.h (module 'lte'): ns3::CeBitmap_e [enumeration]
    module.add_enum('CeBitmap_e', ['TA', 'DRX', 'CR'], import_from_module='ns.lte')
    ## ff-mac-common.h (module 'lte'): ns3::NormalExtended_e [enumeration]
    module.add_enum('NormalExtended_e', ['normal', 'extended'], import_from_module='ns.lte')
    ## log.h (module 'core'): ns3::LogLevel [enumeration]
    module.add_enum('LogLevel', ['LOG_NONE', 'LOG_ERROR', 'LOG_LEVEL_ERROR', 'LOG_WARN', 'LOG_LEVEL_WARN', 'LOG_DEBUG', 'LOG_LEVEL_DEBUG', 'LOG_INFO', 'LOG_LEVEL_INFO', 'LOG_FUNCTION', 'LOG_LEVEL_FUNCTION', 'LOG_LOGIC', 'LOG_LEVEL_LOGIC', 'LOG_ALL', 'LOG_LEVEL_ALL', 'LOG_PREFIX_FUNC', 'LOG_PREFIX_TIME', 'LOG_PREFIX_NODE', 'LOG_PREFIX_LEVEL', 'LOG_PREFIX_ALL'], import_from_module='ns.core')
    ## address.h (module 'network'): ns3::Address [class]
    module.add_class('Address', import_from_module='ns.network')
    ## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
    module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address'], import_from_module='ns.network')
    ## eps-bearer.h (module 'lte'): ns3::AllocationRetentionPriority [struct]
    module.add_class('AllocationRetentionPriority', import_from_module='ns.lte')
    ## animation-interface.h (module 'netanim'): ns3::AnimationInterface [class]
    module.add_class('AnimationInterface')
    ## animation-interface.h (module 'netanim'): ns3::AnimationInterface::CounterType [enumeration]
    module.add_enum('CounterType', ['UINT32_COUNTER', 'DOUBLE_COUNTER'], outer_class=root_module['ns3::AnimationInterface'])
    typehandlers.add_type_alias(u'ns3::AnimationInterface::CounterType', u'ns3::AnimationInterface::CounterType')
    typehandlers.add_type_alias(u'ns3::AnimationInterface::CounterType*', u'ns3::AnimationInterface::CounterType*')
    typehandlers.add_type_alias(u'ns3::AnimationInterface::CounterType&', u'ns3::AnimationInterface::CounterType&')
    typehandlers.add_type_alias(u'void ( * ) ( char const * )', u'ns3::AnimationInterface::AnimWriteCallback')
    typehandlers.add_type_alias(u'void ( * ) ( char const * )*', u'ns3::AnimationInterface::AnimWriteCallback*')
    typehandlers.add_type_alias(u'void ( * ) ( char const * )&', u'ns3::AnimationInterface::AnimWriteCallback&')
    ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList [class]
    module.add_class('AttributeConstructionList', import_from_module='ns.core')
    ## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item [struct]
    module.add_class('Item', import_from_module='ns.core', outer_class=root_module['ns3::AttributeConstructionList'])
    typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator', u'ns3::AttributeConstructionList::CIterator')
    typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator*', u'ns3::AttributeConstructionList::CIterator*')
    typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator&', u'ns3::AttributeConstructionList::CIterator&')
    ## spectrum-model.h (module 'spectrum'): ns3::BandInfo [struct]
    module.add_class('B
Exemplo n.º 11
0
def register_types(module):
    root_module = module.get_root()

    submodule = SubModule("torrent_error_type", parent=root_module)
    submodule.add_enum(
        "tr_stat_errtype",
        [
            ("OK", "TR_STAT_OK"),
            ("TRACKER_WARNING", "TR_STAT_TRACKER_WARNING"),
            ("TRACKER_ERROR", "TR_STAT_TRACKER_ERROR"),
            ("LOCAL_ERROR", "TR_STAT_LOCAL_ERROR"),
        ],
    )

    submodule = SubModule("torrent_activity", parent=root_module)
    submodule.add_enum(
        "tr_torrent_activity",
        [
            ("STOPPED", "TR_STATUS_STOPPED"),
            ("CHECK_WAIT", "TR_STATUS_CHECK_WAIT"),
            ("CHECK", "TR_STATUS_CHECK"),
            ("DOWNLOAD_WAIT", "TR_STATUS_DOWNLOAD_WAIT"),
            ("DOWNLOAD", "TR_STATUS_DOWNLOAD"),
            ("SEED_WAIT", "TR_STATUS_SEED_WAIT"),
            ("SEED", "TR_STATUS_SEED"),
        ],
    )

    submodule = SubModule("tracker_state", parent=root_module)
    submodule.add_enum(
        "tr_tracker_state",
        [
            ("INACTIVE", "TR_TRACKER_INACTIVE"),
            ("WAITING", "TR_TRACKER_WAITING"),
            ("QUEUED", "TR_TRACKER_QUEUED"),
            ("ACTIVE", "TR_TRACKER_ACTIVE"),
        ],
    )

    submodule = SubModule("scheduled_days", parent=root_module)
    submodule.add_enum(
        "tr_sched_day",
        [
            ("SUN", "TR_SCHED_SUN"),
            ("MON", "TR_SCHED_MON"),
            ("TUES", "TR_SCHED_TUES"),
            ("WED", "TR_SCHED_WED"),
            ("THURS", "TR_SCHED_THURS"),
            ("FRI", "TR_SCHED_FRI"),
            ("SAT", "TR_SCHED_SAT"),
            ("WEEKDAY", "TR_SCHED_WEEKDAY"),
            ("WEEKEND", "TR_SCHED_WEEKEND"),
            ("ALL", "TR_SCHED_ALL"),
        ],
    )

    submodule = SubModule("encryption_mode", parent=root_module)
    submodule.add_enum(
        "tr_encryption_mode",
        [
            ("CLEAR_PREFERRED", "TR_CLEAR_PREFERRED"),
            ("ENCRYPTION_PREFERRED", "TR_ENCRYPTION_PREFERRED"),
            ("ENCRYPTION_REQUIRED", "TR_ENCRYPTION_REQUIRED"),
        ],
    )

    submodule = SubModule("direction", parent=root_module)
    submodule.add_enum(
        "tr_direction",
        [
            ("CLIENT_TO_PEER", "TR_CLIENT_TO_PEER"),
            ("UP", "TR_UP"),
            ("PEER_TO_CLIENT", "TR_PEER_TO_CLIENT"),
            ("DOWN", "TR_DOWN"),
        ],
    )

    submodule = SubModule("ratio_limit", parent=root_module)
    submodule.add_enum(
        "tr_ratiolimit",
        [
            ("GLOBAL", "TR_RATIOLIMIT_GLOBAL"),
            ("SINGLE", "TR_RATIOLIMIT_SINGLE"),
            ("UNLIMITED", "TR_RATIOLIMIT_UNLIMITED"),
        ],
    )

    submodule = SubModule("idle_limit", parent=root_module)
    submodule.add_enum(
        "tr_idlelimit",
        [("GLOBAL", "TR_IDLELIMIT_GLOBAL"), ("SINGLE", "TR_IDLELIMIT_SINGLE"), ("UNLIMITED", "TR_IDLELIMIT_UNLIMITED")],
    )

    submodule = SubModule("preallocation_mode", parent=root_module)
    submodule.add_enum(
        "tr_preallocation_mode",
        [("NONE", "TR_PREALLOCATE_NONE"), ("SPARCE", "TR_PREALLOCATE_SPARSE"), ("FULL", "TR_PREALLOCATE_FULL")],
    )

    submodule = SubModule("completeness", parent=root_module)
    submodule.add_enum(
        "tr_completeness", [("LEECH", "TR_LEECH"), ("SEED", "TR_SEED"), ("PARTIAL_SEED", "TR_PARTIAL_SEED")]
    )

    submodule = SubModule("rpc_callback_type", parent=root_module)
    submodule.add_enum(
        "tr_rpc_callback_type",
        [
            ("TORRENT_ADDED", "TR_RPC_TORRENT_ADDED"),
            ("TORRENT_STARTED", "TR_RPC_TORRENT_STARTED"),
            ("TORRENT_STOPPED", "TR_RPC_TORRENT_STOPPED"),
            ("TORRENT_REMOVING", "TR_RPC_TORRENT_REMOVING"),
            ("TORRENT_THRASHING", "TR_RPC_TORRENT_TRASHING"),
            ("TORRENT_CHANGED", "TR_RPC_TORRENT_CHANGED"),
            ("TORRENT_MOVED", "TR_RPC_TORRENT_MOVED"),
            ("SESSION_CHANGED", "TR_RPC_SESSION_CHANGED"),
            ("SESSION_QUEUE_POSITIONS_CHANGED", "TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED"),
            ("SESSION_CLOSE", "TR_RPC_SESSION_CLOSE"),
        ],
    )

    submodule = SubModule("rpc_callback_status", parent=root_module)
    submodule.add_enum("tr_rpc_callback_status", [("OK", "TR_RPC_OK"), ("NOREMOVE", "TR_RPC_NOREMOVE")])

    submodule = SubModule("port_forwarding", parent=root_module)
    submodule.add_enum(
        "tr_port_forwarding",
        [
            ("ERROR", "TR_PORT_ERROR"),
            ("UNMAPPED", "TR_PORT_UNMAPPED"),
            ("UNMAPPING", "TR_PORT_UNMAPPING"),
            ("MAPPING", "TR_PORT_MAPPING"),
            ("MAPPED", "TR_PORT_MAPPED"),
        ],
    )

    submodule = SubModule("msg_level", parent=root_module)
    submodule.add_enum("tr_msg_level", [("ERROR", "TR_MSG_ERR"), ("INF", "TR_MSG_INF"), ("DEBUG", "TR_MSG_DBG")])

    submodule = SubModule("parse_result", parent=root_module)
    submodule.add_enum(
        "tr_parse_result", [("OK", "TR_PARSE_OK"), ("ERROR", "TR_PARSE_ERR"), ("DUPLICATE", "TR_PARSE_DUPLICATE")]
    )

    submodule = SubModule("torrent_constructor_mode", parent=root_module)
    submodule.add_enum("tr_ctorMode", [("FALLBACK", "TR_FALLBACK"), ("FORCE", "TR_FORCE")])

    submodule = SubModule("location_state", parent=root_module)
    submodule.add_enum("", [("MOVING", "TR_LOC_MOVING"), ("DONE", "TR_LOC_DONE"), ("ERROR", "TR_LOC_ERROR")])

    submodule = SubModule("priority", parent=root_module)
    submodule.add_enum("", [("LOW", "TR_PRI_LOW"), ("NORMAL", "TR_PRI_NORMAL"), ("HIGH", "TR_PRI_HIGH")])

    submodule = SubModule("peers_from_index", parent=root_module)
    submodule.add_enum(
        "",
        [
            ("INCOMING", "TR_PEER_FROM_INCOMING"),
            ("LPD", "TR_PEER_FROM_LPD"),
            ("TRACKER", "TR_PEER_FROM_TRACKER"),
            ("DHT", "TR_PEER_FROM_DHT"),
            ("PEX", "TR_PEER_FROM_PEX"),
            ("RESUME", "TR_PEER_FROM_RESUME"),
            ("LTEP", "TR_PEER_FROM_LTEP"),
        ],
    )

    submodule = SubModule("benc_serialization_mode", parent=root_module)
    submodule.add_enum(
        "tr_fmt_mode", [("BENC", "TR_FMT_BENC"), ("JSON", "TR_FMT_JSON"), ("JSON_LEAN", "TR_FMT_JSON_LEAN")]
    )

    submodule = SubModule("benc_type", parent=root_module)
    submodule.add_enum(
        "",
        [
            ("INT", "TR_TYPE_INT"),
            ("STRING", "TR_TYPE_STR"),
            ("LIST", "TR_TYPE_LIST"),
            ("DICT", "TR_TYPE_DICT"),
            ("BOOL", "TR_TYPE_BOOL"),
            ("REAL", "TR_TYPE_REAL"),
        ],
    )
    ## tr_info.cc
    module.begin_section("tr_info")
    module.add_struct(
        "tr_info",
        no_constructor=True,
        no_copy=True,
        memory_policy=TrFreeFunctionPolicy("tr_metainfoFree"),
        custom_name="TorrentInfo",
    )

    module.add_struct("tr_file", no_constructor=True, no_copy=True, custom_name="File")

    module.add_struct("tr_piece", no_constructor=True, no_copy=True, custom_name="FilePiece")

    module.add_struct("tr_tracker_info", no_constructor=True, no_copy=True, custom_name="TrackerInfo")

    module.add_struct(
        "tr_tracker_stat", no_constructor=True, no_copy=True, free_function="tr_free", custom_name="TrackerStats"
    )
    module.end_section("tr_info")

    ## tr_torrent.cc
    module.begin_section("tr_torrent")
    torrent = module.add_struct(
        "tr_torrent",
        no_constructor=True,
        no_copy=True,
        memory_policy=TrFreeFunctionPolicy("tr_torrentFree"),
        custom_name="Torrent",
    )
    # torrent.cannot_be_constructed = "use factory function Session.torrent_new()"

    module.add_struct(
        "tr_ctor",
        no_constructor=True,
        no_copy=True,
        memory_policy=TrFreeFunctionPolicy("tr_ctorFree"),
        custom_name="TorrentConstructor",
    )

    module.add_struct(
        "tr_stat",
        no_constructor=True,
        no_copy=True,
        memory_policy=TrFreeFunctionPolicy("tr_free"),
        custom_name="TorrentStats",
    )

    module.add_struct(
        "tr_peer_stat",
        no_constructor=True,
        no_copy=True,
        memory_policy=TrFreeFunctionPolicy("tr_free"),
        custom_name="PeerStats",
    )

    module.add_struct(
        "tr_file_stat", no_constructor=True, no_copy=True, free_function="tr_free", custom_name="FileStats"
    )
    module.end_section("tr_torrent")

    ## tr_session.cc
    module.begin_section("tr_session")
    module.add_struct(
        "tr_session",
        no_constructor=True,
        no_copy=True,
        memory_policy=TrFreeFunctionPolicy("tr_sessionClose"),
        custom_name="Session",
    )

    module.add_struct(
        "tr_session_stats",
        no_constructor=True,
        no_copy=True,
        memory_policy=cppclass.FreeFunctionPolicy("tr_free"),
        custom_name="SessionStats",
    )

    module.add_struct(
        "tr_msg_list", no_constructor=True, no_copy=True, free_function="tr_freeMessageList", custom_name="Message"
    )
    module.end_section("tr_session")

    ## tr_benc.cc
    module.begin_section("tr_benc")
    submodule = SubModule("bencode", parent=root_module)
    benc = submodule.add_struct("Benc", no_constructor=True, no_copy=True, memory_policy=BencMemoryPolicy())
    benc.full_name = "tr_benc"

    submodule.add_struct("BencInt", parent=benc, no_constructor=True, no_copy=True).full_name = "tr_benc"

    submodule.add_struct("BencString", parent=benc, no_constructor=True, no_copy=True).full_name = "tr_benc"

    submodule.add_struct("BencList", parent=benc, no_constructor=True, no_copy=True).full_name = "tr_benc"

    submodule.add_struct("BencDict", parent=benc, no_constructor=True, no_copy=True).full_name = "tr_benc"

    submodule.add_struct("BencBool", parent=benc, no_constructor=True, no_copy=True).full_name = "tr_benc"

    submodule.add_struct("BencReal", parent=benc, no_constructor=True, no_copy=True).full_name = "tr_benc"
    module.end_section("tr_benc")

    typehandlers.add_type_alias("uint32_t", "tr_piece_index_t")
    typehandlers.add_type_alias("uint32_t", "tr_file_index_t")
    typehandlers.add_type_alias("uint32_t*", "tr_file_index_t*")
    typehandlers.add_type_alias("long int", "time_t")
    typehandlers.add_type_alias("int8_t", "tr_priority_t")
    typehandlers.add_type_alias("uint16_t", "tr_port")
Exemplo n.º 12
0
def register_types(module):
    root_module = module.get_root()

    submodule = SubModule('torrent_error_type', parent=root_module)
    submodule.add_enum('tr_stat_errtype',
                       [('OK', 'TR_STAT_OK'),
                        ('TRACKER_WARNING', 'TR_STAT_TRACKER_WARNING'),
                        ('TRACKER_ERROR', 'TR_STAT_TRACKER_ERROR'),
                        ('LOCAL_ERROR', 'TR_STAT_LOCAL_ERROR')])

    submodule = SubModule('torrent_activity', parent=root_module)
    submodule.add_enum('tr_torrent_activity',
                       [('STOPPED', 'TR_STATUS_STOPPED'),
                        ('CHECK_WAIT', 'TR_STATUS_CHECK_WAIT'),
                        ('CHECK', 'TR_STATUS_CHECK'),
                        ('DOWNLOAD_WAIT', 'TR_STATUS_DOWNLOAD_WAIT'),
                        ('DOWNLOAD', 'TR_STATUS_DOWNLOAD'),
                        ('SEED_WAIT', 'TR_STATUS_SEED_WAIT'),
                        ('SEED', 'TR_STATUS_SEED')])

    submodule = SubModule('tracker_state', parent=root_module)
    submodule.add_enum('tr_tracker_state',
                       [('INACTIVE', 'TR_TRACKER_INACTIVE'),
                        ('WAITING', 'TR_TRACKER_WAITING'),
                        ('QUEUED', 'TR_TRACKER_QUEUED'),
                        ('ACTIVE', 'TR_TRACKER_ACTIVE')])

    submodule = SubModule('scheduled_days', parent=root_module)
    submodule.add_enum('tr_sched_day', [('SUN', 'TR_SCHED_SUN'),
                                        ('MON', 'TR_SCHED_MON'),
                                        ('TUES', 'TR_SCHED_TUES'),
                                        ('WED', 'TR_SCHED_WED'),
                                        ('THURS', 'TR_SCHED_THURS'),
                                        ('FRI', 'TR_SCHED_FRI'),
                                        ('SAT', 'TR_SCHED_SAT'),
                                        ('WEEKDAY', 'TR_SCHED_WEEKDAY'),
                                        ('WEEKEND', 'TR_SCHED_WEEKEND'),
                                        ('ALL', 'TR_SCHED_ALL')])

    submodule = SubModule('encryption_mode', parent=root_module)
    submodule.add_enum('tr_encryption_mode',
                       [('CLEAR_PREFERRED', 'TR_CLEAR_PREFERRED'),
                        ('ENCRYPTION_PREFERRED', 'TR_ENCRYPTION_PREFERRED'),
                        ('ENCRYPTION_REQUIRED', 'TR_ENCRYPTION_REQUIRED')])

    submodule = SubModule('direction', parent=root_module)
    submodule.add_enum('tr_direction',
                       [('CLIENT_TO_PEER', 'TR_CLIENT_TO_PEER'),
                        ('UP', 'TR_UP'),
                        ('PEER_TO_CLIENT', 'TR_PEER_TO_CLIENT'),
                        ('DOWN', 'TR_DOWN')])

    submodule = SubModule('ratio_limit', parent=root_module)
    submodule.add_enum('tr_ratiolimit',
                       [('GLOBAL', 'TR_RATIOLIMIT_GLOBAL'),
                        ('SINGLE', 'TR_RATIOLIMIT_SINGLE'),
                        ('UNLIMITED', 'TR_RATIOLIMIT_UNLIMITED')])

    submodule = SubModule('idle_limit', parent=root_module)
    submodule.add_enum('tr_idlelimit',
                       [('GLOBAL', 'TR_IDLELIMIT_GLOBAL'),
                        ('SINGLE', 'TR_IDLELIMIT_SINGLE'),
                        ('UNLIMITED', 'TR_IDLELIMIT_UNLIMITED')])

    submodule = SubModule('preallocation_mode', parent=root_module)
    submodule.add_enum('tr_preallocation_mode',
                       [('NONE', 'TR_PREALLOCATE_NONE'),
                        ('SPARCE', 'TR_PREALLOCATE_SPARSE'),
                        ('FULL', 'TR_PREALLOCATE_FULL')])

    submodule = SubModule('completeness', parent=root_module)
    submodule.add_enum('tr_completeness',
                       [('LEECH', 'TR_LEECH'), ('SEED', 'TR_SEED'),
                        ('PARTIAL_SEED', 'TR_PARTIAL_SEED')])

    submodule = SubModule('rpc_callback_type', parent=root_module)
    submodule.add_enum('tr_rpc_callback_type',
                       [('TORRENT_ADDED', 'TR_RPC_TORRENT_ADDED'),
                        ('TORRENT_STARTED', 'TR_RPC_TORRENT_STARTED'),
                        ('TORRENT_STOPPED', 'TR_RPC_TORRENT_STOPPED'),
                        ('TORRENT_REMOVING', 'TR_RPC_TORRENT_REMOVING'),
                        ('TORRENT_THRASHING', 'TR_RPC_TORRENT_TRASHING'),
                        ('TORRENT_CHANGED', 'TR_RPC_TORRENT_CHANGED'),
                        ('TORRENT_MOVED', 'TR_RPC_TORRENT_MOVED'),
                        ('SESSION_CHANGED', 'TR_RPC_SESSION_CHANGED'),
                        ('SESSION_QUEUE_POSITIONS_CHANGED',
                         'TR_RPC_SESSION_QUEUE_POSITIONS_CHANGED'),
                        ('SESSION_CLOSE', 'TR_RPC_SESSION_CLOSE')])

    submodule = SubModule('rpc_callback_status', parent=root_module)
    submodule.add_enum('tr_rpc_callback_status',
                       [('OK', 'TR_RPC_OK'), ('NOREMOVE', 'TR_RPC_NOREMOVE')])

    submodule = SubModule('port_forwarding', parent=root_module)
    submodule.add_enum('tr_port_forwarding',
                       [('ERROR', 'TR_PORT_ERROR'),
                        ('UNMAPPED', 'TR_PORT_UNMAPPED'),
                        ('UNMAPPING', 'TR_PORT_UNMAPPING'),
                        ('MAPPING', 'TR_PORT_MAPPING'),
                        ('MAPPED', 'TR_PORT_MAPPED')])

    submodule = SubModule('msg_level', parent=root_module)
    submodule.add_enum('tr_msg_level', [('ERROR', 'TR_MSG_ERR'),
                                        ('INF', 'TR_MSG_INF'),
                                        ('DEBUG', 'TR_MSG_DBG')])

    submodule = SubModule('parse_result', parent=root_module)
    submodule.add_enum('tr_parse_result',
                       [('OK', 'TR_PARSE_OK'), ('ERROR', 'TR_PARSE_ERR'),
                        ('DUPLICATE', 'TR_PARSE_DUPLICATE')])

    submodule = SubModule('torrent_constructor_mode', parent=root_module)
    submodule.add_enum('tr_ctorMode', [('FALLBACK', 'TR_FALLBACK'),
                                       ('FORCE', 'TR_FORCE')])

    submodule = SubModule('location_state', parent=root_module)
    submodule.add_enum('',
                       [('MOVING', 'TR_LOC_MOVING'), ('DONE', 'TR_LOC_DONE'),
                        ('ERROR', 'TR_LOC_ERROR')])

    submodule = SubModule('priority', parent=root_module)
    submodule.add_enum('', [('LOW', 'TR_PRI_LOW'), ('NORMAL', 'TR_PRI_NORMAL'),
                            ('HIGH', 'TR_PRI_HIGH')])

    submodule = SubModule('peers_from_index', parent=root_module)
    submodule.add_enum('', [('INCOMING', 'TR_PEER_FROM_INCOMING'),
                            ('LPD', 'TR_PEER_FROM_LPD'),
                            ('TRACKER', 'TR_PEER_FROM_TRACKER'),
                            ('DHT', 'TR_PEER_FROM_DHT'),
                            ('PEX', 'TR_PEER_FROM_PEX'),
                            ('RESUME', 'TR_PEER_FROM_RESUME'),
                            ('LTEP', 'TR_PEER_FROM_LTEP')])

    submodule = SubModule('benc_serialization_mode', parent=root_module)
    submodule.add_enum('tr_fmt_mode', [('BENC', 'TR_FMT_BENC'),
                                       ('JSON', 'TR_FMT_JSON'),
                                       ('JSON_LEAN', 'TR_FMT_JSON_LEAN')])

    submodule = SubModule('benc_type', parent=root_module)
    submodule.add_enum('', [('INT', 'TR_TYPE_INT'), ('STRING', 'TR_TYPE_STR'),
                            ('LIST', 'TR_TYPE_LIST'), ('DICT', 'TR_TYPE_DICT'),
                            ('BOOL', 'TR_TYPE_BOOL'),
                            ('REAL', 'TR_TYPE_REAL')])
    ## tr_info.cc
    module.begin_section('tr_info')
    module.add_struct('tr_info',
                      no_constructor=True,
                      no_copy=True,
                      memory_policy=TrFreeFunctionPolicy('tr_metainfoFree'),
                      custom_name='TorrentInfo')

    module.add_struct('tr_file',
                      no_constructor=True,
                      no_copy=True,
                      custom_name='File')

    module.add_struct('tr_piece',
                      no_constructor=True,
                      no_copy=True,
                      custom_name='FilePiece')

    module.add_struct('tr_tracker_info',
                      no_constructor=True,
                      no_copy=True,
                      custom_name='TrackerInfo')

    module.add_struct('tr_tracker_stat',
                      no_constructor=True,
                      no_copy=True,
                      free_function='tr_free',
                      custom_name='TrackerStats')
    module.end_section('tr_info')

    ## tr_torrent.cc
    module.begin_section('tr_torrent')
    torrent = module.add_struct(
        'tr_torrent',
        no_constructor=True,
        no_copy=True,
        memory_policy=TrFreeFunctionPolicy('tr_torrentFree'),
        custom_name='Torrent')
    #torrent.cannot_be_constructed = "use factory function Session.torrent_new()"

    module.add_struct('tr_ctor',
                      no_constructor=True,
                      no_copy=True,
                      memory_policy=TrFreeFunctionPolicy('tr_ctorFree'),
                      custom_name='TorrentConstructor')

    module.add_struct('tr_stat',
                      no_constructor=True,
                      no_copy=True,
                      memory_policy=TrFreeFunctionPolicy('tr_free'),
                      custom_name='TorrentStats')

    module.add_struct('tr_peer_stat',
                      no_constructor=True,
                      no_copy=True,
                      memory_policy=TrFreeFunctionPolicy('tr_free'),
                      custom_name='PeerStats')

    module.add_struct('tr_file_stat',
                      no_constructor=True,
                      no_copy=True,
                      free_function='tr_free',
                      custom_name='FileStats')
    module.end_section('tr_torrent')

    ## tr_session.cc
    module.begin_section('tr_session')
    module.add_struct('tr_session',
                      no_constructor=True,
                      no_copy=True,
                      memory_policy=TrFreeFunctionPolicy('tr_sessionClose'),
                      custom_name='Session')

    module.add_struct('tr_session_stats',
                      no_constructor=True,
                      no_copy=True,
                      memory_policy=cppclass.FreeFunctionPolicy('tr_free'),
                      custom_name='SessionStats')

    module.add_struct('tr_msg_list',
                      no_constructor=True,
                      no_copy=True,
                      free_function='tr_freeMessageList',
                      custom_name='Message')
    module.end_section('tr_session')

    ## tr_benc.cc
    module.begin_section('tr_benc')
    submodule = SubModule('bencode', parent=root_module)
    benc = submodule.add_struct('Benc',
                                no_constructor=True,
                                no_copy=True,
                                memory_policy=BencMemoryPolicy())
    benc.full_name = 'tr_benc'

    submodule.add_struct('BencInt',
                         parent=benc,
                         no_constructor=True,
                         no_copy=True).full_name = 'tr_benc'

    submodule.add_struct('BencString',
                         parent=benc,
                         no_constructor=True,
                         no_copy=True).full_name = 'tr_benc'

    submodule.add_struct('BencList',
                         parent=benc,
                         no_constructor=True,
                         no_copy=True).full_name = 'tr_benc'

    submodule.add_struct('BencDict',
                         parent=benc,
                         no_constructor=True,
                         no_copy=True).full_name = 'tr_benc'

    submodule.add_struct('BencBool',
                         parent=benc,
                         no_constructor=True,
                         no_copy=True).full_name = 'tr_benc'

    submodule.add_struct('BencReal',
                         parent=benc,
                         no_constructor=True,
                         no_copy=True).full_name = 'tr_benc'
    module.end_section('tr_benc')

    typehandlers.add_type_alias('uint32_t', 'tr_piece_index_t')
    typehandlers.add_type_alias('uint32_t', 'tr_file_index_t')
    typehandlers.add_type_alias('uint32_t*', 'tr_file_index_t*')
    typehandlers.add_type_alias('long int', 'time_t')
    typehandlers.add_type_alias('int8_t', 'tr_priority_t')
    typehandlers.add_type_alias('uint16_t', 'tr_port')