author | Raj Bhattacharjea <raj.b@gatech.edu> |
Thu, 22 Jan 2009 15:13:47 -0500 | |
changeset 4228 | b9158015b8aa |
parent 4218 | debf1a8a96d3 |
child 4241 | c35796bc0b4b |
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 |
## 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): |
|
57 |
## 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
|
58 |
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
|
59 |
'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
|
60 |
[], |
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 |
is_static=True) |
3408 | 62 |
## 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
|
63 |
cls.add_constructor([]) |
3408 | 64 |
## 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
|
65 |
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
|
66 |
'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
|
67 |
[param('ns3::Ipv4Address', 'ip'), param('uint16_t', 'port')]) |
3408 | 68 |
## 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
|
69 |
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
|
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='protected', is_virtual=True) |
3408 | 73 |
## 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
|
74 |
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
|
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 |
## 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
|
79 |
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
|
80 |
'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
|
81 |
[], |
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 |
visibility='private', is_virtual=True) |
4218
debf1a8a96d3
Proposed RNG API changes
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
3972
diff
changeset
|
83 |
cls.add_copy_constructor() |
3408 | 84 |
return |
85 |
||
86 |
def register_Ns3UdpEchoServer_methods(root_module, cls): |
|
87 |
## 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
|
88 |
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
|
89 |
'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
|
90 |
[], |
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 |
is_static=True) |
3408 | 92 |
## 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
|
93 |
cls.add_constructor([]) |
3408 | 94 |
## 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
|
95 |
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
|
96 |
'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
|
97 |
[], |
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 |
visibility='protected', is_virtual=True) |
3408 | 99 |
## 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
|
100 |
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
|
101 |
'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
|
102 |
[], |
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 |
visibility='private', is_virtual=True) |
3408 | 104 |
## 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
|
105 |
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
|
106 |
'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
|
107 |
[], |
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 |
visibility='private', is_virtual=True) |
4218
debf1a8a96d3
Proposed RNG API changes
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
3972
diff
changeset
|
109 |
cls.add_copy_constructor() |
3408 | 110 |
return |
111 |
||
112 |
def register_functions(root_module): |
|
113 |
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
|
114 |
register_functions_ns3_Config(module.get_submodule('Config'), root_module) |
3408 | 115 |
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
|
116 |
register_functions_ns3_internal(module.get_submodule('internal'), root_module) |
3408 | 117 |
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) |
118 |
return |
|
119 |
||
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
|
120 |
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
|
121 |
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
|
122 |
|
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 |
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
|
124 |
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
|
125 |
|
3408 | 126 |
def register_functions_ns3_internal(module, root_module): |
127 |
return |
|
128 |
||
129 |
def register_functions_ns3_olsr(module, root_module): |
|
130 |
return |
|
131 |