Compare commits

...

45 Commits

Author SHA1 Message Date
Alexander Afanasyev 0e36bc3411 core: Remove Logger inheritance from std::ostream
This inheritance caused strange problems on OSX 10.9
2014-02-15 21:40:35 -08:00
Alexander Afanasyev 1cc50d4339 build: Fixes for OSX 10.9 2014-02-10 11:01:23 -08:00
Alexander Afanasyev d7dd837b33 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.
2013-11-01 14:15:03 -07:00
Alexander Afanasyev f798d8cb9f bindings: Bump pybindgen version 2013-11-01 14:10:16 -07:00
Alexander Afanasyev 8a219bd495 Merge branch 'code.nsnam.org/ns-3-dev/branches/default' into ndnSIM 2013-11-01 14:07:44 -07:00
Alexander Afanasyev 7230313bc9 Revert "build: Update to waf with an upgraded version of python tool"
This reverts commit 8ee1d870f1.
2013-11-01 14:04:38 -07:00
Alexander Afanasyev 120f8b103b Revert "internet: Renaming DscpType contants in ipv4-header.h"
This reverts commit 1110442c65.
2013-11-01 14:02:17 -07:00
Alexander Afanasyev c710813fd3 Revert "internet: One more set of renaming constants that clash with <termios.h>"
This reverts commit f9f3686701.
2013-11-01 14:02:09 -07:00
Alexander Afanasyev 9300011c55 Revert "core: Extending public interface of CommandLine class."
This reverts commit a4e13e9f83.
2013-11-01 14:01:09 -07:00
Alexander Afanasyev 23da97affc bindings: Adding necessary GIL lock in generated callback destructor
The callback destructor is calling Py_DECREF on the python object, which
may ultimately lead to destruction of the python object.  Without GIL
locking, this can miserably fail with mysterious segfault.
2013-08-12 16:33:15 -07:00
Alexander Afanasyev fff9de52c0 visualizer: Modifying the way visualizer is installed
Using ant_glob instead of explicitly listing the installed files
2013-08-07 18:51:56 -07:00
Alexander Afanasyev a4e13e9f83 core: Extending public interface of CommandLine class.
Now it is possible to request printing command line arguments to the
desired output stream using PrintHelp or operator <<:

  CommandLine cmd;
  cmd.Parse (argc, argv);
...

  std::cerr << cmd;
or
  cmd.PrintHelp (std::cerr);
2013-07-28 13:06:20 -07:00
Alexander Afanasyev 8ee1d870f1 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.
2013-07-27 15:50:28 -07:00
Alexander Afanasyev 653ab61d10 network: Packet API extension, allowing creating of packet from string (for python bindings) 2013-07-27 15:50:28 -07:00
Alexander Afanasyev 955cb10576 point-to-point: Extending helper interface to support setting individual queue parameters 2013-07-27 15:50:28 -07:00
Alexander Afanasyev 6a411bea63 visualizer+ndnSIM: Disabling two experimental context menu plugins 2013-07-27 15:50:27 -07:00
Alexander Afanasyev 1e5c166f9a visualizer+ndnSIM: Adding ability to visualize items of the content store in real time 2013-07-27 15:50:27 -07:00
Alexander Afanasyev fa06e34a2f visualizer: Adding ability to assign position to mobility model is env{NS_VIS_ASSIGN} is set to any value 2013-07-27 15:50:27 -07:00
Alexander Afanasyev e707f1d255 visualizer: adding a couple of ndnSIM-related plugins 2013-07-27 15:50:27 -07:00
Xiaoke Jiang f9f3686701 internet: One more set of renaming constants that clash with <termios.h>
Signed-off-by: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
2013-07-27 15:50:27 -07:00
Alexander Afanasyev 1110442c65 internet: Renaming DscpType contants in ipv4-header.h
On some systems, macros defined in <termios.h> clash with some DscpType enums.
2013-07-27 15:50:27 -07:00
Alexander Afanasyev e56da94214 fd-net-device: Add missing include for strerror 2013-07-27 15:50:26 -07:00
Alexander Afanasyev 09aaae66cd network: Adding STL-like iterator wrappers (begin(), end(), size()) for NodeContainer class 2013-07-27 15:50:26 -07:00
Alexander Afanasyev b3d150643d build: no longer require fake `ns3' directory in NS-3's root folder 2013-07-27 15:50:26 -07:00
Alexander Afanasyev 715e7e5820 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.
2013-07-27 15:50:26 -07:00
Alexander Afanasyev cf33c35ec9 core: LogComponent now stores name as std::string: caused troubles for complex logging initialization 2013-07-27 15:50:26 -07:00
Alexander Afanasyev 779c8825c9 core: Declare MakeAttributeAccessor* helper function inline (caused problems with apple gcc) 2013-07-27 15:30:40 -07:00
Alexander Afanasyev 748c2edb88 python:mobility+topology-read: rescanned bindings 2013-07-27 15:30:40 -07:00
Alexander Afanasyev 015fa2d516 core: Config/Connect will search for attributes in parent classes 2013-07-27 15:30:40 -07:00
Alexander Afanasyev 7673273900 visualizer: output node ID 2013-07-27 15:30:40 -07:00
Alexander Afanasyev a6ca226024 visualizer: Update visualizer plugins to reflect refactored ndnSIM code 2013-07-27 15:30:39 -07:00
Alexander Afanasyev fcbbf82910 mobility+visualizer+python: 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.
2013-07-27 15:30:39 -07:00
Alexander Afanasyev 2b0daaa2dd visualizer+ndnSIM: Adding plugin to display ndnSIM PIT status 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 3e082eac71 visualizer: Making a periodic topology rescan 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 59f6c2dae9 visualizer+ndnSIM: Adding plugin to display a ndnSIM FIB state 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 01d66722dd core: Give ability to generate subset of documentation by utils/print-introspected-doxygen 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 48fc3e384f point-to-point, netanim: Adding ChannelID to PointToPointChannel trace 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 25da81b588 network: Adding Read (Buffer::Iterator start, uint32_t size) and PeakU8 methods to ns3::Buffer::Iterator class 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 819dcc69b6 core: Adding inline specifiers for DoMakeAttributeAccessor (there was a strange duplicate symbols error using apple compiler...) 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 189b0d65ad core: Small extension of Vector class (math operations) 2013-07-27 15:30:39 -07:00
Alexander Afanasyev 87889e0aea topology-read: Making default constructor for TopologyReader::Link public.
This is necessary for some STL containers operations.
2013-07-27 15:30:38 -07:00
Alexander Afanasyev 9cc680d8c2 topology-read: TopologyReader and derivatives are no longer Objects
To allow smart pointers, TopologyReader is just inherited from
SimpleRefCount<TopologyReader> class
2013-07-27 15:30:38 -07:00
Alexander Afanasyev 40326b6a42 topology-read: Several extensions of TopologyReader 2013-07-27 15:30:38 -07:00
Ilya Moiseenko 18f7b9f007 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
2013-07-27 15:30:38 -07:00
Alexander Afanasyev e0ee870dc8 Adding .gitignore and disclaimer note in README 2013-07-27 15:30:38 -07:00
54 changed files with 1462 additions and 312 deletions
+51
View File
@@ -0,0 +1,51 @@
*.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
+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
--------------------------------
+1 -1
View File
@@ -13,7 +13,7 @@ from waflib.Errors import WafError
# after = TaskGen.after
## https://launchpad.net/pybindgen/
REQUIRED_PYBINDGEN_VERSION = (0, 16, 0, 834)
REQUIRED_PYBINDGEN_VERSION = (0, 16, 0, 898)
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
-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).
+11 -11
View File
@@ -28,14 +28,14 @@ namespace ns3 {
* \ingroup AttributeHelper
*/
template <typename V, typename T1>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1);
/**
* \ingroup AttributeHelper
*/
template <typename V, typename T1, typename T2>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1, T2 a2);
} // namespace ns3
@@ -94,7 +94,7 @@ private:
};
template <typename V, typename T, typename U>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperOne (U T::*memberVariable)
{
class MemberVariable : public AccessorHelper<T,V>
@@ -132,7 +132,7 @@ private:
}
template <typename V, typename T, typename U>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperOne (U (T::*getter)(void) const)
{
class MemberMethod : public AccessorHelper<T,V>
@@ -163,7 +163,7 @@ private:
template <typename V, typename T, typename U>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperOne (void (T::*setter)(U))
{
class MemberMethod : public AccessorHelper<T,V>
@@ -199,7 +199,7 @@ private:
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (void (T::*setter)(U),
V (T::*getter)(void) const)
{
@@ -240,7 +240,7 @@ private:
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (V (T::*getter)(void) const,
void (T::*setter)(U))
{
@@ -248,7 +248,7 @@ DoMakeAccessorHelperTwo (V (T::*getter)(void) const,
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (bool (T::*setter)(U),
V (T::*getter)(void) const)
{
@@ -289,7 +289,7 @@ private:
}
template <typename W, typename T, typename U, typename V>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (bool (T::*getter)(void) const,
void (T::*setter)(U))
{
@@ -297,14 +297,14 @@ DoMakeAccessorHelperTwo (bool (T::*getter)(void) const,
}
template <typename V, typename T1>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1)
{
return DoMakeAccessorHelperOne<V> (a1);
}
template <typename V, typename T1, typename T2>
Ptr<const AttributeAccessor>
inline Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1, T2 a2)
{
return DoMakeAccessorHelperTwo<V> (a1, a2);
+49 -39
View File
@@ -403,52 +403,62 @@ Resolver::DoResolve (std::string path, Ptr<Object> root)
else
{
// this is a normal attribute.
TypeId tid = root->GetInstanceTypeId ();
TypeId tid;
TypeId nextTid = root->GetInstanceTypeId ();
bool foundMatch = false;
for (uint32_t i = 0; i < tid.GetAttributeN(); i++)
do
{
struct TypeId::AttributeInformation info;
info = tid.GetAttribute(i);
if (info.name != item && item != "*")
tid = nextTid;
for (uint32_t i = 0; i < tid.GetAttributeN(); i++)
{
continue;
}
// attempt to cast to a pointer checker.
const PointerChecker *ptr = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
if (ptr != 0)
{
NS_LOG_DEBUG ("GetAttribute(ptr)="<<info.name<<" on path="<<GetResolvedPath ());
PointerValue ptr;
root->GetAttribute (info.name, ptr);
Ptr<Object> object = ptr.Get<Object> ();
if (object == 0)
struct TypeId::AttributeInformation info;
info = tid.GetAttribute(i);
if (info.name != item && item != "*")
{
NS_LOG_ERROR ("Requested object name=\""<<item<<
"\" exists on path=\""<<GetResolvedPath ()<<"\""
" but is null.");
continue;
}
foundMatch = true;
m_workStack.push_back (info.name);
DoResolve (pathLeft, object);
m_workStack.pop_back ();
// attempt to cast to a pointer checker.
const PointerChecker *ptr = dynamic_cast<const PointerChecker *> (PeekPointer (info.checker));
if (ptr != 0)
{
NS_LOG_DEBUG ("GetAttribute(ptr)="<<info.name<<" on path="<<GetResolvedPath ());
PointerValue ptr;
root->GetAttribute (info.name, ptr);
Ptr<Object> object = ptr.Get<Object> ();
if (object == 0)
{
NS_LOG_ERROR ("Requested object name=\""<<item<<
"\" exists on path=\""<<GetResolvedPath ()<<"\""
" but is null.");
continue;
}
foundMatch = true;
m_workStack.push_back (info.name);
DoResolve (pathLeft, object);
m_workStack.pop_back ();
}
// attempt to cast to an object vector.
const ObjectPtrContainerChecker *vectorChecker =
dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
if (vectorChecker != 0)
{
NS_LOG_DEBUG ("GetAttribute(vector)="<<info.name<<" on path="<<GetResolvedPath () << pathLeft);
foundMatch = true;
ObjectPtrContainerValue vector;
root->GetAttribute (info.name, vector);
m_workStack.push_back (info.name);
DoArrayResolve (pathLeft, vector);
m_workStack.pop_back ();
}
// this could be anything else and we don't know what to do with it.
// So, we just ignore it.
}
// attempt to cast to an object vector.
const ObjectPtrContainerChecker *vectorChecker =
dynamic_cast<const ObjectPtrContainerChecker *> (PeekPointer (info.checker));
if (vectorChecker != 0)
{
NS_LOG_DEBUG ("GetAttribute(vector)="<<info.name<<" on path="<<GetResolvedPath () << pathLeft);
foundMatch = true;
ObjectPtrContainerValue vector;
root->GetAttribute (info.name, vector);
m_workStack.push_back (info.name);
DoArrayResolve (pathLeft, vector);
m_workStack.pop_back ();
}
// this could be anything else and we don't know what to do with it.
// So, we just ignore it.
}
nextTid = tid.GetParent ();
} while (nextTid != tid);
if (!foundMatch)
{
NS_LOG_DEBUG ("Requested item="<<item<<" does not exist on path="<<GetResolvedPath ());
+1 -1
View File
@@ -397,7 +397,7 @@ private:
std::string m_name;
};
class ParameterLogger : public std::ostream
class ParameterLogger // : public std::ostream
{
int m_itemNumber;
std::ostream &m_os;
+137
View File
@@ -53,6 +53,68 @@ Vector3D::Vector3D ()
NS_LOG_FUNCTION (this);
}
double
Vector3D::GetLength () const
{
return sqrt (x*x + y*y + z*z);
}
Vector3D&
Vector3D::operator += (const Vector3D &v)
{
x += v.x;
y += v.y;
z += v.z;
return *this;
}
Vector3D&
Vector3D::operator += (double v)
{
x += v;
y += v;
z += v;
return *this;
}
Vector3D
Vector3D::operator + (const Vector3D &v) const
{
return Vector3D (x+v.x, y+v.y, z+v.z);
}
Vector3D
Vector3D::operator + (double v) const
{
return Vector3D (x+v, y+v, z+v);
}
Vector3D
Vector3D::operator * (const Vector3D &v) const
{
return Vector3D (x*v.x, y*v.y, z*v.z);
}
Vector3D
Vector3D::operator * (double v) const
{
return Vector3D (x*v, y*v, z*v);
}
Vector3D
Vector3D::operator - (const Vector3D &v) const
{
return Vector3D (x-v.x, y-v.y, z-v.z);
}
Vector3D
Vector3D::operator / (double div) const
{
return Vector3D (x/div, y/div, z/div);
}
Vector2D::Vector2D (double _x, double _y)
: x (_x),
y (_y)
@@ -67,6 +129,66 @@ Vector2D::Vector2D ()
NS_LOG_FUNCTION (this);
}
double
Vector2D::GetLength () const
{
return sqrt (x*x + y*y);
}
Vector2D&
Vector2D::operator += (const Vector2D &v)
{
x += v.x;
y += v.y;
return *this;
}
Vector2D&
Vector2D::operator += (double v)
{
x += v;
y += v;
return *this;
}
Vector2D
Vector2D::operator + (const Vector2D &v) const
{
return Vector2D (x+v.x, y+v.y);
}
Vector2D
Vector2D::operator + (double v) const
{
return Vector2D (x+v, y+v);
}
Vector2D
Vector2D::operator * (const Vector2D &v) const
{
return Vector2D (x*v.x, y*v.y);
}
Vector2D
Vector2D::operator * (double v) const
{
return Vector2D (x*v, y*v);
}
Vector2D
Vector2D::operator - (const Vector2D &v) const
{
return Vector2D (x-v.x, y-v.y);
}
Vector2D
Vector2D::operator / (double div) const
{
return Vector2D (x/div, y/div);
}
double
CalculateDistance (const Vector3D &a, const Vector3D &b)
{
@@ -87,6 +209,21 @@ CalculateDistance (const Vector2D &a, const Vector2D &b)
return distance;
}
double
ScalarMultiplication (const Vector3D &a, const Vector3D &b)
{
Vector3D tmp = a * b;
return tmp.x + tmp.y + tmp.z;
}
double
ScalarMultiplication (const Vector2D &a, const Vector2D &b)
{
Vector2D tmp = a * b;
return tmp.x + tmp.y;
}
std::ostream &operator << (std::ostream &os, const Vector3D &vector)
{
os << vector.x << ":" << vector.y << ":" << vector.z;
+35
View File
@@ -55,6 +55,17 @@ public:
* z coordinate of vector
*/
double z;
double GetLength () const;
Vector3D& operator += (const Vector3D &);
Vector3D& operator += (double);
Vector3D operator + (const Vector3D &) const;
Vector3D operator + (double) const;
Vector3D operator * (const Vector3D &) const;
Vector3D operator * (double v) const;
Vector3D operator - (const Vector3D &) const;
Vector3D operator / (double) const;
};
/**
@@ -82,6 +93,17 @@ public:
* y coordinate of vector
*/
double y;
double GetLength () const;
Vector2D& operator += (const Vector2D &);
Vector2D& operator += (double);
Vector2D operator + (const Vector2D &) const;
Vector2D operator + (double) const;
Vector2D operator * (const Vector2D &) const;
Vector2D operator * (double v) const;
Vector2D operator - (const Vector2D &) const;
Vector2D operator / (double) const;
};
/**
@@ -98,6 +120,19 @@ double CalculateDistance (const Vector3D &a, const Vector3D &b);
*/
double CalculateDistance (const Vector2D &a, const Vector2D &b);
/**
* \brief Calculate scalar multiplication between two vectors
* \param a one point
* \param b another point
*/
double ScalarMultiplication (const Vector3D &a, const Vector3D &b);
/**
* \brief Calculate scalar multiplication between two vectors
* \param a one point
* \param b another point
*/
double ScalarMultiplication (const Vector2D &a, const Vector2D &b);
/**
* \class ns3::Vector3DValue
* \brief hold objects of type ns3::Vector3D
+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 {
-1
View File
@@ -31,7 +31,6 @@
#include <list>
#include <tr1/functional>
#include <vector>
#include <ns3/log.h>
#include <ns3/pointer.h>
+40 -4
View File
@@ -264,14 +264,14 @@ 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('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('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('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('ns3::Vector3DChecker', 'ns3::VectorChecker')
typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*')
typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&')
@@ -1719,12 +1719,25 @@ def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
def register_Ns3Vector2D_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_numeric_operator('*', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('ns3::Vector2D const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('double', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('ns3::Vector2D const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('double', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Vector2D const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('double', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('ns3::Vector2D const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('double', 'right'))
## vector.h (module 'core'): ns3::Vector2D::Vector2D(ns3::Vector2D const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Vector2D const &', 'arg0')])
## vector.h (module 'core'): ns3::Vector2D::Vector2D(double _x, double _y) [constructor]
cls.add_constructor([param('double', '_x'), param('double', '_y')])
## vector.h (module 'core'): ns3::Vector2D::Vector2D() [constructor]
cls.add_constructor([])
## vector.h (module 'core'): double ns3::Vector2D::GetLength() const [member function]
cls.add_method('GetLength',
'double',
[],
is_const=True)
## vector.h (module 'core'): ns3::Vector2D::x [variable]
cls.add_instance_attribute('x', 'double', is_const=False)
## vector.h (module 'core'): ns3::Vector2D::y [variable]
@@ -1733,12 +1746,25 @@ def register_Ns3Vector2D_methods(root_module, cls):
def register_Ns3Vector3D_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_numeric_operator('*', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('ns3::Vector3D const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('double', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('ns3::Vector3D const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('double', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Vector3D const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('double', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('ns3::Vector3D const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('double', 'right'))
## vector.h (module 'core'): ns3::Vector3D::Vector3D(ns3::Vector3D const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Vector3D const &', 'arg0')])
## vector.h (module 'core'): ns3::Vector3D::Vector3D(double _x, double _y, double _z) [constructor]
cls.add_constructor([param('double', '_x'), param('double', '_y'), param('double', '_z')])
## vector.h (module 'core'): ns3::Vector3D::Vector3D() [constructor]
cls.add_constructor([])
## vector.h (module 'core'): double ns3::Vector3D::GetLength() const [member function]
cls.add_method('GetLength',
'double',
[],
is_const=True)
## vector.h (module 'core'): ns3::Vector3D::x [variable]
cls.add_instance_attribute('x', 'double', is_const=False)
## vector.h (module 'core'): ns3::Vector3D::y [variable]
@@ -1896,6 +1922,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',
@@ -3414,6 +3445,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',
+40 -4
View File
@@ -264,14 +264,14 @@ 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('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('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('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('ns3::Vector3DChecker', 'ns3::VectorChecker')
typehandlers.add_type_alias('ns3::Vector3DChecker*', 'ns3::VectorChecker*')
typehandlers.add_type_alias('ns3::Vector3DChecker&', 'ns3::VectorChecker&')
@@ -1719,12 +1719,25 @@ def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
def register_Ns3Vector2D_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_numeric_operator('*', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('ns3::Vector2D const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('double', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('ns3::Vector2D const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('double', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Vector2D const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('double', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('ns3::Vector2D const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Vector2D'], root_module['ns3::Vector2D'], param('double', 'right'))
## vector.h (module 'core'): ns3::Vector2D::Vector2D(ns3::Vector2D const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Vector2D const &', 'arg0')])
## vector.h (module 'core'): ns3::Vector2D::Vector2D(double _x, double _y) [constructor]
cls.add_constructor([param('double', '_x'), param('double', '_y')])
## vector.h (module 'core'): ns3::Vector2D::Vector2D() [constructor]
cls.add_constructor([])
## vector.h (module 'core'): double ns3::Vector2D::GetLength() const [member function]
cls.add_method('GetLength',
'double',
[],
is_const=True)
## vector.h (module 'core'): ns3::Vector2D::x [variable]
cls.add_instance_attribute('x', 'double', is_const=False)
## vector.h (module 'core'): ns3::Vector2D::y [variable]
@@ -1733,12 +1746,25 @@ def register_Ns3Vector2D_methods(root_module, cls):
def register_Ns3Vector3D_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_numeric_operator('*', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('ns3::Vector3D const &', 'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('double', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('ns3::Vector3D const &', 'right'))
cls.add_binary_numeric_operator('+', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('double', 'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Vector3D const &', 'right'))
cls.add_inplace_numeric_operator('+=', param('double', 'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('ns3::Vector3D const &', 'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Vector3D'], root_module['ns3::Vector3D'], param('double', 'right'))
## vector.h (module 'core'): ns3::Vector3D::Vector3D(ns3::Vector3D const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Vector3D const &', 'arg0')])
## vector.h (module 'core'): ns3::Vector3D::Vector3D(double _x, double _y, double _z) [constructor]
cls.add_constructor([param('double', '_x'), param('double', '_y'), param('double', '_z')])
## vector.h (module 'core'): ns3::Vector3D::Vector3D() [constructor]
cls.add_constructor([])
## vector.h (module 'core'): double ns3::Vector3D::GetLength() const [member function]
cls.add_method('GetLength',
'double',
[],
is_const=True)
## vector.h (module 'core'): ns3::Vector3D::x [variable]
cls.add_instance_attribute('x', 'double', is_const=False)
## vector.h (module 'core'): ns3::Vector3D::y [variable]
@@ -1896,6 +1922,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',
@@ -3414,6 +3445,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 */
+3 -1
View File
@@ -981,7 +981,9 @@ void AnimationInterface::WriteNonP2pLinkProperties (uint32_t id, std::string ipv
WriteN (oss.str (), m_f);
}
void AnimationInterface::DevTxTrace (std::string context, Ptr<const Packet> p,
void AnimationInterface::DevTxTrace (std::string context,
uint32_t channel,
Ptr<const Packet> p,
Ptr<NetDevice> tx, Ptr<NetDevice> rx,
Time txTime, Time rxTime)
{
+2 -1
View File
@@ -490,7 +490,8 @@ private:
void StopAnimation (bool onlyAnimation = false);
void DevTxTrace (std::string context,
Ptr<const Packet> p,
uint32_t,
Ptr<const Packet> p,
Ptr<NetDevice> tx,
Ptr<NetDevice> rx,
Time txTime,
+15 -13
View File
@@ -881,10 +881,10 @@ def register_Ns3AsciiFile_methods(root_module, cls):
'bool',
[],
is_const=True)
## ascii-file.h (module 'network'): void ns3::AsciiFile::Open(std::string const & filename, std::_Ios_Openmode mode) [member function]
## ascii-file.h (module 'network'): void ns3::AsciiFile::Open(std::string const & filename, std::ios::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')])
[param('std::string const &', 'filename'), param('std::ios::openmode', 'mode')])
## ascii-file.h (module 'network'): void ns3::AsciiFile::Close() [member function]
cls.add_method('Close',
'void',
@@ -905,10 +905,10 @@ def register_Ns3AsciiTraceHelper_methods(root_module, cls):
cls.add_constructor([param('ns3::AsciiTraceHelper const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::AsciiTraceHelper::AsciiTraceHelper() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): ns3::Ptr<ns3::OutputStreamWrapper> ns3::AsciiTraceHelper::CreateFileStream(std::string filename, std::_Ios_Openmode filemode=std::ios_base::out) [member function]
## trace-helper.h (module 'network'): ns3::Ptr<ns3::OutputStreamWrapper> ns3::AsciiTraceHelper::CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios_base::out) [member function]
cls.add_method('CreateFileStream',
'ns3::Ptr< ns3::OutputStreamWrapper >',
[param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode', default_value='std::ios_base::out')])
[param('std::string', 'filename'), param('std::ios::openmode', 'filemode', default_value='std::ios_base::out')])
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDequeueSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<ns3::Packet const> p) [member function]
cls.add_method('DefaultDequeueSinkWithContext',
'void',
@@ -3067,10 +3067,10 @@ def register_Ns3PcapFile_methods(root_module, cls):
cls.add_method('Init',
'void',
[param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'timeZoneCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT'), param('bool', 'swapMode', default_value='false')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Open(std::string const & filename, std::_Ios_Openmode mode) [member function]
## pcap-file.h (module 'network'): void ns3::PcapFile::Open(std::string const & filename, std::ios::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')])
[param('std::string const &', 'filename'), param('std::ios::openmode', 'mode')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Read(uint8_t * const data, uint32_t maxBytes, uint32_t & tsSec, uint32_t & tsUsec, uint32_t & inclLen, uint32_t & origLen, uint32_t & readLen) [member function]
cls.add_method('Read',
'void',
@@ -3098,10 +3098,10 @@ def register_Ns3PcapHelper_methods(root_module, cls):
cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::PcapHelper::PcapHelper() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): ns3::Ptr<ns3::PcapFileWrapper> ns3::PcapHelper::CreateFile(std::string filename, std::_Ios_Openmode filemode, uint32_t dataLinkType, uint32_t snapLen=65535, int32_t tzCorrection=0) [member function]
## trace-helper.h (module 'network'): ns3::Ptr<ns3::PcapFileWrapper> ns3::PcapHelper::CreateFile(std::string filename, std::ios::openmode filemode, uint32_t dataLinkType, uint32_t snapLen=65535, int32_t tzCorrection=0) [member function]
cls.add_method('CreateFile',
'ns3::Ptr< ns3::PcapFileWrapper >',
[param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode'), param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='65535'), param('int32_t', 'tzCorrection', default_value='0')])
[param('std::string', 'filename'), param('std::ios::openmode', 'filemode'), param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='65535'), param('int32_t', 'tzCorrection', default_value='0')])
## trace-helper.h (module 'network'): std::string ns3::PcapHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr<ns3::NetDevice> device, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromDevice',
'std::string',
@@ -4158,10 +4158,10 @@ def register_Ns3PcapFileWrapper_methods(root_module, cls):
cls.add_method('Clear',
'void',
[])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Open(std::string const & filename, std::_Ios_Openmode mode) [member function]
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Open(std::string const & filename, std::ios::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')])
[param('std::string const &', 'filename'), param('std::ios::openmode', 'mode')])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Close() [member function]
cls.add_method('Close',
'void',
@@ -7564,8 +7564,8 @@ def register_Ns3ObjectFactoryValue_methods(root_module, cls):
def register_Ns3OutputStreamWrapper_methods(root_module, cls):
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(ns3::OutputStreamWrapper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::OutputStreamWrapper const &', 'arg0')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::_Ios_Openmode filemode) [constructor]
cls.add_constructor([param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::ios::openmode filemode) [constructor]
cls.add_constructor([param('std::string', 'filename'), param('std::ios::openmode', 'filemode')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::ostream * os) [constructor]
cls.add_constructor([param('std::ostream *', 'os')])
## output-stream-wrapper.h (module 'network'): std::ostream * ns3::OutputStreamWrapper::GetStream() [member function]
@@ -7586,7 +7586,9 @@ def register_Ns3Packet_methods(root_module, cls):
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size'), param('bool', 'magic')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<ns3::Packet const> packet) [member function]
## packet.h (module 'network'): ns3::Packet::Packet(const std::string &buffer) [constructor]
cls.add_constructor([param('std::string', 'buffer')])
## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
+15 -13
View File
@@ -881,10 +881,10 @@ def register_Ns3AsciiFile_methods(root_module, cls):
'bool',
[],
is_const=True)
## ascii-file.h (module 'network'): void ns3::AsciiFile::Open(std::string const & filename, std::_Ios_Openmode mode) [member function]
## ascii-file.h (module 'network'): void ns3::AsciiFile::Open(std::string const & filename, std::ios::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')])
[param('std::string const &', 'filename'), param('std::ios::openmode', 'mode')])
## ascii-file.h (module 'network'): void ns3::AsciiFile::Close() [member function]
cls.add_method('Close',
'void',
@@ -905,10 +905,10 @@ def register_Ns3AsciiTraceHelper_methods(root_module, cls):
cls.add_constructor([param('ns3::AsciiTraceHelper const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::AsciiTraceHelper::AsciiTraceHelper() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): ns3::Ptr<ns3::OutputStreamWrapper> ns3::AsciiTraceHelper::CreateFileStream(std::string filename, std::_Ios_Openmode filemode=std::ios_base::out) [member function]
## trace-helper.h (module 'network'): ns3::Ptr<ns3::OutputStreamWrapper> ns3::AsciiTraceHelper::CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios_base::out) [member function]
cls.add_method('CreateFileStream',
'ns3::Ptr< ns3::OutputStreamWrapper >',
[param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode', default_value='std::ios_base::out')])
[param('std::string', 'filename'), param('std::ios::openmode', 'filemode', default_value='std::ios_base::out')])
## trace-helper.h (module 'network'): static void ns3::AsciiTraceHelper::DefaultDequeueSinkWithContext(ns3::Ptr<ns3::OutputStreamWrapper> file, std::string context, ns3::Ptr<ns3::Packet const> p) [member function]
cls.add_method('DefaultDequeueSinkWithContext',
'void',
@@ -3067,10 +3067,10 @@ def register_Ns3PcapFile_methods(root_module, cls):
cls.add_method('Init',
'void',
[param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='ns3::PcapFile::SNAPLEN_DEFAULT'), param('int32_t', 'timeZoneCorrection', default_value='ns3::PcapFile::ZONE_DEFAULT'), param('bool', 'swapMode', default_value='false')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Open(std::string const & filename, std::_Ios_Openmode mode) [member function]
## pcap-file.h (module 'network'): void ns3::PcapFile::Open(std::string const & filename, std::ios::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')])
[param('std::string const &', 'filename'), param('std::ios::openmode', 'mode')])
## pcap-file.h (module 'network'): void ns3::PcapFile::Read(uint8_t * const data, uint32_t maxBytes, uint32_t & tsSec, uint32_t & tsUsec, uint32_t & inclLen, uint32_t & origLen, uint32_t & readLen) [member function]
cls.add_method('Read',
'void',
@@ -3098,10 +3098,10 @@ def register_Ns3PcapHelper_methods(root_module, cls):
cls.add_constructor([param('ns3::PcapHelper const &', 'arg0')])
## trace-helper.h (module 'network'): ns3::PcapHelper::PcapHelper() [constructor]
cls.add_constructor([])
## trace-helper.h (module 'network'): ns3::Ptr<ns3::PcapFileWrapper> ns3::PcapHelper::CreateFile(std::string filename, std::_Ios_Openmode filemode, uint32_t dataLinkType, uint32_t snapLen=65535, int32_t tzCorrection=0) [member function]
## trace-helper.h (module 'network'): ns3::Ptr<ns3::PcapFileWrapper> ns3::PcapHelper::CreateFile(std::string filename, std::ios::openmode filemode, uint32_t dataLinkType, uint32_t snapLen=65535, int32_t tzCorrection=0) [member function]
cls.add_method('CreateFile',
'ns3::Ptr< ns3::PcapFileWrapper >',
[param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode'), param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='65535'), param('int32_t', 'tzCorrection', default_value='0')])
[param('std::string', 'filename'), param('std::ios::openmode', 'filemode'), param('uint32_t', 'dataLinkType'), param('uint32_t', 'snapLen', default_value='65535'), param('int32_t', 'tzCorrection', default_value='0')])
## trace-helper.h (module 'network'): std::string ns3::PcapHelper::GetFilenameFromDevice(std::string prefix, ns3::Ptr<ns3::NetDevice> device, bool useObjectNames=true) [member function]
cls.add_method('GetFilenameFromDevice',
'std::string',
@@ -4158,10 +4158,10 @@ def register_Ns3PcapFileWrapper_methods(root_module, cls):
cls.add_method('Clear',
'void',
[])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Open(std::string const & filename, std::_Ios_Openmode mode) [member function]
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Open(std::string const & filename, std::ios::openmode mode) [member function]
cls.add_method('Open',
'void',
[param('std::string const &', 'filename'), param('std::_Ios_Openmode', 'mode')])
[param('std::string const &', 'filename'), param('std::ios::openmode', 'mode')])
## pcap-file-wrapper.h (module 'network'): void ns3::PcapFileWrapper::Close() [member function]
cls.add_method('Close',
'void',
@@ -7564,8 +7564,8 @@ def register_Ns3ObjectFactoryValue_methods(root_module, cls):
def register_Ns3OutputStreamWrapper_methods(root_module, cls):
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(ns3::OutputStreamWrapper const & arg0) [copy constructor]
cls.add_constructor([param('ns3::OutputStreamWrapper const &', 'arg0')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::_Ios_Openmode filemode) [constructor]
cls.add_constructor([param('std::string', 'filename'), param('std::_Ios_Openmode', 'filemode')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::ios::openmode filemode) [constructor]
cls.add_constructor([param('std::string', 'filename'), param('std::ios::openmode', 'filemode')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::ostream * os) [constructor]
cls.add_constructor([param('std::ostream *', 'os')])
## output-stream-wrapper.h (module 'network'): std::ostream * ns3::OutputStreamWrapper::GetStream() [member function]
@@ -7586,7 +7586,9 @@ def register_Ns3Packet_methods(root_module, cls):
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size'), param('bool', 'magic')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<ns3::Packet const> packet) [member function]
## packet.h (module 'network'): ns3::Packet::Packet(const std::string &buffer) [constructor]
cls.add_constructor([param('std::string', 'buffer')])
## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
+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
@@ -39,6 +39,8 @@ class NodeContainer
{
public:
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.
@@ -54,9 +56,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.
*/
@@ -70,11 +72,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);
@@ -88,11 +90,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);
@@ -107,11 +109,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);
@@ -127,23 +129,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
@@ -158,13 +160,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
@@ -179,6 +184,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.
*
@@ -201,6 +209,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.
@@ -222,10 +232,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
@@ -237,12 +251,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
@@ -275,12 +289,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.
+36 -1
View File
@@ -250,6 +250,13 @@ public:
*/
void Write (Iterator start, Iterator end);
/**
* \return the byte read in the buffer.
*
* Read data, but do not advance the Iterator read.
*/
inline uint8_t PeekU8 (void);
/**
* \return the byte read in the buffer.
*
@@ -334,11 +341,21 @@ public:
* \param size number of bytes to copy
*
* Copy size bytes of data from the internal buffer to the
* input buffer and avance the Iterator by the number of
* input buffer and advance the Iterator by the number of
* bytes read.
*/
void Read (uint8_t *buffer, uint32_t size);
/**
* \param start start iterator of the buffer to copy data into
* \param size number of bytes to copy
*
* Copy size bytes of data from the internal buffer to the input buffer via
* the provided iterator and advance the Iterator by the number of bytes
* read.
*/
inline void Read (Iterator start, uint32_t size);
/**
* \brief Calculate the checksum.
* \param size size of the buffer.
@@ -815,6 +832,14 @@ Buffer::Iterator::ReadNtohU32 (void)
return retval;
}
uint8_t
Buffer::Iterator::PeekU8 (void)
{
uint8_t ret = ReadU8 ();
Prev ();
return ret;
}
uint8_t
Buffer::Iterator::ReadU8 (void)
{
@@ -853,6 +878,16 @@ Buffer::Iterator::ReadU16 (void)
return data;
}
void
Buffer::Iterator::Read (Buffer::Iterator start, uint32_t size)
{
Buffer::Iterator end = *this;
end.Next (size);
start.Write (*this, end);
}
Buffer::Buffer (Buffer const&o)
: m_data (o.m_data),
m_maxZeroAreaStart (o.m_zeroAreaStart),
+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),
+11
View File
@@ -242,6 +242,17 @@ public:
* \param size the size of the input buffer.
*/
Packet (uint8_t const*buffer, uint32_t size);
/**
* 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.
@@ -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
@@ -607,6 +607,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;
@@ -619,6 +620,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!");
}
@@ -80,6 +80,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], 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::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
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::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::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::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
@@ -91,7 +93,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]
@@ -223,6 +225,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
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__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
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__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'])
@@ -1494,6 +1497,18 @@ def register_Ns3SimpleRefCount__Ns3CallbackImplBase_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__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1701,11 +1716,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 >',
@@ -1740,6 +1750,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]
@@ -1760,6 +1772,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 >',
@@ -1770,6 +1787,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 >',
@@ -1784,6 +1806,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):
@@ -1974,11 +2000,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]
@@ -2364,11 +2385,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]
@@ -2379,11 +2395,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]
@@ -80,6 +80,8 @@ def register_types(module):
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], 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::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
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::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::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::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
@@ -91,7 +93,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]
@@ -223,6 +225,7 @@ def register_methods(root_module):
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
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__Ns3TopologyReader_Ns3Empty_Ns3DefaultDeleter__lt__ns3TopologyReader__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TopologyReader, ns3::empty, ns3::DefaultDeleter<ns3::TopologyReader> >'])
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__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'])
@@ -1494,6 +1497,18 @@ def register_Ns3SimpleRefCount__Ns3CallbackImplBase_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__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount() [constructor]
cls.add_constructor([])
@@ -1701,11 +1716,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 >',
@@ -1740,6 +1750,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]
@@ -1760,6 +1772,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 >',
@@ -1770,6 +1787,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 >',
@@ -1784,6 +1806,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):
@@ -1974,11 +2000,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]
@@ -2364,11 +2385,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]
@@ -2379,11 +2395,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_inFile = CreateObject<OrbisTopologyReader> ();
m_inFile = Create<OrbisTopologyReader> ();
}
else if (m_fileType == "Inet")
{
NS_LOG_INFO ("Creating Inet formatted data input.");
m_inFile = CreateObject<InetTopologyReader> ();
m_inFile = Create<InetTopologyReader> ();
}
else if (m_fileType == "Rocketfuel")
{
NS_LOG_INFO ("Creating Rocketfuel formatted data input.");
m_inFile = CreateObject<RocketfuelTopologyReader> ();
m_inFile = 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,7 +47,7 @@ namespace ns3 {
class InetTopologyReader : public TopologyReader
{
public:
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,7 +44,7 @@ namespace ns3 {
class OrbisTopologyReader : public TopologyReader
{
public:
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,7 +42,7 @@ namespace ns3 {
class RocketfuelTopologyReader : public TopologyReader
{
public:
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
{
+34 -12
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:
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;
Ptr< Node > m_fromPtr;
std::string m_toName;
Ptr< Node > m_toPtr;
std::map<std::string, std::string> m_linkAttr;
Ptr< NetDevice > m_fromNetDevice;
Ptr< NetDevice > m_toNetDevice;
std::map<std::string, std::string > m_linkAttr;
};
/**
@@ -135,7 +156,7 @@ private:
*/
typedef std::list< Link >::const_iterator ConstLinksIterator;
static TypeId GetTypeId (void);
// static TypeId GetTypeId (void);
TopologyReader ();
virtual ~TopologyReader ();
@@ -195,13 +216,14 @@ private:
*/
void AddLink (Link link);
protected:
std::string m_fileName;
std::list<Link> m_linksList;
private:
TopologyReader (const TopologyReader&);
TopologyReader& operator= (const TopologyReader&);
std::string m_fileName;
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,85 @@
import gtk
import ns.core
import ns.network
import ns.internet
import ns.ndnSIM
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 = ns.ndnSIM.ndn.ContentStore.GetContentStore (self.node)
if ndnCs is None:
return
self.table_model.clear()
values = []
item = ndnCs.Begin ()
while (item != ndnCs.End ()):
values.append (str(item.GetName ()))
item = ndnCs.Next (item)
for value in sorted(values):
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, value)
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,90 @@
import gtk
import ns.core
import ns.network
import ns.internet
import ns.ndnSIM
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 = ns.ndnSIM.ndn.Fib.GetFib (self.node)
if ndnFib is None:
return
self.table_model.clear()
item = ndnFib.Begin ()
while (item != ndnFib.End ()):
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, str(item.GetPrefix()),
self.COLUMN_FACE, str(item))
item = ndnFib.Next (item)
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,90 @@
import gtk
import ns.core
import ns.network
import ns.internet
import ns.ndnSIM
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 = ns.ndnSIM.ndn.Pit.GetPit (self.node)
if ndnPit is None:
return
self.table_model.clear()
item = ndnPit.Begin ()
while (item != ndnPit.End ()):
tree_iter = self.table_model.append()
self.table_model.set(tree_iter,
self.COLUMN_PREFIX, str(item.GetPrefix()),
self.COLUMN_FACE, str(item))
item = ndnPit.Next (item)
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)
@@ -0,0 +1,91 @@
# import gtk
# import ns.core
# import ns.network
# import ns.internet
# import ns.ndnSIM
# from visualizer.base import InformationWindow
# class ShowNdnPitQueue(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 = ns.ndnSIM.ndn.Pit.GetPit (self.node)
# if ndnPit is None:
# return
# self.table_model.clear()
# item = ndnPit.Begin ()
# while (item != ndnPit.End ()):
# if (item.GetOutgoingCount () == 0):
# tree_iter = self.table_model.append()
# self.table_model.set(tree_iter,
# self.COLUMN_PREFIX, str(item.GetPrefix()),
# self.COLUMN_FACE, str(item))
# item = ndnPit.Next (item)
# def populate_node_menu(viz, node, menu):
# menu_item = gtk.MenuItem("Show NDN PIT queue")
# menu_item.show()
# def _show_ndn_pit_queue(dummy_menu_item):
# ShowNdnPitQueue(viz, node.node_index)
# menu_item.connect("activate", _show_ndn_pit_queue)
# menu.add(menu_item)
# def register(viz):
# viz.connect("populate-node-menu", populate_node_menu)
@@ -0,0 +1,207 @@
# import gobject
# import gtk
# import ns.core
# import ns.network
# import ns.visualizer
# from visualizer.base import InformationWindow
# from visualizer.higcontainer import HIGContainer
# from kiwi.ui.objectlist import ObjectList, Column
# class ShowLastInterests(InformationWindow):
# class PacketList(gtk.ScrolledWindow):
# (
# COLUMN_TIME,
# COLUMN_INTERFACE,
# COLUMN_CONTENTS,
# ) = range(3)
# def __init__(self):
# super(ShowLastInterests.PacketList, self).__init__()
# self.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
# vscrollbar_policy=gtk.POLICY_AUTOMATIC)
# self.table_model = gtk.ListStore(*([str]*3))
# treeview = gtk.TreeView(self.table_model)
# treeview.show()
# self.add(treeview)
# def add_column(descr, colid):
# column = gtk.TreeViewColumn(descr, gtk.CellRendererText(), text=colid)
# treeview.append_column(column)
# add_column("Time", self.COLUMN_TIME)
# add_column("Interface", self.COLUMN_INTERFACE)
# add_column("Contents", self.COLUMN_CONTENTS)
# def update(self, node, packet_list):
# self.table_model.clear()
# for sample in packet_list:
# if sample.device is None:
# interface_name = "(unknown)"
# else:
# interface_name = ns.core.Names.FindName(sample.device)
# if not interface_name:
# interface_name = "%i" % sample.device.GetIfIndex()
# newpkt = sample.packet.Copy ()
# pppHeader = ns.point_to_point.PppHeader()
# newpkt.RemoveHeader (pppHeader)
# int nano@nano-VirtualBox:~/ChronoChat$ ./waf configureSetting top to : /home/nano/ChronoChat
# Setting out to : /home/nano/ChronoChat/build
# Checking for 'gcc' (c compiler) : /usr/bin/gcc
# Checking for 'g++' (c++ compiler) : /usr/bin/g++
# Checking allowed flags for c++ compiler :
# Checking for program pkg-config : /usr/bin/pkg-config
# Checking for 'libsync' : yes
# Checking for 'protobuf' : yes
# Checking for program protoc : /usr/bin/protoc
# Checking for program qmake-qt4 : /usr/bin/qmake-qt4
# Checking for program qmake4 : not found
# Checking for program qmake : /usr/bin/qmake
# Checking for program uic-qt3 : not found
# Checking for program uic3 : /usr/bin/uic3
# Checking for program uic-qt4 : /usr/bin/uic-qt4
# Checking for uic version : version 4.8.1
# Checking for program moc-qt4 : /usr/bin/moc-qt4
# Checking for program rcc : /usr/bin/rcc
# Checking for program lrelease-qt4 : /usr/bin/lrelease-qt4
# Checking for program lupdate-qt4 : /usr/bin/lupdate-qt4
# Found the Qt4 libraries in : /usr/lib/i386-linux-gnu
# Checking for pkg-config version >= '0.1' : yes
# Checking for 'QtCore_debug' : not found
# Checking for 'QtGui_debug' : not found
# Checking for 'QtUiTools_debug' : not found
# Checking for 'QtNetwork_debug' : not found
# Checking for 'QtOpenGL_debug' : not found
# Checking for 'QtSql_debug' : not found
# Checking for 'QtSvg_debug' : not found
# Checking for 'QtTest_debug' : not found
# Checking for 'QtXml_debug' : not found
# Checking for 'QtXmlPatterns_debug' : not found
# Checking for 'QtWebKit_debug' : not found
# Checking for 'Qt3Support_debug' : not found
# Checking for 'QtHelp_debug' : not found
# Checking for 'QtScript_debug' : not found
# Checking for 'QtDeclarative_debug' : not found
# Checking for 'QtDesigner_debug' : not found
# Checking for 'QtCore' : yes
# Checking for 'QtGui' : yes
# Checking for 'QtUiTools' : yes
# Checking for 'QtNetwork' : yes
# Checking for 'QtOpenGL' : yes
# Checking for 'QtSql' : yes
# Checking for 'QtSvg' : yes
# Checking for 'QtTest' : yes
# Checking for 'QtXml' : yes
# Checking for 'QtXmlPatterns' : yes
# Checking for 'QtWebKit' : yes
# Checking for 'Qt3Support' : yes
# Checking for 'QtHelp' : yes
# Checking for 'QtScript' : yes
# Checking for 'QtDeclarative' : yes
# Checking for 'QtDesigner' : yes
# Checking boost includes : 1_48
# Checking boost libs : ok
# Checking for boost linkage : Could not link against boost libraries using supplied options
# The configuration failed
# (complete log in /home/nano/ChronoChat/build/config.log)
# trace of end of log:
# Found boost lib libboost_random-mt.a
# ok
# ----------------------------------------
# Checking for boost linkage
# ==>
# #include <boost/system/error_code.hpp>
# int main() { boost::system::error_code c; }
# <==
# [1/2] [32mqxx: build/.conf_check_968fbcee789046a8c143bb4a6e302895/test.cpp -> build/.conf_check_968fbcee789046a8c143bb4a6e302895/testbuild/test.cpp.1.o
# [0m
# from /home/nano/ChronoChat: Test does not build: Traceback (most recent call last):
# File "/home/nano/ChronoChat/.waf-1.7.11-ead76ce5682aeedc3f0cf095a369f9cf/waflib/Tools/c_config.py", line
# 459, in run_c_code
# bld.compile()
# File "/home/nano/ChronoChat/.waf-1.7.11-ead76ce5682aeedc3f0cf095a369f9cf/waflib/Build.py", line 188, in compile
# raise Errors.BuildError(self.producer.error)
# BuildError: Build failed
# Traceback (most recent call last):
# File "/home/nano/ChronoChat/.waf-1.7.11-ead76ce5682aeedc3f0cf095a369f9cf/waflib/Task.py", line 103, in process
# ret=self.run()
# File "<string>", line 12, in f
# TypeError: 'NoneType' object is not iterable
# from /home/nano/ChronoChat: The configuration failed
# erest = ns.ndnSIM.ndn.InterestHeader.GetInterest (newpkt)
# if (str(interest.GetName ()).split('/')[1] == "limit"):
# tree_iter = self.table_model.append()
# self.table_model.set(tree_iter,
# self.COLUMN_TIME, str(sample.time.GetSeconds()),
# self.COLUMN_INTERFACE, interface_name,
# self.COLUMN_CONTENTS, str(interest.GetName ())
# )
# 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.win.set_title("Last packets for node %i" % node_index)
# self.visualizer = visualizer
# self.viz_node = visualizer.get_node(node_index)
# self.node = ns.network.NodeList.GetNode(node_index)
# def smart_expand(expander, vbox):
# vbox.set_child_packing(expander, expand=True, fill=True, padding=0, pack_type=gtk.PACK_START)
# self.tx_list = self.PacketList()
# self.tx_list.show()
# self.win.vbox.add (self.tx_list)
# def update_capture_options():
# self.visualizer.simulation.lock.acquire()
# try:
# self.packet_capture_options = ns.visualizer.PyViz.PacketCaptureOptions ()
# self.packet_capture_options.mode = ns.visualizer.PyViz.PACKET_CAPTURE_FILTER_HEADERS_AND
# self.packet_capture_options.headers = [ns.ndnSIM.ndn.InterestHeader.GetTypeId ()]
# self.packet_capture_options.numLastPackets = 100
# self.visualizer.simulation.sim_helper.SetPacketCaptureOptions(
# self.node.GetId(), self.packet_capture_options)
# finally:
# self.visualizer.simulation.lock.release()
# # - options
# update_capture_options ()
# self.visualizer.add_information_window(self)
# self.win.set_default_size(600, 300)
# self.win.show()
# def _response_cb(self, win, response):
# self.win.destroy()
# self.visualizer.remove_information_window(self)
# def update(self):
# last_packets = self.visualizer.simulation.sim_helper.GetLastPackets(self.node.GetId())
# self.tx_list.update(self.node, last_packets.lastTransmittedPackets)
# def populate_node_menu(viz, node, menu):
# menu_item = gtk.MenuItem("Show Last Interests")
# menu_item.show()
# def _show_it(dummy_menu_item):
# ShowLastInterests(viz, node.node_index)
# menu_item.connect("activate", _show_it)
# 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()
+2 -2
View File
@@ -436,7 +436,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:
@@ -610,7 +610,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:
+45 -13
View File
@@ -69,7 +69,7 @@ PrintAttributes (TypeId tid, std::ostream &os)
)
{
os << reference;
}
}
os << info.checker->GetUnderlyingTypeInformation () << listLineStop << std::endl;
}
if (info.flags & TypeId::ATTR_CONSTRUCT && info.accessor->HasSetter ())
@@ -385,17 +385,20 @@ 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
<< " --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 = "";
argv++;
argc--;
while (*argv != 0)
while (argc > 0 && *argv != 0)
{
char *arg = *argv;
@@ -408,6 +411,17 @@ int main (int argc, char *argv[])
{
outputText = 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
@@ -415,6 +429,7 @@ int main (int argc, char *argv[])
return 0;
}
argv++;
argc--;
}
if (outputText)
@@ -528,6 +543,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 ();
@@ -597,19 +617,19 @@ int main (int argc, char *argv[])
<< headingStop << std::endl;
PrintAttributes (tid, std::cout);
TypeId tmp = tid.GetParent ();
while (tmp.GetParent () != tmp)
{
if (tmp.GetAttributeN () != 0)
{
TypeId tmp = tid.GetParent ();
while (tmp.GetParent () != tmp)
{
if (tmp.GetAttributeN () != 0)
{
std::cout << headingStart
<< "Attributes defined in parent class "
<< tmp.GetName ()
<< headingStop << std::endl;
PrintAttributes (tmp, std::cout);
}
tmp = tmp.GetParent ();
}
PrintAttributes (tmp, std::cout);
}
tmp = tmp.GetParent ();
}
} // Attributes
// Tracing -------------
@@ -655,6 +675,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;
@@ -680,6 +706,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;
@@ -715,7 +747,7 @@ int main (int argc, char *argv[])
<< ": " << (*i)->GetHelp () << ". Default value: " << val.Get () << "."
<< listLineStop << std::endl;
}
std::cout << listStop << std::endl
std::cout << listStop << std::endl
<< commentStop << std::endl;
Vendored
BIN
View File
Binary file not shown.
+21 -20
View File
@@ -93,35 +93,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):