author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Tue, 19 May 2009 15:35:05 +0200 | |
changeset 4449 | c11b6d768ab3 |
parent 4241 | c35796bc0b4b |
child 4454 | f2af91ee09e7 |
permissions | -rw-r--r-- |
4449
c11b6d768ab3
rescan python
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4241
diff
changeset
|
1 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers |
3408 | 2 |
|
3 |
def register_types(module): |
|
4 |
root_module = module.get_root() |
|
5 |
||
6 |
## udp-echo-client.h: ns3::UdpEchoClient [class] |
|
3457 | 7 |
module.add_class('UdpEchoClient', parent=root_module['ns3::Application']) |
3408 | 8 |
## udp-echo-server.h: ns3::UdpEchoServer [class] |
3457 | 9 |
module.add_class('UdpEchoServer', parent=root_module['ns3::Application']) |
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 |
## Register a nested module for the namespace Config |
3408 | 12 |
|
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
|
13 |
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
|
14 |
register_types_ns3_Config(nested_module) |
3408 | 15 |
|
16 |
||
17 |
## Register a nested module for the namespace TimeStepPrecision |
|
18 |
||
19 |
nested_module = module.add_cpp_namespace('TimeStepPrecision') |
|
20 |
register_types_ns3_TimeStepPrecision(nested_module) |
|
21 |
||
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 |
## Register a nested module for the namespace internal |
3408 | 24 |
|
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
|
25 |
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
|
26 |
register_types_ns3_internal(nested_module) |
3408 | 27 |
|
28 |
||
29 |
## Register a nested module for the namespace olsr |
|
30 |
||
31 |
nested_module = module.add_cpp_namespace('olsr') |
|
32 |
register_types_ns3_olsr(nested_module) |
|
33 |
||
34 |
||
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
|
35 |
def register_types_ns3_Config(module): |
3408 | 36 |
root_module = module.get_root() |
37 |
||
38 |
||
39 |
def register_types_ns3_TimeStepPrecision(module): |
|
40 |
root_module = module.get_root() |
|
41 |
||
42 |
||
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
|
43 |
def register_types_ns3_internal(module): |
3408 | 44 |
root_module = module.get_root() |
45 |
||
46 |
||
47 |
def register_types_ns3_olsr(module): |
|
48 |
root_module = module.get_root() |
|
49 |
||
50 |
||
51 |
def register_methods(root_module): |
|
52 |
register_Ns3UdpEchoClient_methods(root_module, root_module['ns3::UdpEchoClient']) |
|
53 |
register_Ns3UdpEchoServer_methods(root_module, root_module['ns3::UdpEchoServer']) |
|
54 |
return |
|
55 |
||
56 |
def register_Ns3UdpEchoClient_methods(root_module, cls): |
|
4241
c35796bc0b4b
rescan python
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4218
diff
changeset
|
57 |
## udp-echo-client.h: ns3::UdpEchoClient::UdpEchoClient(ns3::UdpEchoClient const & arg0) [copy constructor] |
c35796bc0b4b
rescan python
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4218
diff
changeset
|
58 |
cls.add_constructor([param('ns3::UdpEchoClient const &', 'arg0')]) |
3408 | 59 |
## udp-echo-client.h: static ns3::TypeId ns3::UdpEchoClient::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
|
60 |
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
|
61 |
'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
|
62 |
[], |
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
|
63 |
is_static=True) |
3408 | 64 |
## udp-echo-client.h: ns3::UdpEchoClient::UdpEchoClient() [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
|
65 |
cls.add_constructor([]) |
3408 | 66 |
## udp-echo-client.h: void ns3::UdpEchoClient::SetRemote(ns3::Ipv4Address ip, uint16_t port) [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
|
67 |
cls.add_method('SetRemote', |
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
|
68 |
'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
|
69 |
[param('ns3::Ipv4Address', 'ip'), param('uint16_t', 'port')]) |
3408 | 70 |
## udp-echo-client.h: void ns3::UdpEchoClient::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
|
71 |
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
|
72 |
'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
|
73 |
[], |
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 |
visibility='protected', is_virtual=True) |
3408 | 75 |
## udp-echo-client.h: void ns3::UdpEchoClient::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
|
76 |
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
|
77 |
'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
|
78 |
[], |
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
|
79 |
visibility='private', is_virtual=True) |
3408 | 80 |
## udp-echo-client.h: void ns3::UdpEchoClient::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
|
81 |
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
|
82 |
'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
|
83 |
[], |
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
|
84 |
visibility='private', is_virtual=True) |
3408 | 85 |
return |
86 |
||
87 |
def register_Ns3UdpEchoServer_methods(root_module, cls): |
|
4241
c35796bc0b4b
rescan python
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4218
diff
changeset
|
88 |
## udp-echo-server.h: ns3::UdpEchoServer::UdpEchoServer(ns3::UdpEchoServer const & arg0) [copy constructor] |
c35796bc0b4b
rescan python
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4218
diff
changeset
|
89 |
cls.add_constructor([param('ns3::UdpEchoServer const &', 'arg0')]) |
3408 | 90 |
## udp-echo-server.h: static ns3::TypeId ns3::UdpEchoServer::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
|
91 |
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
|
92 |
'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
|
93 |
[], |
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
|
94 |
is_static=True) |
3408 | 95 |
## udp-echo-server.h: ns3::UdpEchoServer::UdpEchoServer() [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
|
96 |
cls.add_constructor([]) |
3408 | 97 |
## udp-echo-server.h: void ns3::UdpEchoServer::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
|
98 |
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
|
99 |
'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
|
100 |
[], |
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
|
101 |
visibility='protected', is_virtual=True) |
3408 | 102 |
## udp-echo-server.h: void ns3::UdpEchoServer::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
|
103 |
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
|
104 |
'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
|
105 |
[], |
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
|
106 |
visibility='private', is_virtual=True) |
3408 | 107 |
## udp-echo-server.h: void ns3::UdpEchoServer::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
|
108 |
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
|
109 |
'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
|
110 |
[], |
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
|
111 |
visibility='private', is_virtual=True) |
3408 | 112 |
return |
113 |
||
114 |
def register_functions(root_module): |
|
115 |
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
|
116 |
register_functions_ns3_Config(module.get_submodule('Config'), root_module) |
3408 | 117 |
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
|
118 |
register_functions_ns3_internal(module.get_submodule('internal'), root_module) |
3408 | 119 |
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) |
120 |
return |
|
121 |
||
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
|
122 |
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
|
123 |
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
|
124 |
|
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
|
125 |
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
|
126 |
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
|
127 |
|
3408 | 128 |
def register_functions_ns3_internal(module, root_module): |
129 |
return |
|
130 |
||
131 |
def register_functions_ns3_olsr(module, root_module): |
|
132 |
return |
|
133 |