author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Wed, 16 Jul 2008 16:06:50 +0100 | |
changeset 3460 | 99698bc858e8 |
parent 3457 | 2ff6f05b9467 |
child 3468 | 0bb5275704fc |
permissions | -rw-r--r-- |
3408 | 1 |
from pybindgen import Module, FileCodeSink, write_preamble, param, retval |
2 |
||
3 |
def register_types(module): |
|
4 |
root_module = module.get_root() |
|
5 |
||
6 |
## point-to-point-channel.h: ns3::PointToPointChannel [class] |
|
3457 | 7 |
module.add_class('PointToPointChannel', parent=root_module['ns3::Channel']) |
3408 | 8 |
## point-to-point-net-device.h: ns3::PointToPointNetDevice [class] |
3457 | 9 |
module.add_class('PointToPointNetDevice', parent=root_module['ns3::NetDevice']) |
3408 | 10 |
|
11 |
## Register a nested module for the namespace internal |
|
12 |
||
13 |
nested_module = module.add_cpp_namespace('internal') |
|
14 |
register_types_ns3_internal(nested_module) |
|
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 |
||
23 |
## Register a nested module for the namespace Config |
|
24 |
||
25 |
nested_module = module.add_cpp_namespace('Config') |
|
26 |
register_types_ns3_Config(nested_module) |
|
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 |
||
35 |
def register_types_ns3_internal(module): |
|
36 |
root_module = module.get_root() |
|
37 |
||
38 |
||
39 |
def register_types_ns3_TimeStepPrecision(module): |
|
40 |
root_module = module.get_root() |
|
41 |
||
42 |
||
43 |
def register_types_ns3_Config(module): |
|
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_Ns3PointToPointChannel_methods(root_module, root_module['ns3::PointToPointChannel']) |
|
53 |
register_Ns3PointToPointNetDevice_methods(root_module, root_module['ns3::PointToPointNetDevice']) |
|
54 |
return |
|
55 |
||
56 |
def register_Ns3PointToPointChannel_methods(root_module, cls): |
|
57 |
## point-to-point-channel.h: static ns3::TypeId ns3::PointToPointChannel::GetTypeId() [member function] |
|
58 |
cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) |
|
59 |
## point-to-point-channel.h: ns3::PointToPointChannel::PointToPointChannel() [constructor] |
|
60 |
cls.add_constructor([], visibility='public') |
|
61 |
## point-to-point-channel.h: void ns3::PointToPointChannel::Attach(ns3::Ptr<ns3::PointToPointNetDevice> device) [member function] |
|
62 |
cls.add_method('Attach', 'void', [param('ns3::Ptr< ns3::PointToPointNetDevice >', 'device')]) |
|
63 |
## point-to-point-channel.h: bool ns3::PointToPointChannel::TransmitStart(ns3::Ptr<ns3::Packet> p, ns3::Ptr<ns3::PointToPointNetDevice> src, ns3::Time txTime) [member function] |
|
64 |
cls.add_method('TransmitStart', 'bool', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ptr< ns3::PointToPointNetDevice >', 'src'), param('ns3::Time', 'txTime')]) |
|
65 |
## point-to-point-channel.h: uint32_t ns3::PointToPointChannel::GetNDevices() const [member function] |
|
66 |
cls.add_method('GetNDevices', 'uint32_t', [], is_const=True, is_virtual=True) |
|
67 |
## point-to-point-channel.h: ns3::Ptr<ns3::PointToPointNetDevice> ns3::PointToPointChannel::GetPointToPointDevice(uint32_t i) const [member function] |
|
68 |
cls.add_method('GetPointToPointDevice', 'ns3::Ptr< ns3::PointToPointNetDevice >', [param('uint32_t', 'i')], is_const=True) |
|
69 |
## point-to-point-channel.h: ns3::Ptr<ns3::NetDevice> ns3::PointToPointChannel::GetDevice(uint32_t i) const [member function] |
|
70 |
cls.add_method('GetDevice', 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True) |
|
71 |
return |
|
72 |
||
73 |
def register_Ns3PointToPointNetDevice_methods(root_module, cls): |
|
74 |
## point-to-point-net-device.h: static ns3::TypeId ns3::PointToPointNetDevice::GetTypeId() [member function] |
|
75 |
cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) |
|
76 |
## point-to-point-net-device.h: ns3::PointToPointNetDevice::PointToPointNetDevice() [constructor] |
|
77 |
cls.add_constructor([], visibility='public') |
|
78 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetDataRate(ns3::DataRate bps) [member function] |
|
79 |
cls.add_method('SetDataRate', 'void', [param('ns3::DataRate', 'bps')]) |
|
80 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetInterframeGap(ns3::Time t) [member function] |
|
81 |
cls.add_method('SetInterframeGap', 'void', [param('ns3::Time', 't')]) |
|
82 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::Attach(ns3::Ptr<ns3::PointToPointChannel> ch) [member function] |
|
83 |
cls.add_method('Attach', 'bool', [param('ns3::Ptr< ns3::PointToPointChannel >', 'ch')]) |
|
84 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetQueue(ns3::Ptr<ns3::Queue> queue) [member function] |
|
85 |
cls.add_method('SetQueue', 'void', [param('ns3::Ptr< ns3::Queue >', 'queue')]) |
|
86 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveErrorModel(ns3::Ptr<ns3::ErrorModel> em) [member function] |
|
87 |
cls.add_method('SetReceiveErrorModel', 'void', [param('ns3::Ptr< ns3::ErrorModel >', 'em')]) |
|
88 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::Receive(ns3::Ptr<ns3::Packet> p) [member function] |
|
89 |
cls.add_method('Receive', 'void', [param('ns3::Ptr< ns3::Packet >', 'p')]) |
|
90 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetAddress(ns3::Mac48Address addr) [member function] |
|
91 |
cls.add_method('SetAddress', 'void', [param('ns3::Mac48Address', 'addr')]) |
|
92 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetName(std::string const name) [member function] |
|
93 |
cls.add_method('SetName', 'void', [param('std::string', 'name', is_const=True)], is_virtual=True) |
|
94 |
## point-to-point-net-device.h: std::string ns3::PointToPointNetDevice::GetName() const [member function] |
|
95 |
cls.add_method('GetName', 'std::string', [], is_const=True, is_virtual=True) |
|
96 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetIfIndex(uint32_t const index) [member function] |
|
97 |
cls.add_method('SetIfIndex', 'void', [param('uint32_t', 'index', is_const=True)], is_virtual=True) |
|
98 |
## point-to-point-net-device.h: uint32_t ns3::PointToPointNetDevice::GetIfIndex() const [member function] |
|
99 |
cls.add_method('GetIfIndex', 'uint32_t', [], is_const=True, is_virtual=True) |
|
100 |
## point-to-point-net-device.h: ns3::Ptr<ns3::Channel> ns3::PointToPointNetDevice::GetChannel() const [member function] |
|
101 |
cls.add_method('GetChannel', 'ns3::Ptr< ns3::Channel >', [], is_const=True, is_virtual=True) |
|
102 |
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetAddress() const [member function] |
|
103 |
cls.add_method('GetAddress', 'ns3::Address', [], is_const=True, is_virtual=True) |
|
104 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SetMtu(uint16_t const mtu) [member function] |
|
105 |
cls.add_method('SetMtu', 'bool', [param('uint16_t', 'mtu', is_const=True)], is_virtual=True) |
|
106 |
## point-to-point-net-device.h: uint16_t ns3::PointToPointNetDevice::GetMtu() const [member function] |
|
107 |
cls.add_method('GetMtu', 'uint16_t', [], is_const=True, is_virtual=True) |
|
108 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsLinkUp() const [member function] |
|
109 |
cls.add_method('IsLinkUp', 'bool', [], is_const=True, is_virtual=True) |
|
110 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function] |
|
111 |
cls.add_method('SetLinkChangeCallback', 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')], is_virtual=True) |
|
112 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsBroadcast() const [member function] |
|
113 |
cls.add_method('IsBroadcast', 'bool', [], is_const=True, is_virtual=True) |
|
114 |
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetBroadcast() const [member function] |
|
115 |
cls.add_method('GetBroadcast', 'ns3::Address', [], is_const=True, is_virtual=True) |
|
116 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsMulticast() const [member function] |
|
117 |
cls.add_method('IsMulticast', 'bool', [], is_const=True, is_virtual=True) |
|
118 |
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::GetMulticast() const [member function] |
|
119 |
cls.add_method('GetMulticast', 'ns3::Address', [], is_const=True, is_virtual=True) |
|
120 |
## point-to-point-net-device.h: ns3::Address ns3::PointToPointNetDevice::MakeMulticastAddress(ns3::Ipv4Address multicastGroup) const [member function] |
|
121 |
cls.add_method('MakeMulticastAddress', 'ns3::Address', [param('ns3::Ipv4Address', 'multicastGroup')], is_const=True, is_virtual=True) |
|
122 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::IsPointToPoint() const [member function] |
|
123 |
cls.add_method('IsPointToPoint', 'bool', [], is_const=True, is_virtual=True) |
|
124 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function] |
|
125 |
cls.add_method('Send', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True) |
|
3457 | 126 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function] |
127 |
cls.add_method('SendFrom', 'bool', [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address&', 'source', is_const=True), param('ns3::Address&', 'dest', is_const=True), param('uint16_t', 'protocolNumber')], is_virtual=True) |
|
3408 | 128 |
## point-to-point-net-device.h: ns3::Ptr<ns3::Node> ns3::PointToPointNetDevice::GetNode() const [member function] |
129 |
cls.add_method('GetNode', 'ns3::Ptr< ns3::Node >', [], is_const=True, is_virtual=True) |
|
130 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function] |
|
131 |
cls.add_method('SetNode', 'void', [param('ns3::Ptr< ns3::Node >', 'node')], is_virtual=True) |
|
132 |
## point-to-point-net-device.h: bool ns3::PointToPointNetDevice::NeedsArp() const [member function] |
|
133 |
cls.add_method('NeedsArp', 'bool', [], is_const=True, is_virtual=True) |
|
3460
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
134 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::SetReceiveCallback(ns3::Callback<bool, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<ns3::Packet>, unsigned short, ns3::Address const&, ns3::empty, ns3::empty> cb) [member function] |
99698bc858e8
New API considering comments from Craig: NetDevice->Node uses two callbacks; Node->ProtocolHandlers uses a single API with a promiscuous flag.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3457
diff
changeset
|
135 |
cls.add_method('SetReceiveCallback', 'void', [param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet >, unsigned short, ns3::Address const&, ns3::empty, ns3::empty >', 'cb')], is_virtual=True) |
3408 | 136 |
## point-to-point-net-device.h: void ns3::PointToPointNetDevice::DoDispose() [member function] |
137 |
cls.add_method('DoDispose', 'void', [], visibility='private', is_virtual=True) |
|
138 |
return |
|
139 |
||
140 |
def register_functions(root_module): |
|
141 |
module = root_module |
|
142 |
register_functions_ns3_internal(module.get_submodule('internal'), root_module) |
|
143 |
register_functions_ns3_TimeStepPrecision(module.get_submodule('TimeStepPrecision'), root_module) |
|
144 |
register_functions_ns3_Config(module.get_submodule('Config'), root_module) |
|
145 |
register_functions_ns3_olsr(module.get_submodule('olsr'), root_module) |
|
146 |
return |
|
147 |
||
148 |
def register_functions_ns3_internal(module, root_module): |
|
149 |
return |
|
150 |
||
151 |
def register_functions_ns3_TimeStepPrecision(module, root_module): |
|
152 |
return |
|
153 |
||
154 |
def register_functions_ns3_Config(module, root_module): |
|
155 |
return |
|
156 |
||
157 |
def register_functions_ns3_olsr(module, root_module): |
|
158 |
return |
|
159 |