Compare commits

...

31 Commits

Author SHA1 Message Date
Alexander Afanasyev fc42a8acb9 core: Add compiler flag checking 2015-01-08 21:59:17 -08:00
Alexander Afanasyev 70cc04fda4 core: Extend utils/print-introspected-doxygen to print available LogComponents 2015-01-08 14:34:34 -08:00
Alexander Afanasyev 32bfe45c23 core: Give ability to generate subset of documentation by utils/print-introspected-doxygen 2015-01-07 16:40:50 -08:00
Alexander Afanasyev 1ee20a8161 bindings: Version update and ndnSIM-related updates
- Now requiring a customized version of pybindgen (necessary for ndnSIM
  bindings)
- Fixed ndnSIM FIB/CS/PIT visualizer plugins to work with ndnSIM-v2 codebase
2015-01-03 20:53:58 -08:00
Alexander Afanasyev 8da46fa3b6 build: Avoid deprecated method in src/wscript 2015-01-03 20:53:58 -08:00
Spyridon Mastorakis dcd06923bd build: Force to compile using C++11
Starting this commit, NS-3/ndnSIM requires gcc >= 4.7 or clang >= 3.5
2015-01-03 20:52:55 -08:00
Spyridon Mastorakis 861e001084 python: Fix bug with version detection 2014-09-30 18:01:25 -07:00
Alexander Afanasyev bda0c62de5 bindings: Fixes 2014-09-30 17:39:08 -07:00
Alexander Afanasyev 620e5dcc62 topology-read: Making default constructor for TopologyReader::Link public.
This is necessary for some STL containers operations.
2014-09-30 17:39:07 -07:00
Alexander Afanasyev f438ab14e1 topology-read: TopologyReader and derivatives are no longer Objects
To allow smart pointers, TopologyReader is just inherited from
SimpleRefCount<TopologyReader> class
2014-09-30 17:39:07 -07:00
Alexander Afanasyev bf89dfdff3 topology-read: Several extensions of TopologyReader 2014-09-30 17:39:07 -07:00
Alexander Afanasyev 965856da98 build: Disable -Werror flags 2014-09-30 17:39:07 -07:00
Alexander Afanasyev dba04b9297 build: Update to waf with an upgraded version of python tool
See https://code.google.com/p/waf/issues/detail?id=1346

Also, updating help for boost module: separating boost-related
command-line options into an option group and reformatting help
messages.
2014-09-30 17:39:06 -07:00
Alexander Afanasyev 6995e94674 build: no longer require fake `ns3' directory in NS-3's root folder 2014-09-30 17:39:06 -07:00
Alexander Afanasyev a45b54ba70 bindings+network: Packet API extension, allowing creating of packet from string (for python bindings) 2014-09-30 17:39:06 -07:00
Alexander Afanasyev 6deb56527a bindings+network: Adding STL-like iterator wrappers (begin(), end(), size()) for NodeContainer class 2014-09-30 17:39:06 -07:00
Alexander Afanasyev 8e065000f9 visualizer: Modifying the way visualizer is installed
Using ant_glob instead of explicitly listing the installed files
2014-09-30 17:39:06 -07:00
Alexander Afanasyev e50a026e02 visualizer+ndnSIM: Adding ability to visualize items of the content store in real time 2014-09-30 17:39:06 -07:00
Alexander Afanasyev 5c755206fd visualizer: Adding ability to assign position to mobility model is env{NS_VIS_ASSIGN} is set to any value 2014-09-30 17:39:05 -07:00
Alexander Afanasyev 24cb6b5b6a visualizer: output node ID 2014-09-30 17:39:05 -07:00
Alexander Afanasyev 92c9ec38ca visualizer: Update visualizer plugins to reflect refactored ndnSIM code 2014-09-30 17:39:05 -07:00
Alexander Afanasyev 75df5e125a visualizer+ndnSIM: Adding plugin to display ndnSIM PIT status 2014-09-30 17:39:05 -07:00
Alexander Afanasyev ddde1f034e visualizer: Making a periodic topology rescan 2014-09-30 17:39:04 -07:00
Alexander Afanasyev 18aba9a465 visualizer+ndnSIM: Adding plugin to display a ndnSIM FIB state 2014-09-30 17:39:04 -07:00
Alexander Afanasyev 77adeafeed visualizer+mobility: A specialized version of GetObject (GetMobilityModel) is now implemented in MobilityModel class. This method is now used by the visualizer to obtain mobility interface.
This trick is necessary in order to use in python mobility models that
are not explicitly exported (or impossible to export) to python bindings
generation.
2014-09-30 17:39:04 -07:00
Alexander Afanasyev c958f20411 fd-net-device: Add missing include for strerror 2014-09-30 17:39:04 -07:00
Alexander Afanasyev 244f624a59 point-to-point: Extending helper interface to support setting individual queue parameters 2014-09-30 17:39:04 -07:00
Alexander Afanasyev 2dc940f876 point-to-point-layout: Respect absolute values of specified boundaries
Before the change, the values specified in SetBoundaryBox were used only
to calculate relative positions of grid nodes.
2014-09-30 17:39:04 -07:00
Alexander Afanasyev eb7dde0924 point-to-point, netanim: Adding ChannelID to PointToPointChannel trace 2014-09-30 17:38:39 -07:00
Ilya Moiseenko 653802993c point-to-point: Add support of NDN protocol
- Add support of PPP->Ethernet and Ethernet->PPP frame type conversion
  for NDN protocol
- Adding support for NDN payload in PppHeader::Print method
2014-09-30 16:27:31 -07:00
Alexander Afanasyev baa8ccf153 Adding .gitignore and disclaimer note in README 2014-09-30 16:27:31 -07:00
50 changed files with 1302 additions and 604 deletions
+52
View File
@@ -0,0 +1,52 @@
*.pyc
.waf*
src/NDNabstraction
build/
doc/html/
doc/latex/
\.rej$
\.orig$
\.o$
~$
^build-dir
^build
^testpy-output
^doc/html
^doc/latex
.lock-wscript
doc/ns3-object.txt
doc/introspected-doxygen.h
.lock-waf_darwin_build
.lock-waf_linux2_build
.lock-waf_cygwin_build
.lock-waf_freebsd7_build
.lock-waf_freebsd8_build
.lock-waf_freebsd9_build
.waf
^doc/introspected-doxygen\.h$
.*\.py[co]$
\.pcap$
\.mob$
\.routes$
^doc/manual/build
^doc/tutorial/build
^doc/testing/build
^doc/models/build
^doc/models/source-temp
^doc/manual/figures/.*eps
^doc/manual/figures/.*pdf
^doc/manual/figures/.*png
^bindings/python/pybindgen/
ms_print.*
massif.*
\.patch$
\.diff$
\.tr$
\#[^\#/]+\#$
.lock-wscript
.lock-wafbuild
src/ndnSIM
configure
toggle
.ns3rc
+6
View File
@@ -1,3 +1,9 @@
Note:
This is a custom and unsupported fork of NS-3 simulator (http://www.nsnam.org/).
**The code in this repository is frequently rebased on top of the latest ns-3-dev branch**
The Network Simulator, Version 3
--------------------------------
+5 -4
View File
@@ -13,7 +13,7 @@ from waflib.Errors import WafError
# after = TaskGen.after
## https://launchpad.net/pybindgen/
REQUIRED_PYBINDGEN_VERSION = (0, 17, 0, 876)
REQUIRED_PYBINDGEN_VERSION = (0, 17, 0, 887)
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
RUN_ME=-3
@@ -255,6 +255,8 @@ int main ()
"import pygccxml; print pygccxml.__version__"],
stdout=subprocess.PIPE).communicate()[0]
pygccxml_version_str = out.strip()
if pygccxml_version_str[0] == 'v':
pygccxml_version_str = pygccxml_version_str[1:]
pygccxml_version = tuple([int(x) for x in pygccxml_version_str.split('.')])
conf.msg('Checking for pygccxml version', pygccxml_version_str)
if not (pygccxml_version >= REQUIRED_PYGCCXML_VERSION):
@@ -265,7 +267,7 @@ int main ()
conf.report_optional_feature("pygccxml", "Python API Scanning Support", False,
"pygccxml too old")
return
## Check gccxml version
try:
@@ -409,7 +411,7 @@ class gen_ns3_compat_pymod_task(Task.Task):
"""Generates a 'ns3.py' compatibility module."""
before = 'cxx'
color = 'BLUE'
def run(self):
assert len(self.outputs) == 1
outfile = file(self.outputs[0].abspath(), "w")
@@ -486,4 +488,3 @@ def build(bld):
# note: the actual build commands for the python bindings are in
# src/wscript, not here.
-1
View File
@@ -1 +0,0 @@
This is a placeholder file used only to keep the ns3 directory present (needed for the WAF build system).
+3 -4
View File
@@ -16,15 +16,14 @@
#include "ns3/core-module.h"
NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
// NS_LOG_COMPONENT_DEFINE ("ScratchSimulator");
using namespace ns3;
int
main (int argc, char *argv[])
{
NS_LOG_UNCOND ("Scratch Simulator");
// NS_LOG_UNCOND ("Scratch Simulator");
Simulator::Run ();
Simulator::Destroy ();
LogComponentPrintList();
}
+10 -10
View File
@@ -2489,10 +2489,10 @@ def register_Ns3SystemThread_methods(root_module, cls):
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t', u'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
@@ -3753,8 +3753,8 @@ def register_Ns3IntegerValue_methods(root_module, cls):
cls.add_constructor([])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(ns3::IntegerValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::IntegerValue const &', 'arg0')])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(int64_t const & value) [constructor]
cls.add_constructor([param('int64_t const &', 'value')])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(int64_t value) [constructor]
cls.add_constructor([param('int64_t', 'value')])
## integer.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::IntegerValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
@@ -3775,10 +3775,10 @@ def register_Ns3IntegerValue_methods(root_module, cls):
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## integer.h (module 'core'): void ns3::IntegerValue::Set(int64_t const & value) [member function]
## integer.h (module 'core'): void ns3::IntegerValue::Set(int64_t value) [member function]
cls.add_method('Set',
'void',
[param('int64_t const &', 'value')])
[param('int64_t', 'value')])
return
def register_Ns3ListScheduler_methods(root_module, cls):
@@ -4468,8 +4468,8 @@ def register_Ns3UintegerValue_methods(root_module, cls):
cls.add_constructor([])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(ns3::UintegerValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::UintegerValue const &', 'arg0')])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(uint64_t const & value) [constructor]
cls.add_constructor([param('uint64_t const &', 'value')])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(uint64_t value) [constructor]
cls.add_constructor([param('uint64_t', 'value')])
## uinteger.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::UintegerValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
@@ -4490,10 +4490,10 @@ def register_Ns3UintegerValue_methods(root_module, cls):
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## uinteger.h (module 'core'): void ns3::UintegerValue::Set(uint64_t const & value) [member function]
## uinteger.h (module 'core'): void ns3::UintegerValue::Set(uint64_t value) [member function]
cls.add_method('Set',
'void',
[param('uint64_t const &', 'value')])
[param('uint64_t', 'value')])
return
def register_Ns3Vector2DChecker_methods(root_module, cls):
+10 -10
View File
@@ -2489,10 +2489,10 @@ def register_Ns3SystemThread_methods(root_module, cls):
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t', u'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
@@ -3753,8 +3753,8 @@ def register_Ns3IntegerValue_methods(root_module, cls):
cls.add_constructor([])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(ns3::IntegerValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::IntegerValue const &', 'arg0')])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(int64_t const & value) [constructor]
cls.add_constructor([param('int64_t const &', 'value')])
## integer.h (module 'core'): ns3::IntegerValue::IntegerValue(int64_t value) [constructor]
cls.add_constructor([param('int64_t', 'value')])
## integer.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::IntegerValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
@@ -3775,10 +3775,10 @@ def register_Ns3IntegerValue_methods(root_module, cls):
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## integer.h (module 'core'): void ns3::IntegerValue::Set(int64_t const & value) [member function]
## integer.h (module 'core'): void ns3::IntegerValue::Set(int64_t value) [member function]
cls.add_method('Set',
'void',
[param('int64_t const &', 'value')])
[param('int64_t', 'value')])
return
def register_Ns3ListScheduler_methods(root_module, cls):
@@ -4468,8 +4468,8 @@ def register_Ns3UintegerValue_methods(root_module, cls):
cls.add_constructor([])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(ns3::UintegerValue const & arg0) [copy constructor]
cls.add_constructor([param('ns3::UintegerValue const &', 'arg0')])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(uint64_t const & value) [constructor]
cls.add_constructor([param('uint64_t const &', 'value')])
## uinteger.h (module 'core'): ns3::UintegerValue::UintegerValue(uint64_t value) [constructor]
cls.add_constructor([param('uint64_t', 'value')])
## uinteger.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::UintegerValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
@@ -4490,10 +4490,10 @@ def register_Ns3UintegerValue_methods(root_module, cls):
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## uinteger.h (module 'core'): void ns3::UintegerValue::Set(uint64_t const & value) [member function]
## uinteger.h (module 'core'): void ns3::UintegerValue::Set(uint64_t value) [member function]
cls.add_method('Set',
'void',
[param('uint64_t const &', 'value')])
[param('uint64_t', 'value')])
return
def register_Ns3Vector2DChecker_methods(root_module, cls):
+9 -1
View File
@@ -55,7 +55,15 @@ ComponentList *GetComponentList (void)
return &components;
}
std::vector<std::string>
GetLogComponents()
{
std::vector<std::string> retval;
for (const auto& i : *GetComponentList()) {
retval.push_back(i.first);
}
return retval;
}
PrintList::PrintList ()
{
+10
View File
@@ -25,6 +25,7 @@
#include <iostream>
#include <stdint.h>
#include <map>
#include <vector>
#include "log-macros-enabled.h"
#include "log-macros-disabled.h"
@@ -245,6 +246,15 @@ namespace ns3 {
*/
void LogComponentPrintList (void);
/**
* \ingroup logging
*
* Get the list of available logging components that can be used with
* the NS_LOG environment variable
*/
std::vector<std::string>
GetLogComponents();
typedef void (*LogTimePrinter)(std::ostream &os);
typedef void (*LogNodePrinter)(std::ostream &os);
+6
View File
@@ -27,6 +27,12 @@
#include <stdlib.h>
#include <errno.h>
// linux man page specifies <string.h> for strerror
#include <string.h>
// OSX man page asks for <stdio.h> for strerror
#include <stdio.h>
#include <sys/socket.h>
namespace ns3 {
+62 -29
View File
@@ -268,17 +268,17 @@ def register_types(module):
module.add_class('GaussMarkovMobilityModel', parent=root_module['ns3::MobilityModel'])
## hierarchical-mobility-model.h (module 'mobility'): ns3::HierarchicalMobilityModel [class]
module.add_class('HierarchicalMobilityModel', parent=root_module['ns3::MobilityModel'])
typehandlers.add_type_alias(u'ns3::Vector3D', u'ns3::Vector')
typehandlers.add_type_alias(u'ns3::Vector3D*', u'ns3::Vector*')
typehandlers.add_type_alias(u'ns3::Vector3D&', u'ns3::Vector&')
typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector')
typehandlers.add_type_alias('ns3::Vector3D*', 'ns3::Vector*')
typehandlers.add_type_alias('ns3::Vector3D&', 'ns3::Vector&')
module.add_typedef(root_module['ns3::Vector3D'], 'Vector')
typehandlers.add_type_alias(u'ns3::Vector3DValue', u'ns3::VectorValue')
typehandlers.add_type_alias(u'ns3::Vector3DValue*', u'ns3::VectorValue*')
typehandlers.add_type_alias(u'ns3::Vector3DValue&', u'ns3::VectorValue&')
typehandlers.add_type_alias('ns3::Vector3DValue', 'ns3::VectorValue')
typehandlers.add_type_alias('ns3::Vector3DValue*', 'ns3::VectorValue*')
typehandlers.add_type_alias('ns3::Vector3DValue&', 'ns3::VectorValue&')
module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue')
typehandlers.add_type_alias(u'ns3::Vector3DChecker', u'ns3::VectorChecker')
typehandlers.add_type_alias(u'ns3::Vector3DChecker*', u'ns3::VectorChecker*')
typehandlers.add_type_alias(u'ns3::Vector3DChecker&', u'ns3::VectorChecker&')
typehandlers.add_type_alias('ns3::Vector3DChecker', 'ns3::VectorChecker')
typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*')
typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&')
module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker')
## Register a nested module for the namespace FatalImpl
@@ -302,12 +302,12 @@ def register_types_ns3_Hash(module):
## hash-function.h (module 'core'): ns3::Hash::Implementation [class]
module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash64Function_ptr&')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash64Function_ptr&')
## Register a nested module for the namespace Function
@@ -1303,6 +1303,29 @@ def register_Ns3NodeContainer_methods(root_module, cls):
'uint32_t',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() const [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() const [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): uint32_t ns3::NodeContainer::size() const [member function]
cls.add_method('size',
'uint32_t',
[],
is_const=True)
return
def register_Ns3Ns2MobilityHelper_methods(root_module, cls):
@@ -1783,18 +1806,18 @@ def register_Ns3Empty_methods(root_module, cls):
return
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_unary_numeric_operator('-')
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -1870,6 +1893,11 @@ def register_Ns3Object_methods(root_module, cls):
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## object.h (module 'core'): ns3::Ptr<ns3::MobilityModel> ns3::Object::GetObject() const [member function]
cls.add_method('GetObject',
'ns3::Ptr< ns3::MobilityModel >',
[],
is_const=True, template_parameters=['ns3::MobilityModel'])
## object.h (module 'core'): static ns3::TypeId ns3::Object::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
@@ -2219,15 +2247,15 @@ def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDelete
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -3415,6 +3443,11 @@ def register_Ns3MobilityModel_methods(root_module, cls):
'double',
[param('ns3::Ptr< ns3::MobilityModel const >', 'position')],
is_const=True)
## mobility-model.h (module 'mobility'): static ns3::Ptr<ns3::MobilityModel> ns3::MobilityModel::GetMobilityModel(ns3::Ptr<ns3::Object> node) [member function]
cls.add_method('GetMobilityModel',
'ns3::Ptr< ns3::MobilityModel >',
[param('ns3::Ptr< ns3::Object >', 'node')],
is_static=True)
## mobility-model.h (module 'mobility'): ns3::Vector ns3::MobilityModel::GetPosition() const [member function]
cls.add_method('GetPosition',
'ns3::Vector',
+62 -29
View File
@@ -268,17 +268,17 @@ def register_types(module):
module.add_class('GaussMarkovMobilityModel', parent=root_module['ns3::MobilityModel'])
## hierarchical-mobility-model.h (module 'mobility'): ns3::HierarchicalMobilityModel [class]
module.add_class('HierarchicalMobilityModel', parent=root_module['ns3::MobilityModel'])
typehandlers.add_type_alias(u'ns3::Vector3D', u'ns3::Vector')
typehandlers.add_type_alias(u'ns3::Vector3D*', u'ns3::Vector*')
typehandlers.add_type_alias(u'ns3::Vector3D&', u'ns3::Vector&')
typehandlers.add_type_alias('ns3::Vector3D', 'ns3::Vector')
typehandlers.add_type_alias('ns3::Vector3D*', 'ns3::Vector*')
typehandlers.add_type_alias('ns3::Vector3D&', 'ns3::Vector&')
module.add_typedef(root_module['ns3::Vector3D'], 'Vector')
typehandlers.add_type_alias(u'ns3::Vector3DValue', u'ns3::VectorValue')
typehandlers.add_type_alias(u'ns3::Vector3DValue*', u'ns3::VectorValue*')
typehandlers.add_type_alias(u'ns3::Vector3DValue&', u'ns3::VectorValue&')
typehandlers.add_type_alias('ns3::Vector3DValue', 'ns3::VectorValue')
typehandlers.add_type_alias('ns3::Vector3DValue*', 'ns3::VectorValue*')
typehandlers.add_type_alias('ns3::Vector3DValue&', 'ns3::VectorValue&')
module.add_typedef(root_module['ns3::Vector3DValue'], 'VectorValue')
typehandlers.add_type_alias(u'ns3::Vector3DChecker', u'ns3::VectorChecker')
typehandlers.add_type_alias(u'ns3::Vector3DChecker*', u'ns3::VectorChecker*')
typehandlers.add_type_alias(u'ns3::Vector3DChecker&', u'ns3::VectorChecker&')
typehandlers.add_type_alias('ns3::Vector3DChecker', 'ns3::VectorChecker')
typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*')
typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&')
module.add_typedef(root_module['ns3::Vector3DChecker'], 'VectorChecker')
## Register a nested module for the namespace FatalImpl
@@ -302,12 +302,12 @@ def register_types_ns3_Hash(module):
## hash-function.h (module 'core'): ns3::Hash::Implementation [class]
module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash64Function_ptr&')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash64Function_ptr&')
## Register a nested module for the namespace Function
@@ -1303,6 +1303,29 @@ def register_Ns3NodeContainer_methods(root_module, cls):
'uint32_t',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() const [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() const [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): uint32_t ns3::NodeContainer::size() const [member function]
cls.add_method('size',
'uint32_t',
[],
is_const=True)
return
def register_Ns3Ns2MobilityHelper_methods(root_module, cls):
@@ -1783,18 +1806,18 @@ def register_Ns3Empty_methods(root_module, cls):
return
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_unary_numeric_operator('-')
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -1870,6 +1893,11 @@ def register_Ns3Object_methods(root_module, cls):
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## object.h (module 'core'): ns3::Ptr<ns3::MobilityModel> ns3::Object::GetObject() const [member function]
cls.add_method('GetObject',
'ns3::Ptr< ns3::MobilityModel >',
[],
is_const=True, template_parameters=['ns3::MobilityModel'])
## object.h (module 'core'): static ns3::TypeId ns3::Object::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
@@ -2219,15 +2247,15 @@ def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDelete
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -3415,6 +3443,11 @@ def register_Ns3MobilityModel_methods(root_module, cls):
'double',
[param('ns3::Ptr< ns3::MobilityModel const >', 'position')],
is_const=True)
## mobility-model.h (module 'mobility'): static ns3::Ptr<ns3::MobilityModel> ns3::MobilityModel::GetMobilityModel(ns3::Ptr<ns3::Object> node) [member function]
cls.add_method('GetMobilityModel',
'ns3::Ptr< ns3::MobilityModel >',
[param('ns3::Ptr< ns3::Object >', 'node')],
is_static=True)
## mobility-model.h (module 'mobility'): ns3::Vector ns3::MobilityModel::GetPosition() const [member function]
cls.add_method('GetPosition',
'ns3::Vector',
+10
View File
@@ -75,6 +75,9 @@ public:
*/
int64_t AssignStreams (int64_t stream);
static inline Ptr<MobilityModel>
GetMobilityModel (Ptr<Object> node);
protected:
/**
* Must be invoked by subclasses when the course of the
@@ -118,6 +121,13 @@ private:
};
Ptr<MobilityModel>
MobilityModel::GetMobilityModel (Ptr<Object> node)
{
return node->GetObject<MobilityModel> ();
}
} // namespace ns3
#endif /* MOBILITY_MODEL_H */
File diff suppressed because it is too large Load Diff
+1
View File
@@ -704,6 +704,7 @@ private:
void WifiPhyRxDropTrace (std::string context,
Ptr<const Packet>);
void DevTxTrace (std::string context,
uint32_t,
Ptr<const Packet> p,
Ptr<NetDevice> tx,
Ptr<NetDevice> rx,
+53 -13
View File
@@ -41,14 +41,14 @@ NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b)
Add (a);
Add (b);
}
NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
const NodeContainer &c)
{
Add (a);
Add (b);
Add (c);
}
NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
const NodeContainer &c, const NodeContainer &d)
{
Add (a);
@@ -57,7 +57,7 @@ NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
Add (d);
}
NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
const NodeContainer &c, const NodeContainer &d,
const NodeContainer &e)
{
@@ -68,28 +68,68 @@ NodeContainer::NodeContainer (const NodeContainer &a, const NodeContainer &b,
Add (e);
}
NodeContainer::Iterator
NodeContainer::Iterator
NodeContainer::Begin (void) const
{
return m_nodes.begin ();
}
NodeContainer::Iterator
NodeContainer::const_iterator
NodeContainer::begin () const
{
return m_nodes.begin ();
}
NodeContainer::iterator
NodeContainer::begin ()
{
return m_nodes.begin ();
}
NodeContainer::Iterator
NodeContainer::End (void) const
{
return m_nodes.end ();
}
uint32_t
NodeContainer::const_iterator
NodeContainer::end () const
{
return m_nodes.end ();
}
NodeContainer::iterator
NodeContainer::end ()
{
return m_nodes.end ();
}
uint32_t
NodeContainer::GetN (void) const
{
return m_nodes.size ();
}
Ptr<Node>
uint32_t
NodeContainer::size () const
{
return m_nodes.size ();
}
Ptr<Node>
NodeContainer::Get (uint32_t i) const
{
return m_nodes[i];
}
void
Ptr<Node> &
NodeContainer::operator [] (uint32_t i)
{
return m_nodes [i];
}
void
NodeContainer::Create (uint32_t n)
{
for (uint32_t i = 0; i < n; i++)
@@ -97,7 +137,7 @@ NodeContainer::Create (uint32_t n)
m_nodes.push_back (CreateObject<Node> ());
}
}
void
void
NodeContainer::Create (uint32_t n, uint32_t systemId)
{
for (uint32_t i = 0; i < n; i++)
@@ -105,7 +145,7 @@ NodeContainer::Create (uint32_t n, uint32_t systemId)
m_nodes.push_back (CreateObject<Node> (systemId));
}
}
void
void
NodeContainer::Add (NodeContainer other)
{
for (Iterator i = other.Begin (); i != other.End (); i++)
@@ -113,19 +153,19 @@ NodeContainer::Add (NodeContainer other)
m_nodes.push_back (*i);
}
}
void
void
NodeContainer::Add (Ptr<Node> node)
{
m_nodes.push_back (node);
}
void
void
NodeContainer::Add (std::string nodeName)
{
Ptr<Node> node = Names::Find<Node> (nodeName);
m_nodes.push_back (node);
}
NodeContainer
NodeContainer
NodeContainer::GetGlobal (void)
{
NodeContainer c;
+39 -25
View File
@@ -40,6 +40,8 @@ class NodeContainer
public:
/// Node container iterator
typedef std::vector<Ptr<Node> >::const_iterator Iterator;
typedef std::vector<Ptr<Node> >::iterator iterator;
typedef std::vector<Ptr<Node> >::const_iterator const_iterator;
/**
* Create an empty NodeContainer.
@@ -55,9 +57,9 @@ public:
NodeContainer (Ptr<Node> node);
/**
* Create a NodeContainer with exactly one node which has been previously
* instantiated and assigned a name using the Object Name Service. This
* Node is then specified by its assigned name.
* Create a NodeContainer with exactly one node which has been previously
* instantiated and assigned a name using the Object Name Service. This
* Node is then specified by its assigned name.
*
* \param nodeName The name of the Node Object to add to the container.
*/
@@ -71,11 +73,11 @@ public:
* \param b The second NodeContainer
*
* \note A frequently seen idiom that uses these constructors involves the
* implicit conversion by constructor of Ptr<Node>. When used, two
* implicit conversion by constructor of Ptr<Node>. When used, two
* Ptr<Node> will be passed to this constructor instead of NodeContainer&.
* C++ will notice the implicit conversion path that goes through the
* C++ will notice the implicit conversion path that goes through the
* NodeContainer (Ptr<Node> node) constructor above. Using this conversion
* one may provide optionally provide arguments of Ptr<Node> to these
* one may provide optionally provide arguments of Ptr<Node> to these
* constructors.
*/
NodeContainer (const NodeContainer &a, const NodeContainer &b);
@@ -89,11 +91,11 @@ public:
* \param c The third NodeContainer
*
* \note A frequently seen idiom that uses these constructors involves the
* implicit conversion by constructor of Ptr<Node>. When used, two
* implicit conversion by constructor of Ptr<Node>. When used, two
* Ptr<Node> will be passed to this constructor instead of NodeContainer&.
* C++ will notice the implicit conversion path that goes through the
* C++ will notice the implicit conversion path that goes through the
* NodeContainer (Ptr<Node> node) constructor above. Using this conversion
* one may provide optionally provide arguments of Ptr<Node> to these
* one may provide optionally provide arguments of Ptr<Node> to these
* constructors.
*/
NodeContainer (const NodeContainer &a, const NodeContainer &b, const NodeContainer &c);
@@ -108,11 +110,11 @@ public:
* \param d The fourth NodeContainer
*
* \note A frequently seen idiom that uses these constructors involves the
* implicit conversion by constructor of Ptr<Node>. When used, two
* implicit conversion by constructor of Ptr<Node>. When used, two
* Ptr<Node> will be passed to this constructor instead of NodeContainer&.
* C++ will notice the implicit conversion path that goes through the
* C++ will notice the implicit conversion path that goes through the
* NodeContainer (Ptr<Node> node) constructor above. Using this conversion
* one may provide optionally provide arguments of Ptr<Node> to these
* one may provide optionally provide arguments of Ptr<Node> to these
* constructors.
*/
NodeContainer (const NodeContainer &a, const NodeContainer &b, const NodeContainer &c, const NodeContainer &d);
@@ -128,23 +130,23 @@ public:
* \param e The fifth NodeContainer
*
* \note A frequently seen idiom that uses these constructors involves the
* implicit conversion by constructor of Ptr<Node>. When used, two
* implicit conversion by constructor of Ptr<Node>. When used, two
* Ptr<Node> will be passed to this constructor instead of NodeContainer&.
* C++ will notice the implicit conversion path that goes through the
* C++ will notice the implicit conversion path that goes through the
* NodeContainer (Ptr<Node> node) constructor above. Using this conversion
* one may provide optionally provide arguments of Ptr<Node> to these
* one may provide optionally provide arguments of Ptr<Node> to these
* constructors.
*/
NodeContainer (const NodeContainer &a, const NodeContainer &b, const NodeContainer &c, const NodeContainer &d,
const NodeContainer &e);
/**
* \brief Get an iterator which refers to the first Node in the
* \brief Get an iterator which refers to the first Node in the
* container.
*
* Nodes can be retrieved from the container in two ways. First,
* directly by an index into the container, and second, using an iterator.
* This method is used in the iterator method and is typically used in a
* This method is used in the iterator method and is typically used in a
* for-loop to run through the Nodes
*
* \code
@@ -159,13 +161,16 @@ public:
*/
Iterator Begin (void) const;
const_iterator begin () const; /// @brief STL-like method, @see Begin
iterator begin (); /// @brief STL-like method, @see Begin
/**
* \brief Get an iterator which indicates past-the-last Node in the
* \brief Get an iterator which indicates past-the-last Node in the
* container.
*
* Nodes can be retrieved from the container in two ways. First,
* directly by an index into the container, and second, using an iterator.
* This method is used in the iterator method and is typically used in a
* This method is used in the iterator method and is typically used in a
* for-loop to run through the Nodes
*
* \code
@@ -180,6 +185,9 @@ public:
*/
Iterator End (void) const;
const_iterator end () const; /// @brief STL-like method, @see End
iterator end (); /// @brief STL-like method, @see End
/**
* \brief Get the number of Ptr<Node> stored in this container.
*
@@ -202,6 +210,8 @@ public:
*/
uint32_t GetN (void) const;
uint32_t size () const; /// @brief STL-like method, @see GetN
/**
* \brief Get the Ptr<Node> stored in this container at a given
* index.
@@ -223,10 +233,14 @@ public:
* \param i the index of the requested node pointer.
* \returns the requested node pointer.
*/
Ptr<Node> Get (uint32_t i) const;
Ptr<Node>
Get (uint32_t i) const;
Ptr<Node> &
operator [] (uint32_t i); /// @brief STL-like method, @see Get
/**
* \brief Create n nodes and append pointers to them to the end of this
* \brief Create n nodes and append pointers to them to the end of this
* NodeContainer.
*
* Nodes are at the heart of any ns-3 simulation. One of the first tasks that
@@ -238,12 +252,12 @@ public:
void Create (uint32_t n);
/**
* \brief Create n nodes with specified systemId for distributed simulations
* \brief Create n nodes with specified systemId for distributed simulations
* and append pointers to them to the end of this NodeContainer.
*
* Nodes are at the heart of any ns-3 simulation. One of the first tasks that
* any simulation needs to do is to create a number of nodes. This method
* automates that task, and adds the ability to specify systemId for
* automates that task, and adds the ability to specify systemId for
* distributed simulations.
*
* \param n The number of Nodes to create
@@ -276,12 +290,12 @@ public:
/**
* \brief Create a NodeContainer that contains a list of _all_ nodes
* created through NodeContainer::Create() and stored in the
* created through NodeContainer::Create() and stored in the
* ns3::NodeList.
*
* Whenever a Node is created, a Ptr<Node> is added to a global list of all
* nodes in the system. It is sometimes useful to be able to get to all
* nodes in one place. This method creates a NodeContainer that is
* nodes in one place. This method creates a NodeContainer that is
* initialized to contain all of the simulation nodes,
*
* \returns a NoceContainer which contains a list of all Nodes.
+20
View File
@@ -214,6 +214,26 @@ Packet::Packet (uint8_t const*buffer, uint32_t size)
i.Write (buffer, size);
}
Packet::Packet (const std::string &buffer)
: m_buffer (),
m_byteTagList (),
m_packetTagList (),
/* The upper 32 bits of the packet id in
* metadata is for the system id. For non-
* distributed simulations, this is simply
* zero. The lower 32 bits are for the
* global UID
*/
m_metadata (static_cast<uint64_t> (Simulator::GetSystemId ()) << 32 | m_globalUid, buffer.size ()),
m_nixVector (0)
{
NS_LOG_FUNCTION (this << &buffer);
m_globalUid++;
m_buffer.AddAtStart (buffer.size ());
Buffer::Iterator i = m_buffer.Begin ();
i.Write (reinterpret_cast<const uint8_t*> (&buffer[0]), buffer.size ());
}
Packet::Packet (const Buffer &buffer, const ByteTagList &byteTagList,
const PacketTagList &packetTagList, const PacketMetadata &metadata)
: m_buffer (buffer),
+13
View File
@@ -279,6 +279,19 @@ public:
/**
* \brief Create a new packet which contains a fragment of the original
* packet.
* Create a packet with payload filled with the content
* of this buffer. The input data is copied: the input
* buffer is untouched.
*
* \param buffer the data to store in the packet.
*
* This is an alternative method to construct packet from the real
* data, which is supported by python bindings
*/
Packet (const std::string &buffer);
/**
* Create a new packet which contains a fragment of the original
* packet. The returned packet shares the same uid as this packet.
*
* The returned packet shares the same uid as this packet.
*
@@ -217,7 +217,7 @@ PointToPointGridHelper::BoundingBox (double ulx, double uly,
loc = CreateObject<ConstantPositionMobilityModel> ();
node->AggregateObject (loc);
}
Vector locVec (xLoc, yLoc, 0);
Vector locVec (ulx + xLoc, uly + yLoc, 0);
loc->SetPosition (locVec);
xLoc += xAdder;
@@ -53,14 +53,20 @@ PointToPointHelper::SetQueue (std::string type,
std::string n3, const AttributeValue &v3,
std::string n4, const AttributeValue &v4)
{
m_queueFactory.SetTypeId (type);
m_queueFactory = ObjectFactory (type); // to reset any previously set attributes, if any
m_queueFactory.Set (n1, v1);
m_queueFactory.Set (n2, v2);
m_queueFactory.Set (n3, v3);
m_queueFactory.Set (n4, v4);
}
void
void
PointToPointHelper::SetQueueAttribute (std::string name, const AttributeValue &value)
{
m_queueFactory.Set (name, value);
}
void
PointToPointHelper::SetDeviceAttribute (std::string n1, const AttributeValue &v1)
{
m_deviceFactory.Set (n1, v1);
@@ -76,6 +76,18 @@ public:
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue ());
/**
* Set an attribute value to be propagated to each Queue created by the
* helper.
*
* \param name the name of the attribute to set
* \param value the value of the attribute to set
*
* Set these attributes on each ns3::Queue created by PointToPointHelper::Install
*/
void
SetQueueAttribute (std::string name, const AttributeValue &value);
/**
* Set an attribute value to be propagated to each NetDevice created by the
* helper.
@@ -98,7 +98,7 @@ PointToPointChannel::TransmitStart (
m_link[wire].m_dst, p);
// Call the tx anim callback on the net device
m_txrxPointToPoint (p, src, m_link[wire].m_dst, txTime, txTime + m_delay);
m_txrxPointToPoint (GetId (), p, src, m_link[wire].m_dst, txTime, txTime + m_delay);
return true;
}
@@ -137,7 +137,8 @@ private:
*
* @see class CallBackTraceSource
*/
TracedCallback<Ptr<const Packet>, // Packet being transmitted
TracedCallback<uint32_t, // channel ID
Ptr<const Packet>, // Packet being transmitted
Ptr<NetDevice>, // Transmitting NetDevice
Ptr<NetDevice>, // Receiving NetDevice
Time, // Amount of time to transmit the pkt
@@ -623,6 +623,7 @@ PointToPointNetDevice::PppToEther (uint16_t proto)
{
case 0x0021: return 0x0800; //IPv4
case 0x0057: return 0x86DD; //IPv6
case 0x0077: return 0x7777; //NDN
default: NS_ASSERT_MSG (false, "PPP Protocol number not defined!");
}
return 0;
@@ -636,6 +637,7 @@ PointToPointNetDevice::EtherToPpp (uint16_t proto)
{
case 0x0800: return 0x0021; //IPv4
case 0x86DD: return 0x0057; //IPv6
case 0x7777: return 0x0077; //NDN
default: NS_ASSERT_MSG (false, "PPP Protocol number not defined!");
}
return 0;
+3
View File
@@ -66,6 +66,9 @@ PppHeader::Print (std::ostream &os) const
case 0x0057: /* IPv6 */
proto = "IPv6 (0x0057)";
break;
case 0x0077: /* NDN */
proto = "NDN (0x0077)";
break;
default:
NS_ASSERT_MSG (false, "PPP Protocol number not defined!");
}
@@ -86,6 +86,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Hash::Implementation>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::TopologyReader', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TopologyReader>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## nstime.h (module 'core'): ns3::Time [class]
@@ -95,7 +97,7 @@ def register_types(module):
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader [class]
module.add_class('TopologyReader', parent=root_module['ns3::Object'])
module.add_class('TopologyReader', parent=root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link [class]
module.add_class('Link', outer_class=root_module['ns3::TopologyReader'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
@@ -152,7 +154,7 @@ def register_types(module):
module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## address.h (module 'network'): ns3::AddressValue [class]
module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
module.add_container('std::map< std::string, std::string >', ('std::string', 'std::string'), container_type=u'map')
module.add_container('std::map< std::string, std::string >', ('std::string', 'std::string'), container_type='map')
## Register a nested module for the namespace FatalImpl
@@ -175,12 +177,12 @@ def register_types_ns3_Hash(module):
## hash-function.h (module 'core'): ns3::Hash::Implementation [class]
module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash64Function_ptr&')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash64Function_ptr&')
## Register a nested module for the namespace Function
@@ -229,6 +231,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TopologyReader_methods(root_module, root_module['ns3::TopologyReader'])
@@ -914,6 +917,29 @@ def register_Ns3NodeContainer_methods(root_module, cls):
'uint32_t',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() const [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() const [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): uint32_t ns3::NodeContainer::size() const [member function]
cls.add_method('size',
'uint32_t',
[],
is_const=True)
return
def register_Ns3ObjectBase_methods(root_module, cls):
@@ -1288,18 +1314,18 @@ def register_Ns3Empty_methods(root_module, cls):
return
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_unary_numeric_operator('-')
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -1480,6 +1506,18 @@ def register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > const & o) [copy constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter< ns3::TopologyReader > > const &', 'o')])
## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::Cleanup() [member function]
cls.add_method('Cleanup',
'void',
[],
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1493,15 +1531,15 @@ def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDelete
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -1702,11 +1740,6 @@ def register_Ns3TopologyReader_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::TopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## topology-reader.h (module 'topology-read'): std::_List_const_iterator<ns3::TopologyReader::Link> ns3::TopologyReader::LinksBegin() const [member function]
cls.add_method('LinksBegin',
'std::_List_const_iterator< ns3::TopologyReader::Link >',
@@ -1741,6 +1774,8 @@ def register_Ns3TopologyReader_methods(root_module, cls):
def register_Ns3TopologyReaderLink_methods(root_module, cls):
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::TopologyReader::Link const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TopologyReader::Link const &', 'arg0')])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link() [constructor]
cls.add_constructor([])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::Ptr<ns3::Node> fromPtr, std::string const & fromName, ns3::Ptr<ns3::Node> toPtr, std::string const & toName) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'fromPtr'), param('std::string const &', 'fromName'), param('ns3::Ptr< ns3::Node >', 'toPtr'), param('std::string const &', 'toName')])
## topology-reader.h (module 'topology-read'): std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::TopologyReader::Link::AttributesBegin() [member function]
@@ -1761,6 +1796,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'bool',
[param('std::string const &', 'name'), param('std::string &', 'value')],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetFromNetDevice() const [member function]
cls.add_method('GetFromNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetFromNode() const [member function]
cls.add_method('GetFromNode',
'ns3::Ptr< ns3::Node >',
@@ -1771,6 +1811,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetToNetDevice() const [member function]
cls.add_method('GetToNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetToNode() const [member function]
cls.add_method('GetToNode',
'ns3::Ptr< ns3::Node >',
@@ -1785,6 +1830,10 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string const &', 'name'), param('std::string const &', 'value')])
## topology-reader.h (module 'topology-read'): void ns3::TopologyReader::Link::SetNetDevices(ns3::Ptr<ns3::NetDevice> from, ns3::Ptr<ns3::NetDevice> to) [member function]
cls.add_method('SetNetDevices',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'from'), param('ns3::Ptr< ns3::NetDevice >', 'to')])
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
@@ -1975,11 +2024,6 @@ def register_Ns3EmptyAttributeValue_methods(root_module, cls):
return
def register_Ns3InetTopologyReader_methods(root_module, cls):
## inet-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::InetTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## inet-topology-reader.h (module 'topology-read'): ns3::InetTopologyReader::InetTopologyReader() [constructor]
cls.add_constructor([])
## inet-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::InetTopologyReader::Read() [member function]
@@ -2365,11 +2409,6 @@ def register_Ns3Node_methods(root_module, cls):
return
def register_Ns3OrbisTopologyReader_methods(root_module, cls):
## orbis-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::OrbisTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## orbis-topology-reader.h (module 'topology-read'): ns3::OrbisTopologyReader::OrbisTopologyReader() [constructor]
cls.add_constructor([])
## orbis-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::OrbisTopologyReader::Read() [member function]
@@ -2380,11 +2419,6 @@ def register_Ns3OrbisTopologyReader_methods(root_module, cls):
return
def register_Ns3RocketfuelTopologyReader_methods(root_module, cls):
## rocketfuel-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::RocketfuelTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::RocketfuelTopologyReader::RocketfuelTopologyReader() [constructor]
cls.add_constructor([])
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::RocketfuelTopologyReader::Read() [member function]
@@ -86,6 +86,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Hash::Implementation>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, template_parameters=['ns3::TopologyReader', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TopologyReader>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## nstime.h (module 'core'): ns3::Time [class]
@@ -95,7 +97,7 @@ def register_types(module):
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader [class]
module.add_class('TopologyReader', parent=root_module['ns3::Object'])
module.add_class('TopologyReader', parent=root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link [class]
module.add_class('Link', outer_class=root_module['ns3::TopologyReader'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
@@ -152,7 +154,7 @@ def register_types(module):
module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## address.h (module 'network'): ns3::AddressValue [class]
module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
module.add_container('std::map< std::string, std::string >', ('std::string', 'std::string'), container_type=u'map')
module.add_container('std::map< std::string, std::string >', ('std::string', 'std::string'), container_type='map')
## Register a nested module for the namespace FatalImpl
@@ -175,12 +177,12 @@ def register_types_ns3_Hash(module):
## hash-function.h (module 'core'): ns3::Hash::Implementation [class]
module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *', u'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) **', u'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, size_t ) *&', u'ns3::Hash::Hash64Function_ptr&')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias('uint32_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *', 'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) **', 'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias('uint64_t ( * ) ( char const *, size_t ) *&', 'ns3::Hash::Hash64Function_ptr&')
## Register a nested module for the namespace Function
@@ -229,6 +231,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TopologyReader_methods(root_module, root_module['ns3::TopologyReader'])
@@ -914,6 +917,29 @@ def register_Ns3NodeContainer_methods(root_module, cls):
'uint32_t',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() const [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::begin() [member function]
cls.add_method('begin',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<const ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() const [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node > const, std::vector< ns3::Ptr< ns3::Node > > >',
[],
is_const=True)
## node-container.h (module 'network'): __gnu_cxx::__normal_iterator<ns3::Ptr<ns3::Node>*,std::vector<ns3::Ptr<ns3::Node>, std::allocator<ns3::Ptr<ns3::Node> > > > ns3::NodeContainer::end() [member function]
cls.add_method('end',
'__gnu_cxx::__normal_iterator< ns3::Ptr< ns3::Node >, std::vector< ns3::Ptr< ns3::Node > > >',
[])
## node-container.h (module 'network'): uint32_t ns3::NodeContainer::size() const [member function]
cls.add_method('size',
'uint32_t',
[],
is_const=True)
return
def register_Ns3ObjectBase_methods(root_module, cls):
@@ -1288,18 +1314,18 @@ def register_Ns3Empty_methods(root_module, cls):
return
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_unary_numeric_operator('-')
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', 'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -1480,6 +1506,18 @@ def register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> > const & o) [copy constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter< ns3::TopologyReader > > const &', 'o')])
## simple-ref-count.h (module 'core'): static void ns3::SimpleRefCount<ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >::Cleanup() [member function]
cls.add_method('Cleanup',
'void',
[],
is_static=True)
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1493,15 +1531,15 @@ def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDelete
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', 'right'))
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_comparison_operator('!=')
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', 'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', 'right'))
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('==')
@@ -1702,11 +1740,6 @@ def register_Ns3TopologyReader_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::TopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## topology-reader.h (module 'topology-read'): std::_List_const_iterator<ns3::TopologyReader::Link> ns3::TopologyReader::LinksBegin() const [member function]
cls.add_method('LinksBegin',
'std::_List_const_iterator< ns3::TopologyReader::Link >',
@@ -1741,6 +1774,8 @@ def register_Ns3TopologyReader_methods(root_module, cls):
def register_Ns3TopologyReaderLink_methods(root_module, cls):
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::TopologyReader::Link const & arg0) [copy constructor]
cls.add_constructor([param('ns3::TopologyReader::Link const &', 'arg0')])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link() [constructor]
cls.add_constructor([])
## topology-reader.h (module 'topology-read'): ns3::TopologyReader::Link::Link(ns3::Ptr<ns3::Node> fromPtr, std::string const & fromName, ns3::Ptr<ns3::Node> toPtr, std::string const & toName) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'fromPtr'), param('std::string const &', 'fromName'), param('ns3::Ptr< ns3::Node >', 'toPtr'), param('std::string const &', 'toName')])
## topology-reader.h (module 'topology-read'): std::_Rb_tree_const_iterator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > ns3::TopologyReader::Link::AttributesBegin() [member function]
@@ -1761,6 +1796,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'bool',
[param('std::string const &', 'name'), param('std::string &', 'value')],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetFromNetDevice() const [member function]
cls.add_method('GetFromNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetFromNode() const [member function]
cls.add_method('GetFromNode',
'ns3::Ptr< ns3::Node >',
@@ -1771,6 +1811,11 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
'std::string',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::NetDevice> ns3::TopologyReader::Link::GetToNetDevice() const [member function]
cls.add_method('GetToNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## topology-reader.h (module 'topology-read'): ns3::Ptr<ns3::Node> ns3::TopologyReader::Link::GetToNode() const [member function]
cls.add_method('GetToNode',
'ns3::Ptr< ns3::Node >',
@@ -1785,6 +1830,10 @@ def register_Ns3TopologyReaderLink_methods(root_module, cls):
cls.add_method('SetAttribute',
'void',
[param('std::string const &', 'name'), param('std::string const &', 'value')])
## topology-reader.h (module 'topology-read'): void ns3::TopologyReader::Link::SetNetDevices(ns3::Ptr<ns3::NetDevice> from, ns3::Ptr<ns3::NetDevice> to) [member function]
cls.add_method('SetNetDevices',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'from'), param('ns3::Ptr< ns3::NetDevice >', 'to')])
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
@@ -1975,11 +2024,6 @@ def register_Ns3EmptyAttributeValue_methods(root_module, cls):
return
def register_Ns3InetTopologyReader_methods(root_module, cls):
## inet-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::InetTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## inet-topology-reader.h (module 'topology-read'): ns3::InetTopologyReader::InetTopologyReader() [constructor]
cls.add_constructor([])
## inet-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::InetTopologyReader::Read() [member function]
@@ -2365,11 +2409,6 @@ def register_Ns3Node_methods(root_module, cls):
return
def register_Ns3OrbisTopologyReader_methods(root_module, cls):
## orbis-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::OrbisTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## orbis-topology-reader.h (module 'topology-read'): ns3::OrbisTopologyReader::OrbisTopologyReader() [constructor]
cls.add_constructor([])
## orbis-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::OrbisTopologyReader::Read() [member function]
@@ -2380,11 +2419,6 @@ def register_Ns3OrbisTopologyReader_methods(root_module, cls):
return
def register_Ns3RocketfuelTopologyReader_methods(root_module, cls):
## rocketfuel-topology-reader.h (module 'topology-read'): static ns3::TypeId ns3::RocketfuelTopologyReader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::RocketfuelTopologyReader::RocketfuelTopologyReader() [constructor]
cls.add_constructor([])
## rocketfuel-topology-reader.h (module 'topology-read'): ns3::NodeContainer ns3::RocketfuelTopologyReader::Read() [member function]
@@ -47,7 +47,6 @@ TopologyReaderHelper::SetFileType (const std::string fileType)
m_fileType = fileType;
}
Ptr<TopologyReader>
TopologyReaderHelper::GetTopologyReader ()
{
@@ -59,17 +58,17 @@ TopologyReaderHelper::GetTopologyReader ()
if (m_fileType == "Orbis")
{
NS_LOG_INFO ("Creating Orbis formatted data input.");
m_inputModel = CreateObject<OrbisTopologyReader> ();
m_inputModel = Create<OrbisTopologyReader> ();
}
else if (m_fileType == "Inet")
{
NS_LOG_INFO ("Creating Inet formatted data input.");
m_inputModel = CreateObject<InetTopologyReader> ();
m_inputModel = Create<InetTopologyReader> ();
}
else if (m_fileType == "Rocketfuel")
{
NS_LOG_INFO ("Creating Rocketfuel formatted data input.");
m_inputModel = CreateObject<RocketfuelTopologyReader> ();
m_inputModel = Create<RocketfuelTopologyReader> ();
}
else
{
@@ -22,11 +22,10 @@
#ifndef TOPOLOGY_READER_HELPER_H
#define TOPOLOGY_READER_HELPER_H
#include "ns3/topology-reader.h"
#include <string>
namespace ns3 {
class TopologyReader;
/**
* \ingroup topology
*
+10 -10
View File
@@ -28,19 +28,19 @@
#include "inet-topology-reader.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("InetTopologyReader");
NS_OBJECT_ENSURE_REGISTERED (InetTopologyReader);
namespace ns3 {
TypeId InetTopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::InetTopologyReader")
.SetParent<Object> ()
;
return tid;
}
// NS_OBJECT_ENSURE_REGISTERED (InetTopologyReader);
// TypeId InetTopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::InetTopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
InetTopologyReader::InetTopologyReader ()
{
@@ -47,11 +47,7 @@ namespace ns3 {
class InetTopologyReader : public TopologyReader
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
InetTopologyReader ();
virtual ~InetTopologyReader ();
@@ -28,19 +28,19 @@
#include "orbis-topology-reader.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("OrbisTopologyReader");
NS_OBJECT_ENSURE_REGISTERED (OrbisTopologyReader);
namespace ns3 {
TypeId OrbisTopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::OrbisTopologyReader")
.SetParent<Object> ()
;
return tid;
}
// NS_OBJECT_ENSURE_REGISTERED (OrbisTopologyReader);
// TypeId OrbisTopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::OrbisTopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
OrbisTopologyReader::OrbisTopologyReader ()
{
@@ -44,11 +44,7 @@ namespace ns3 {
class OrbisTopologyReader : public TopologyReader
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
OrbisTopologyReader ();
virtual ~OrbisTopologyReader ();
@@ -28,19 +28,19 @@
#include "ns3/unused.h"
#include "rocketfuel-topology-reader.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("RocketfuelTopologyReader");
NS_OBJECT_ENSURE_REGISTERED (RocketfuelTopologyReader);
namespace ns3 {
TypeId RocketfuelTopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::RocketfuelTopologyReader")
.SetParent<Object> ()
;
return tid;
}
// NS_OBJECT_ENSURE_REGISTERED (RocketfuelTopologyReader);
// TypeId RocketfuelTopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::RocketfuelTopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
RocketfuelTopologyReader::RocketfuelTopologyReader ()
{
@@ -21,7 +21,6 @@
#ifndef ROCKETFUEL_TOPOLOGY_READER_H
#define ROCKETFUEL_TOPOLOGY_READER_H
#include "ns3/nstime.h"
#include "topology-reader.h"
namespace ns3 {
@@ -43,11 +42,7 @@ namespace ns3 {
class RocketfuelTopologyReader : public TopologyReader
{
public:
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
RocketfuelTopologyReader ();
virtual ~RocketfuelTopologyReader ();
+26 -10
View File
@@ -19,24 +19,23 @@
* Author: Valerio Sartini (valesar@gmail.com)
*/
#include "ns3/log.h"
#include "topology-reader.h"
#include "ns3/log.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("TopologyReader");
NS_OBJECT_ENSURE_REGISTERED (TopologyReader);
// NS_OBJECT_ENSURE_REGISTERED (TopologyReader);
TypeId TopologyReader::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::TopologyReader")
.SetParent<Object> ()
;
return tid;
}
// TypeId TopologyReader::GetTypeId (void)
// {
// static TypeId tid = TypeId ("ns3::TopologyReader")
// .SetParent<Object> ()
// ;
// return tid;
// }
TopologyReader::TopologyReader ()
{
@@ -106,12 +105,23 @@ TopologyReader::Link::Link ()
{
}
void
TopologyReader::Link::SetNetDevices (Ptr<NetDevice> from, Ptr<NetDevice> to)
{
m_fromNetDevice = from;
m_toNetDevice = to;
}
Ptr<Node> TopologyReader::Link::GetFromNode (void) const
{
return m_fromPtr;
}
Ptr<NetDevice> TopologyReader::Link::GetFromNetDevice (void) const
{
return m_fromNetDevice;
}
std::string
TopologyReader::Link::GetFromNodeName (void) const
{
@@ -124,6 +134,12 @@ TopologyReader::Link::GetToNode (void) const
return m_toPtr;
}
Ptr<NetDevice>
TopologyReader::Link::GetToNetDevice (void) const
{
return m_toNetDevice;
}
std::string
TopologyReader::Link::GetToNodeName (void) const
{
+41 -30
View File
@@ -22,16 +22,16 @@
#ifndef TOPOLOGY_READER_H
#define TOPOLOGY_READER_H
#include <string>
#include <map>
#include <list>
#include "ns3/object.h"
#include "ns3/node-container.h"
#include "ns3/simple-ref-count.h"
namespace ns3 {
class NetDevice;
/**
* \ingroup topology
*
@@ -40,7 +40,7 @@ namespace ns3 {
* This interface perform the shared tasks among all possible input file readers.
* Each different file format is handled by its own topology reader.
*/
class TopologyReader : public Object
class TopologyReader : public SimpleRefCount<TopologyReader>
{
public:
@@ -53,12 +53,14 @@ public:
*/
class Link
{
public:
/**
* \brief Constant iterator to scan the map of link attributes.
*/
public:
/**
* \brief Constant iterator to scan the map of link attributes.
*/
typedef std::map<std::string, std::string>::const_iterator ConstAttributesIterator;
Link (); // default constructor
/**
* \brief Constructor
* \param fromPtr Ptr to the node the link is orginating from
@@ -66,13 +68,26 @@ public:
* \param toPtr Ptr to the node the link is directed to
* \param toName name of the node the link is directed to
*/
Link ( Ptr<Node> fromPtr, const std::string &fromName, Ptr<Node> toPtr, const std::string &toName );
Link (Ptr<Node> fromPtr, const std::string &fromName, Ptr<Node> toPtr, const std::string &toName);
/**
* \brief Set netdevices associated with the link
* \param from NetDevice associated with From node
* \param to NetDevice associated with To node
*/
void
SetNetDevices (Ptr<NetDevice> from, Ptr<NetDevice> to);
/**
* \brief Returns a Ptr<Node> to the "from" node of the link
* \return a Ptr<Node> to the "from" node of the link
*/
Ptr<Node> GetFromNode (void) const;
/**
* \brief Returns a Ptr<NetDevice> of the "from" node of the link
* \return a Ptr<NetDevice> of the "from" node of the link
*/
Ptr<NetDevice> GetFromNetDevice (void) const;
/**
* \brief Returns the name of the "from" node of the link
* \return the name of the "from" node of the link
@@ -83,6 +98,11 @@ public:
* \return a Ptr<Node> to the "to" node of the link
*/
Ptr<Node> GetToNode (void) const;
/**
* \brief Returns a Ptr<NetDevice> of the "to" node of the link
* \return a Ptr<NetDevice> of the "to" node of the link
*/
Ptr<NetDevice> GetToNetDevice (void) const;
/**
* \brief Returns the name of the "to" node of the link
* \return the name of the "to" node of the link
@@ -122,12 +142,13 @@ public:
ConstAttributesIterator AttributesEnd (void);
private:
Link ();
std::string m_fromName; //!< Name of the node the links originates from
Ptr< Node > m_fromPtr; //!< The node the links originates from
std::string m_toName; //!< Name of the node the links is directed to
Ptr< Node > m_toPtr; //!< The node the links is directed to
std::map<std::string, std::string> m_linkAttr; ///< Container of the link attributes (if any)
std::string m_fromName;
Ptr< Node > m_fromPtr;
std::string m_toName;
Ptr< Node > m_toPtr;
Ptr< NetDevice > m_fromNetDevice;
Ptr< NetDevice > m_toNetDevice;
std::map<std::string, std::string > m_linkAttr;
};
/**
@@ -135,11 +156,7 @@ private:
*/
typedef std::list< Link >::const_iterator ConstLinksIterator;
/**
* \brief Get the type ID.
* \return the object TypeId
*/
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
TopologyReader ();
virtual ~TopologyReader ();
@@ -199,6 +216,10 @@ private:
*/
void AddLink (Link link);
protected:
std::string m_fileName;
std::list<Link> m_linksList;
private:
/**
@@ -215,16 +236,6 @@ private:
*/
TopologyReader& operator= (const TopologyReader&);
/**
* the name of the input file
*/
std::string m_fileName;
/**
* the container of the links between the nodes
*/
std::list<Link> m_linksList;
// end class TopologyReader
};
@@ -55,7 +55,7 @@ RocketfuelTopologyReaderTest::DoRun (void)
std::string input ("./src/topology-read/examples/RocketFuel_toposample_1239_weights.txt");
inFile = CreateObject<RocketfuelTopologyReader> ();
inFile = Create<RocketfuelTopologyReader> ();
inFile->SetFileName (input);
if (inFile != 0)
+55 -16
View File
@@ -4,7 +4,7 @@ from __future__ import division
LAYOUT_ALGORITHM = 'neato' # ['neato'|'dot'|'twopi'|'circo'|'fdp'|'nop']
REPRESENT_CHANNELS_AS_NODES = 1
DEFAULT_NODE_SIZE = 3.0 # default node size in meters
DEFAULT_NODE_SIZE = 2.0 # default node size in meters
DEFAULT_TRANSMISSIONS_MEMORY = 5 # default number of of past intervals whose transmissions are remembered
BITRATE_FONT_SIZE = 10
@@ -95,7 +95,13 @@ class Node(PyVizObject):
self.svg_item = None
self.svg_align_x = None
self.svg_align_y = None
self._label = None
ns3_node = ns.network.NodeList.GetNode(self.node_index)
self._label = '%i' % self.node_index
node_name = ns.core.Names.FindName (ns3_node)
if len(node_name)!=0:
self._label += ' (' + node_name + ')'
self._label_canvas_item = None
self._update_appearance() # call this last
@@ -173,7 +179,7 @@ class Node(PyVizObject):
self.emit("query-extra-tooltip-info", lines)
mob = ns3_node.GetObject(ns.mobility.MobilityModel.GetTypeId())
mob = ns.mobility.MobilityModel.GetMobilityModel (ns3_node)
if mob is not None:
lines.append(' <b>Mobility Model</b>: %s' % mob.GetInstanceTypeId().GetName())
@@ -257,8 +263,8 @@ class Node(PyVizObject):
if self._label is not None:
if self._label_canvas_item is None:
self._label_canvas_item = goocanvas.Text(visibility_threshold=0.5,
font="Sans Serif 10",
self._label_canvas_item = goocanvas.Text(visibility_threshold=0.2,
font="Sans Serif 6",
fill_color_rgba=0x808080ff,
alignment=pango.ALIGN_CENTER,
anchor=gtk.ANCHOR_N,
@@ -308,7 +314,7 @@ class Node(PyVizObject):
def has_mobility(self):
if self._has_mobility is None:
node = ns.network.NodeList.GetNode(self.node_index)
mobility = node.GetObject(ns.mobility.MobilityModel.GetTypeId())
mobility = ns.mobility.MobilityModel.GetMobilityModel (node)
self._has_mobility = (mobility is not None)
return self._has_mobility
@@ -463,6 +469,8 @@ class Visualizer(gobject.GObject):
self.node_drag_state = None
self.follow_node = None
self.shell_window = None
self._topology_scan_timeout_id = None
self.last_discoverd_node = 0
self.create_gui()
@@ -749,19 +757,24 @@ class Visualizer(gobject.GObject):
self.window.show()
def scan_topology(self):
print "scanning topology: %i nodes..." % (ns.network.NodeList.GetNNodes(),)
if (self.last_discoverd_node >= ns.network.NodeList.GetNNodes()):
return True
print "scanning topology: [%i, %i) nodes..." % (self.last_discoverd_node, ns.network.NodeList.GetNNodes(),)
graph = pygraphviz.AGraph()
seen_nodes = 0
for nodeI in range(ns.network.NodeList.GetNNodes()):
for nodeI in range(self.last_discoverd_node, ns.network.NodeList.GetNNodes()):
seen_nodes += 1
if seen_nodes == 100:
if seen_nodes > 100:
print "scan topology... %i nodes visited (%.1f%%)" % (nodeI, 100*nodeI/ns.network.NodeList.GetNNodes())
seen_nodes = 0
node = ns.network.NodeList.GetNode(nodeI)
node_name = "Node %i" % nodeI
node_view = self.get_node(nodeI)
mobility = node.GetObject(ns.mobility.MobilityModel.GetTypeId())
mobility = ns.mobility.MobilityModel.GetMobilityModel (node)
# print "Mobility type: " + mobility.GetInstanceTypeId().GetName()
if mobility is not None:
node_view.set_color("red")
pos = mobility.GetPosition()
@@ -784,6 +797,7 @@ class Visualizer(gobject.GObject):
if mobility is None:
channel_name = "Channel %s" % id(channel)
graph.add_edge(node_name, channel_name)
self.get_channel(channel)
self.create_link(self.get_node(nodeI), self.get_channel(channel))
else:
@@ -802,13 +816,18 @@ class Visualizer(gobject.GObject):
otherDev = channel.GetDevice(otherDevI)
otherNode = otherDev.GetNode()
otherNodeView = self.get_node(otherNode.GetId())
if otherNode is not node:
if mobility is None and not otherNodeView.has_mobility:
if os.environ.get ('NS_VIS_ASSIGN') is not None:
other_node_name = "Node %i" % otherNode.GetId()
graph.add_edge(node_name, other_node_name)
else:
if mobility is None and not otherNodeView.has_mobility:
other_node_name = "Node %i" % otherNode.GetId()
graph.add_edge(node_name, other_node_name)
self.create_link(self.get_node(nodeI), otherNodeView)
print "scanning topology: calling graphviz layout"
# print "scanning topology: calling graphviz layout"
graph.layout(LAYOUT_ALGORITHM)
for node in graph.iternodes():
#print node, "=>", node.attr['pos']
@@ -816,12 +835,26 @@ class Visualizer(gobject.GObject):
pos_x, pos_y = [float(s) for s in node.attr['pos'].split(',')]
if node_type == 'Node':
obj = self.nodes[int(node_id)]
# If node reordering is requested
if os.environ.get ('NS_VIS_ASSIGN') is not None:
node = ns.network.NodeList.GetNode(int(node_id))
mobility = ns.mobility.MobilityModel.GetMobilityModel (node)
if mobility is not None:
pos = ns.core.Vector (pos_x, pos_y, 0)
mobility.SetPosition (pos)
elif node_type == 'Channel':
obj = self.channels[int(node_id)]
obj.set_position(pos_x, pos_y)
print "scanning topology: all done."
# print "scanning topology: all done."
self.emit("topology-scanned")
self.last_discoverd_node = ns.network.NodeList.GetNNodes();
return True
def get_node(self, index):
try:
@@ -868,7 +901,7 @@ class Visualizer(gobject.GObject):
for node in self.nodes.itervalues():
if node.has_mobility:
ns3_node = ns.network.NodeList.GetNode(node.node_index)
mobility = ns3_node.GetObject(ns.mobility.MobilityModel.GetTypeId())
mobility = ns.mobility.MobilityModel.GetMobilityModel (ns3_node)
if mobility is not None:
pos = mobility.GetPosition()
x, y = transform_point_simulation_to_canvas(pos.x, pos.y)
@@ -1093,6 +1126,11 @@ class Visualizer(gobject.GObject):
#print "view: done."
return True
def _start_topology_scan(self):
if self._topology_scan_timeout_id is not None:
gobject.source_remove(self._topology_scan_timeout_id)
self._topology_scan_timeout_id = gobject.timeout_add (1000, self.scan_topology, priority=PRIORITY_UPDATE_VIEW)
def _start_update_timer(self):
if self._update_timeout_id is not None:
gobject.source_remove(self._update_timeout_id)
@@ -1171,6 +1209,7 @@ class Visualizer(gobject.GObject):
def start(self):
self.scan_topology()
self._start_topology_scan()
self.window.connect("delete-event", self._quit)
#self._start_update_timer()
gobject.timeout_add(200, self.autoscale_view)
@@ -1221,7 +1260,7 @@ class Visualizer(gobject.GObject):
self.simulation.lock.acquire()
try:
ns3_node = ns.network.NodeList.GetNode(node.node_index)
mob = ns3_node.GetObject(ns.mobility.MobilityModel.GetTypeId())
mob = ns.mobility.MobilityModel.GetMobilityModel (ns3_node)
if mob is None:
return
if self.node_drag_state is not None:
@@ -1238,7 +1277,7 @@ class Visualizer(gobject.GObject):
self.simulation.lock.acquire()
try:
ns3_node = ns.network.NodeList.GetNode(node.node_index)
mob = ns3_node.GetObject(ns.mobility.MobilityModel.GetTypeId())
mob = ns.mobility.MobilityModel.GetMobilityModel (ns3_node)
if mob is None:
return False
if self.node_drag_state is None:
@@ -0,0 +1,79 @@
import gtk
import ns.core
import ns.network
import ns.internet
from ns.ndnSIM import ndn
from visualizer.base import InformationWindow
class ShowNdnCs(InformationWindow):
COLUMN_PREFIX = 0
def __init__(self, visualizer, node_index):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.node = ns.network.NodeList.GetNode (node_index)
node_name = ns.core.Names.FindName (self.node)
title = "Ndn CS for node %i" % node_index
if len(node_name) != 0:
title += " (" + str(node_name) + ")"
self.win.set_title (title)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
self.win.set_default_size(600, 300)
# Dest.
column = gtk.TreeViewColumn('CS Entry prefix', gtk.CellRendererText(),
text=self.COLUMN_PREFIX)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
def _response_cb(self, win, response):
self.win.destroy()
self.visualizer.remove_information_window(self)
def update(self):
ndnCs = ndn.L3Protocol.getL3Protocol(self.node).getForwarder().getCs()
if ndnCs is None:
return
self.table_model.clear()
for item in ndnCs:
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, item.getName())
def populate_node_menu(viz, node, menu):
menu_item = gtk.MenuItem("Show NDN CS")
menu_item.show()
def _show_ndn_cs(dummy_menu_item):
ShowNdnCs(viz, node.node_index)
menu_item.connect("activate", _show_ndn_cs)
menu.add(menu_item)
def register(viz):
viz.connect("populate-node-menu", populate_node_menu)
@@ -0,0 +1,88 @@
import gtk
import ns.core
import ns.network
import ns.internet
from ns.ndnSIM import ndn
from visualizer.base import InformationWindow
class ShowNdnFib(InformationWindow):
(
COLUMN_PREFIX,
COLUMN_FACE
) = range(2)
def __init__(self, visualizer, node_index):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.node = ns.network.NodeList.GetNode (node_index)
node_name = ns.core.Names.FindName (self.node)
title = "Ndn FIB for node %i" % node_index
if len(node_name) != 0:
title += " (" + str(node_name) + ")"
self.win.set_title (title)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
self.win.set_default_size(600, 300)
# Dest.
column = gtk.TreeViewColumn('Destination', gtk.CellRendererText(),
text=self.COLUMN_PREFIX)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('faceType[nodeId](routingCost,status,metric)', gtk.CellRendererText(),
text=self.COLUMN_FACE)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
def _response_cb(self, win, response):
self.win.destroy()
self.visualizer.remove_information_window(self)
def update(self):
ndnFib = ndn.L3Protocol.getL3Protocol(self.node).getForwarder().getFib()
if ndnFib is None:
return
self.table_model.clear()
for item in ndnFib:
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, str(item.getPrefix()),
self.COLUMN_FACE, ", ".join(["%s%d (%d)" % (str(nh.getFace()), nh.getFace().getId(), nh.getCost()) for nh in item.getNextHops()]))
def populate_node_menu(viz, node, menu):
menu_item = gtk.MenuItem("Show NDN FIB")
menu_item.show()
def _show_ndn_fib(dummy_menu_item):
ShowNdnFib(viz, node.node_index)
menu_item.connect("activate", _show_ndn_fib)
menu.add(menu_item)
def register(viz):
viz.connect("populate-node-menu", populate_node_menu)
@@ -0,0 +1,88 @@
import gtk
import ns.core
import ns.network
import ns.internet
from ns.ndnSIM import ndn
from visualizer.base import InformationWindow
class ShowNdnPit(InformationWindow):
(
COLUMN_PREFIX,
COLUMN_FACE
) = range(2)
def __init__(self, visualizer, node_index):
InformationWindow.__init__(self)
self.win = gtk.Dialog(parent=visualizer.window,
flags=gtk.DIALOG_DESTROY_WITH_PARENT|gtk.DIALOG_NO_SEPARATOR,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
self.win.connect("response", self._response_cb)
self.node = ns.network.NodeList.GetNode (node_index)
node_name = ns.core.Names.FindName (self.node)
title = "Ndn PIT for node %i" % node_index
if len(node_name) != 0:
title += " (" + str(node_name) + ")"
self.win.set_title (title)
self.visualizer = visualizer
self.node_index = node_index
self.table_model = gtk.ListStore(str, str, int)
treeview = gtk.TreeView(self.table_model)
treeview.show()
sw = gtk.ScrolledWindow()
sw.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
vscrollbar_policy=gtk.POLICY_AUTOMATIC)
sw.show()
sw.add(treeview)
self.win.vbox.add(sw)
self.win.set_default_size(600, 300)
# Dest.
column = gtk.TreeViewColumn('Prefix', gtk.CellRendererText(),
text=self.COLUMN_PREFIX)
treeview.append_column(column)
# Interface
column = gtk.TreeViewColumn('Info', gtk.CellRendererText(),
text=self.COLUMN_FACE)
treeview.append_column(column)
self.visualizer.add_information_window(self)
self.win.show()
def _response_cb(self, win, response):
self.win.destroy()
self.visualizer.remove_information_window(self)
def update(self):
ndnPit = ndn.L3Protocol.getL3Protocol(self.node).getForwarder().getPit()
if ndnPit is None:
return
self.table_model.clear()
for item in ndnPit:
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, str(item.getName()),
self.COLUMN_FACE, str(item.getInterest()))
def populate_node_menu(viz, node, menu):
menu_item = gtk.MenuItem("Show NDN PIT")
menu_item.show()
def _show_ndn_pit(dummy_menu_item):
ShowNdnPit(viz, node.node_index)
menu_item.connect("activate", _show_ndn_pit)
menu.add(menu_item)
def register(viz):
viz.connect("populate-node-menu", populate_node_menu)
+3 -21
View File
@@ -71,27 +71,9 @@ def build(bld):
])
headers.source.append('model/pyviz.h')
vissrc = [
'visualizer/base.py',
'visualizer/core.py',
'visualizer/higcontainer.py',
'visualizer/hud.py',
'visualizer/__init__.py',
'visualizer/svgitem.py',
]
pyviz = bld(features='py')
pyviz.source = vissrc
pyviz.install_path = '${PYTHONARCHDIR}/visualizer'
visplugin_src = [
'visualizer/plugins/interface_statistics.py',
'visualizer/plugins/ipv4_routing_table.py',
'visualizer/plugins/olsr.py',
'visualizer/plugins/show_last_packets.py',
'visualizer/plugins/wifi_intrastructure_link.py'
]
pyvizplug = bld(features='py')
pyvizplug.source = visplugin_src
pyvizplug.install_path = '${PYTHONARCHDIR}/visualizer/plugins'
pyviz = bld (features = "py",
source = bld.path.ant_glob (["visualizer/**/*.py"]),
install_from = ".")
bld.ns3_python_bindings()
+7 -6
View File
@@ -442,7 +442,7 @@ def apply(self):
def apply_ns3header(self):
if self.module is None:
raise WafError("'module' missing on ns3headers object %s" % self)
ns3_dir_node = self.bld.path.find_dir("ns3")
ns3_dir_node = self.bld.path.find_or_declare("ns3")
for filename in set(self.to_list(self.source)):
src_node = self.path.find_resource(filename)
if src_node is None:
@@ -468,8 +468,9 @@ class ns3header_task(Task.Task):
def __str__(self):
"string to display to the user"
env = self.env
src_str = ' '.join([a.nice_path(env) for a in self.inputs])
tgt_str = ' '.join([a.nice_path(env) for a in self.outputs])
src_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.inputs])
tgt_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.outputs])
if self.outputs: sep = ' -> '
else: sep = ''
if self.mode == 'remove':
@@ -547,8 +548,8 @@ class gen_ns3_module_header_task(Task.Task):
def __str__(self):
"string to display to the user"
env = self.env
src_str = ' '.join([a.nice_path(env) for a in self.inputs])
tgt_str = ' '.join([a.nice_path(env) for a in self.outputs])
src_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.inputs])
tgt_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.outputs])
if self.outputs: sep = ' -> '
else: sep = ''
if self.mode == 'remove':
@@ -616,7 +617,7 @@ class gen_ns3_module_header_task(Task.Task):
@TaskGen.after_method('process_rule')
def apply_ns3moduleheader(self):
## get all of the ns3 headers
ns3_dir_node = self.bld.path.find_dir("ns3")
ns3_dir_node = self.bld.path.find_or_declare("ns3")
all_headers_inputs = []
found_the_module = False
for ns3headers in self.bld.all_task_gen:
+53 -2
View File
@@ -37,6 +37,7 @@ namespace
std::string pageAttributeList; ///< start Attributes list
std::string pageGlobalValueList; ///< start GlobalValue page
std::string pageTraceSourceList; ///< start Trace sources page
std::string pageLogComponentsList; ///< start Log components page
std::string listStart; ///< start unordered list
std::string listStop; ///< end unordered list
std::string listLineStart; ///< start unordered list item
@@ -409,17 +410,22 @@ PrintHelp (const char *program_name)
<< std::endl
<< "Options:" << std::endl
<< " --help : print these options" << std::endl
<< " --output-text : format output as plain text" << std::endl;
<< " --output-text : format output as plain text" << std::endl
<< " --log : print out also list of log components" << std::endl
<< " --group <group> : print information only for this group" << std::endl;
}
int main (int argc, char *argv[])
{
bool outputText = false;
char *programName = argv[0];
std::string group = "";
bool logComponents = false;
argv++;
argc--;
while (*argv != 0)
while (argc > 0 && *argv != 0)
{
char *arg = *argv;
@@ -432,6 +438,21 @@ int main (int argc, char *argv[])
{
outputText = true;
}
else if (strcmp(arg, "--log") == 0)
{
logComponents = true;
}
else if (strcmp(arg, "--group") == 0)
{
argv ++;
argc --;
if (argc == 0 || argv == 0)
{
PrintHelp (programName);
return 0;
}
group = *argv;
}
else
{
// un-recognized command-line argument
@@ -439,6 +460,7 @@ int main (int argc, char *argv[])
return 0;
}
argv++;
argc--;
}
if (outputText)
@@ -462,6 +484,7 @@ int main (int argc, char *argv[])
pageAttributeList = "";
pageGlobalValueList = "";
pageTraceSourceList = "";
pageLogComponentsList = "";
listStart = "";
listStop = "";
listLineStart = " * ";
@@ -490,6 +513,7 @@ int main (int argc, char *argv[])
pageAttributeList = "\\page AttributesList ";
pageGlobalValueList = "\\page GlobalValueList ";
pageTraceSourceList = "\\page TraceSourceList ";
pageLogComponentsList = "\\page LogComponentList ";
listStart = "<ul>";
listStop = "</ul>";
listLineStart = "<li>";
@@ -544,6 +568,11 @@ int main (int argc, char *argv[])
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
// Capitalize all of letters in the name so that it sorts
// correctly in the map.
std::string name = tid.GetName ();
@@ -671,6 +700,12 @@ int main (int argc, char *argv[])
{
continue;
}
if (group != "" && tid.GetGroupName () != group)
{
continue;
}
std::cout << boldStart << tid.GetName ()
<< boldStop << breakHtmlOnly << std::endl
<< listStart << std::endl;
@@ -739,5 +774,21 @@ int main (int argc, char *argv[])
<< commentStop << std::endl;
std::cout << commentStart
<< pageLogComponentsList << "All LogComponents\n"
<< std::endl
<< listStart << std::endl;
for (const auto& logComponent : GetLogComponents())
{
std::cout << indentHtmlOnly
<< listLineStart
<< boldStart
<< logComponent
<< boldStop
<< listLineStop << std::endl;
}
std::cout << listStop << std::endl
<< commentStop << std::endl;
return 0;
}
Vendored
BIN
View File
Binary file not shown.
+21 -20
View File
@@ -94,35 +94,36 @@ BOOST_TOOLSETS = {
def options(opt):
opt = opt.add_option_group ("Boost Options")
opt.add_option('--boost-includes', type='string',
default='', dest='boost_includes',
help='''path to the boost includes root (~boost root)
e.g. /path/to/boost_1_47_0''')
default='', dest='boost_includes',
help='''path to the boost includes root (~boost root), '''
'''e.g., /path/to/boost_1_47_0''')
opt.add_option('--boost-libs', type='string',
default='', dest='boost_libs',
help='''path to the directory where the boost libs are
e.g. /path/to/boost_1_47_0/stage/lib''')
default='', dest='boost_libs',
help='''path to the directory where the boost libs are, '''
'''e.g., /path/to/boost_1_47_0/stage/lib''')
opt.add_option('--boost-static', action='store_true',
default=False, dest='boost_static',
help='link with static boost libraries (.lib/.a)')
default=False, dest='boost_static',
help='''link with static boost libraries (.lib/.a)''')
opt.add_option('--boost-mt', action='store_true',
default=False, dest='boost_mt',
help='select multi-threaded libraries')
default=False, dest='boost_mt',
help='''select multi-threaded libraries''')
opt.add_option('--boost-abi', type='string', default='', dest='boost_abi',
help='''select libraries with tags (dgsyp, d for debug),
see doc Boost, Getting Started, chapter 6.1''')
help='''select libraries with tags (dgsyp, d for debug), '''
'''see doc Boost, Getting Started, chapter 6.1''')
opt.add_option('--boost-linkage_autodetect', action="store_true", dest='boost_linkage_autodetect',
help="auto-detect boost linkage options (don't get used to it / might break other stuff)")
help='''auto-detect boost linkage options (don't get used to it / might break other stuff)''')
opt.add_option('--boost-toolset', type='string',
default='', dest='boost_toolset',
help='force a toolset e.g. msvc, vc90, \
gcc, mingw, mgw45 (default: auto)')
default='', dest='boost_toolset',
help='''force a toolset e.g. msvc, vc90, '''
'''gcc, mingw, mgw45 (default: auto)''')
py_version = '%d%d' % (sys.version_info[0], sys.version_info[1])
opt.add_option('--boost-python', type='string',
default=py_version, dest='boost_python',
help='select the lib python with this version \
(default: %s)' % py_version)
default=py_version, dest='boost_python',
help='''select the lib python with this version (default: %s)''' % py_version)
@conf
def __boost_get_version_file(self, dir):
+40 -9
View File
@@ -1,7 +1,11 @@
from waflib import Logs, Options, Utils
from waflib import Logs, Options, Utils, Configure
class CompilerTraits(object):
def get_compiler_flags(self):
"""get_compiler_flags() -> list of cflags"""
raise NotImplementedError
def get_warnings_flags(self, level):
"""get_warnings_flags(level) -> list of cflags"""
raise NotImplementedError
@@ -19,7 +23,11 @@ class GccTraits(CompilerTraits):
def __init__(self):
super(GccTraits, self).__init__()
# cumulative list of warnings per level
self.warnings_flags = [['-Wall'], ['-Werror'], ['-Wextra']]
self.warnings_flags = [['-Wall', '-Wno-error=deprecated-declarations',
'-fstrict-aliasing', '-Wstrict-aliasing']]
def get_compiler_flags(self):
return ['-std=c++0x', '-std=c++11']
def get_warnings_flags(self, level):
warnings = []
@@ -47,7 +55,7 @@ class GccTraits(CompilerTraits):
return (['-g'], [])
elif level >= 2:
return (['-ggdb', '-g3'], ['_DEBUG'])
class IccTraits(CompilerTraits):
def __init__(self):
@@ -55,7 +63,10 @@ class IccTraits(CompilerTraits):
# cumulative list of warnings per level
# icc is _very_ verbose with -Wall, -Werror is barely achievable
self.warnings_flags = [[], [], ['-Wall']]
def get_compiler_flags(self):
return ['/Qstd=c++11']
def get_warnings_flags(self, level):
warnings = []
for l in range(level):
@@ -82,7 +93,6 @@ class IccTraits(CompilerTraits):
return (['-g'], [])
elif level >= 2:
return (['-ggdb', '-g3'], ['_DEBUG'])
class MsvcTraits(CompilerTraits):
@@ -91,6 +101,9 @@ class MsvcTraits(CompilerTraits):
# cumulative list of warnings per level
self.warnings_flags = [['/W2'], ['/WX'], ['/Wall']]
def get_compiler_flags(self):
return []
def get_warnings_flags(self, level):
warnings = []
for l in range(level):
@@ -161,7 +174,7 @@ def configure(conf):
if not (cc or cxx):
raise Utils.WafError("neither COMPILER_CC nor COMPILER_CXX are defined; "
"maybe the compiler_cc or compiler_cxx tool has not been configured yet?")
try:
compiler = compiler_mapping[cc]
except KeyError:
@@ -174,17 +187,35 @@ def configure(conf):
opt_level, warn_level, dbg_level = profiles[Options.options.build_profile]
optimizations = compiler.get_optimization_flags(opt_level)
compilerFlags = conf.get_supported_cxxflags(compiler.get_compiler_flags(), msg="compiler ")
optimizations = conf.get_supported_cxxflags(compiler.get_optimization_flags(opt_level), msg="optimizations ")
debug, debug_defs = compiler.get_debug_flags(dbg_level)
warnings = compiler.get_warnings_flags(warn_level)
debug = conf.get_supported_cxxflags(debug, msg="debug ")
warnings = conf.get_supported_cxxflags(compiler.get_warnings_flags(warn_level), msg="warnings ")
if cc and not conf.env['CCFLAGS']:
conf.env.append_value('CCFLAGS', optimizations)
conf.env.append_value('CCFLAGS', debug)
conf.env.append_value('CCFLAGS', warnings)
conf.env.append_value('CCDEFINES', debug_defs)
if cxx and not conf.env['CXXFLAGS']:
conf.env.append_value('CXXFLAGS', compilerFlags)
conf.env.append_value('CXXFLAGS', optimizations)
conf.env.append_value('CXXFLAGS', debug)
conf.env.append_value('CXXFLAGS', warnings)
conf.env.append_value('CXXDEFINES', debug_defs)
@Configure.conf
def get_supported_cxxflags(self, cxxflags, msg=""):
"""
Check which cxxflags are supported by the compiler
"""
self.start_msg('Checking supported %sCXXFLAGS' % msg)
supportedFlags = []
for flag in cxxflags:
if self.check_cxx(cxxflags=['-Werror', flag], mandatory=False):
supportedFlags += [flag]
self.end_msg(' '.join(supportedFlags))
return supportedFlags
-12
View File
@@ -503,18 +503,6 @@ def configure(conf):
# for compiling C code, copy over the CXX* flags
conf.env.append_value('CCFLAGS', conf.env['CXXFLAGS'])
def add_gcc_flag(flag):
if env['COMPILER_CXX'] == 'g++' and 'CXXFLAGS' not in os.environ:
if conf.check_compilation_flag(flag, mode='cxx'):
env.append_value('CXXFLAGS', flag)
if env['COMPILER_CC'] == 'gcc' and 'CCFLAGS' not in os.environ:
if conf.check_compilation_flag(flag, mode='cc'):
env.append_value('CCFLAGS', flag)
add_gcc_flag('-Wno-error=deprecated-declarations')
add_gcc_flag('-fstrict-aliasing')
add_gcc_flag('-Wstrict-aliasing')
try:
conf.find_program('doxygen', var='DOXYGEN')
except WafError: