How to use the pybindgen.FileCodeSink function in PyBindGen

To help you get started, we’ve selected a few PyBindGen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nyuwireless-unipd / ns3-mmwave / src / config-store / bindings / modulegen__gcc_LP64.py View on Github external
def main():
    out = FileCodeSink(sys.stdout)
    root_module = module_init()
    register_types(root_module)
    register_methods(root_module)
    register_functions(root_module)
    root_module.generate(out)
github Gabrielcarvfer / NS3 / src / config-store / bindings / modulegen__gcc_LP64.py View on Github external
def main():
    out = FileCodeSink(sys.stdout)
    root_module = module_init()
    register_types(root_module)
    register_methods(root_module)
    register_functions(root_module)
    root_module.generate(out)
github Gabrielcarvfer / NS3 / bindings / python / ns3modulegen.py View on Github external
def __init__(self, main_file_name, modules):
        super(MyMultiSectionFactory, self).__init__()
        self.main_file_name = main_file_name
        self.main_sink = FileCodeSink(open(main_file_name, "wt"))
        self.header_name = "ns3module.h"
        header_file_name = os.path.join(os.path.dirname(self.main_file_name), 'pch', self.header_name)
        self.header_sink = FileCodeSink(open(header_file_name, "wt"))
        self.section_sinks = {'__main__': self.main_sink}

        for module in modules:
            section_name = 'ns3_module_%s' % module.replace('-', '_')
            file_name = os.path.join(os.path.dirname(self.main_file_name), "%s.cc" % section_name)
            sink = FileCodeSink(open(file_name, "wt"))
            self.section_sinks[section_name] = sink
github Gabrielcarvfer / NS3 / 3rd-party / pybindgen / examples / a / module-autogen.py View on Github external
def my_module_gen():
    module_parser = ModuleParser('a1', '::')
    module = module_parser.parse([sys.argv[1]])
    module.add_include('"a.h"')

    module.generate(FileCodeSink(sys.stdout))
github samueljero / snake / ns-3-dev / bindings / python / ns3modulegen-modular.py View on Github external
def __init__(self, main_file_name):
        super(MyMultiSectionFactory, self).__init__()
        self.main_file_name = main_file_name
        self.main_sink = FileCodeSink(open(main_file_name, "wt"))
        self.header_name = "ns3module.h"
        header_file_name = os.path.join(os.path.dirname(self.main_file_name), self.header_name)
        #print >> sys.stderr, ">>>>>>>>>>>>>>>>>", header_file_name, main_file_name
        self.header_sink = FileCodeSink(open(header_file_name, "wt"))
    def get_section_code_sink(self, section_name):
github nyuwireless-unipd / ns3-mmwave / bindings / python / ns3modulegen-modular.py View on Github external
def __init__(self, main_file_name):
        super(MyMultiSectionFactory, self).__init__()
        self.main_file_name = main_file_name
        self.main_sink = FileCodeSink(open(main_file_name, "wt"))
        self.header_name = "ns3module.h"
        header_file_name = os.path.join(os.path.dirname(self.main_file_name), self.header_name)
        #print >> sys.stderr, ">>>>>>>>>>>>>>>>>", header_file_name, main_file_name
        self.header_sink = FileCodeSink(open(header_file_name, "wt"))
    def get_section_code_sink(self, section_name):
github Gabrielcarvfer / NS3 / 3rd-party / pybindgen / examples / a / module-autoscan.py View on Github external
def my_module_gen():
    module_parser = ModuleParser('a2', '::')
    module_parser.parse([sys.argv[1]], includes=['"a.h"'], pygen_sink=FileCodeSink(sys.stdout))
github Gabrielcarvfer / NS3 / 3rd-party / pybindgen / examples / buffer / modulegen.py View on Github external
def my_module_gen(out_file):

    mod = Module('c')
    mod.add_include('"c.h"')

    mod.add_function("GetBuffer", BufferReturn("unsigned short int*", "GetBufferLen()"), [])
    mod.add_function("GetBufferLen", ReturnValue.new("int"), [])
    mod.add_function("GetBufferChecksum", ReturnValue.new("unsigned short"), [])

    mod.generate(FileCodeSink(out_file))
github Gabrielcarvfer / NS3 / 3rd-party / pybindgen / examples / f / modulegen.py View on Github external
def my_module_gen(out_file):
    mod = Module('f')
    mod.add_include('"f.h"')

    FBase = mod.add_class('FBase', allow_subclassing=True)
    
    FBase.add_constructor([])
    FBase.add_method('DoA', None, [], is_virtual=True, is_pure_virtual=True)
    FBase.add_method('PrivDoB', None, [], is_virtual=True, is_pure_virtual=True, visibility='private')
    FBase.add_method('DoB', None, [])

    mod.generate(FileCodeSink(out_file) )