author | Tom Henderson <tomh@tomh.org> |
Mon, 15 Dec 2008 07:25:27 -0800 | |
changeset 4024 | dfd0bc16dc99 |
parent 3972 | a84f2ab246e6 |
child 4218 | debf1a8a96d3 |
permissions | -rw-r--r-- |
3468
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
1 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass |
3408 | 2 |
|
3 |
def register_types(module): |
|
4 |
root_module = module.get_root() |
|
5 |
||
6 |
## packet-sink.h: ns3::PacketSink [class] |
|
3457 | 7 |
module.add_class('PacketSink', parent=root_module['ns3::Application']) |
3408 | 8 |
|
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
9 |
## Register a nested module for the namespace Config |
3408 | 10 |
|
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
11 |
nested_module = module.add_cpp_namespace('Config') |
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
12 |
register_types_ns3_Config(nested_module) |
3408 | 13 |
|
14 |
||
15 |
## Register a nested module for the namespace TimeStepPrecision |
|
16 |
||
17 |
nested_module = module.add_cpp_namespace('TimeStepPrecision') |
|
18 |
register_types_ns3_TimeStepPrecision(nested_module) |
|
19 |
||
20 |
||
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
21 |
## Register a nested module for the namespace internal |
3408 | 22 |
|
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
23 |
nested_module = module.add_cpp_namespace('internal') |
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
24 |
register_types_ns3_internal(nested_module) |
3408 | 25 |
|
26 |
||
27 |
## Register a nested module for the namespace olsr |
|
28 |
||
29 |
nested_module = module.add_cpp_namespace('olsr') |
|
30 |
register_types_ns3_olsr(nested_module) |
|
31 |
||
32 |
||
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
33 |
def register_types_ns3_Config(module): |
3408 | 34 |
root_module = module.get_root() |
35 |
||
36 |
||
37 |
def register_types_ns3_TimeStepPrecision(module): |
|
38 |
root_module = module.get_root() |
|
39 |
||
40 |
||
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
41 |
def register_types_ns3_internal(module): |
3408 | 42 |
root_module = module.get_root() |
43 |
||
44 |
||
45 |
def register_types_ns3_olsr(module): |
|
46 |
root_module = module.get_root() |
|
47 |
||
48 |
||
49 |
def register_methods(root_module): |
|
50 |
register_Ns3PacketSink_methods(root_module, root_module['ns3::PacketSink']) |
|
51 |
return |
|
52 |
||
53 |
def register_Ns3PacketSink_methods(root_module, cls): |
|
3972 | 54 |
## packet-sink.h: ns3::PacketSink::PacketSink(ns3::PacketSink const & arg0) [copy constructor] |
55 |
cls.add_constructor([param('ns3::PacketSink const &', 'arg0')]) |
|
3408 | 56 |
## packet-sink.h: static ns3::TypeId ns3::PacketSink::GetTypeId() [member function] |
3468
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
57 |
cls.add_method('GetTypeId', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
58 |
'ns3::TypeId', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
59 |
[], |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
60 |
is_static=True) |
3408 | 61 |
## packet-sink.h: ns3::PacketSink::PacketSink() [constructor] |
3468
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
62 |
cls.add_constructor([]) |
3408 | 63 |
## packet-sink.h: void ns3::PacketSink::DoDispose() [member function] |
3468
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
64 |
cls.add_method('DoDispose', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
65 |
'void', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
66 |
[], |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
67 |
visibility='protected', is_virtual=True) |
3408 | 68 |
## packet-sink.h: void ns3::PacketSink::StartApplication() [member function] |
3468
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
69 |
cls.add_method('StartApplication', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
70 |
'void', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
71 |
[], |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
72 |
visibility='private', is_virtual=True) |
3408 | 73 |
## packet-sink.h: void ns3::PacketSink::StopApplication() [member function] |
3468
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
74 |
cls.add_method('StopApplication', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
75 |
'void', |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
76 |
[], |
0bb5275704fc
Python: new pybindgen, rescan API definitions, new API definition files are more multi-line and hopefully easier to read
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
77 |
visibility='private', is_virtual=True) |
3408 | 78 |
return |
79 |
||
80 |
def register_functions(root_module): |
|
81 |
module = root_module |
|
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
82 |
register_functions_ns3_Config(module.get_submodule('Config'), root_module) |
3408 | 83 |
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) |
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
84 |
register_functions_ns3_internal(module.get_submodule('internal'), root_module) |
3408 | 85 |
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) |
86 |
return |
|
87 |
||
3855
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
88 |
def register_functions_ns3_Config(module, root_module): |
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
89 |
return |
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
90 |
|
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
91 |
def register_functions_ns3_TimeStepPrecision(module, root_module): |
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
92 |
return |
7fdcbeea6c4f
Python: require new pybindgen and re-scan API to make the list of free functions and namespaces sorted.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3574
diff
changeset
|
93 |
|
3408 | 94 |
def register_functions_ns3_internal(module, root_module): |
95 |
return |
|
96 |
||
97 |
def register_functions_ns3_olsr(module, root_module): |
|
98 |
return |
|
99 |