diff --git a/doc/doxygen.conf b/doc/doxygen.conf index 0fd6387d5..0046d0599 100644 --- a/doc/doxygen.conf +++ b/doc/doxygen.conf @@ -262,7 +262,7 @@ TAB_SIZE = 4 ## Inferred template parameters are clear from the context: ## template void Func (T x); ## Explicit template parameters must be given at the call site: -## template void Func (void); +## template void Func (); ## which is called as ## Func (); diff --git a/doc/manual/source/attributes.rst b/doc/manual/source/attributes.rst index ebe086d0a..7b93dcb4f 100644 --- a/doc/manual/source/attributes.rst +++ b/doc/manual/source/attributes.rst @@ -155,13 +155,13 @@ a static :cpp:func:`GetTypeId ()` function call:: class Node : public Object { public: - static TypeId GetTypeId (void); + static TypeId GetTypeId (); ... This is defined in the ``node.cc`` file as follows:: TypeId - Node::GetTypeId (void) + Node::GetTypeId () { static TypeId tid = TypeId ("ns3::Node") .SetParent () @@ -359,7 +359,7 @@ the following:: class QueueBase : public Object { public: - static TypeId GetTypeId (void); + static TypeId GetTypeId (); ... private: @@ -417,7 +417,7 @@ registrations are moved into the :cpp:class:`TypeId` class; *e.g*.:: NS_OBJECT_ENSURE_REGISTERED (QueueBase); TypeId - QueueBase::GetTypeId (void) + QueueBase::GetTypeId () { static TypeId tid = TypeId ("ns3::DropTailQueue") .SetParent () @@ -871,7 +871,7 @@ This is a one-line public function declaration:: * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId (void); + static TypeId GetTypeId (); We've already introduced what a :cpp:class:`TypeId` definition will look like in the ``my-mobility.cc`` implementation file:: @@ -879,7 +879,7 @@ in the ``my-mobility.cc`` implementation file:: NS_OBJECT_ENSURE_REGISTERED (MyMobility); TypeId - MyMobility::GetTypeId (void) + MyMobility::GetTypeId () { static TypeId tid = TypeId ("ns3::MyMobility") .SetParent () @@ -1014,7 +1014,7 @@ to show how the system is extended:: class ConfigExample : public Object { public: - static TypeId GetTypeId (void) { + static TypeId GetTypeId () { static TypeId tid = TypeId ("ns3::A") .SetParent () .AddAttribute ("TestInt16", "help text", @@ -1339,5 +1339,3 @@ when you are done. Note that "launch the simulation" means to proceed with the simulation script. If GtkConfigStore has been called after ``Simulator::Run ()`` the simulation will not be started again - it will just end. - - diff --git a/doc/manual/source/callbacks.rst b/doc/manual/source/callbacks.rst index c14a05b85..2100fdc37 100644 --- a/doc/manual/source/callbacks.rst +++ b/doc/manual/source/callbacks.rst @@ -27,7 +27,7 @@ so that they can invoke methods on each other:: class B { public: - void DoSomething (void); + void DoSomething (); ... private: diff --git a/doc/manual/source/documentation.rst b/doc/manual/source/documentation.rst index bb0912858..cd3a5161d 100644 --- a/doc/manual/source/documentation.rst +++ b/doc/manual/source/documentation.rst @@ -355,12 +355,9 @@ Useful Features #. In the sub class mark inherited functions with an ordinary comment:: // Inherited methods - virtual void FooBar (void); + virtual void FooBar (); virtual int BarFoo (double baz); - Note that the signatures have to match exactly, so include the formal - argument ``(void)`` - This doesn't work for static functions; see ``GetTypeId``, below, for an example. @@ -641,7 +638,4 @@ cases is: * Register this type. * \return The object TypeId. */ - static TypeId GetTypeId (void); - - - + static TypeId GetTypeId (); diff --git a/doc/manual/source/how-to-write-tests.rst b/doc/manual/source/how-to-write-tests.rst index 4282afef0..626968a74 100644 --- a/doc/manual/source/how-to-write-tests.rst +++ b/doc/manual/source/how-to-write-tests.rst @@ -240,7 +240,7 @@ the wifi Information Elements. ... }; void - BasicMultiLinkElementTest::DoRun (void) + BasicMultiLinkElementTest::DoRun () { MultiLinkElement mle (WIFI_MAC_MGT_BEACON); // Fill in the Multi-Link Element @@ -266,4 +266,3 @@ Storing and referencing non-trivial output data Presenting your output test data ******************************** - diff --git a/doc/manual/source/new-models.rst b/doc/manual/source/new-models.rst index bb6850c99..93ded3a14 100644 --- a/doc/manual/source/new-models.rst +++ b/doc/manual/source/new-models.rst @@ -112,13 +112,13 @@ a base class and first subclass that could be posted for initial review:: ErrorModel (); virtual ~ErrorModel (); bool IsCorrupt (Ptr pkt); - void Reset (void); - void Enable (void); - void Disable (void); - bool IsEnabled (void) const; + void Reset (); + void Enable (); + void Disable (); + bool IsEnabled () const; private: virtual bool DoCorrupt (Ptr pkt) = 0; - virtual void DoReset (void) = 0; + virtual void DoReset () = 0; }; enum ErrorUnit @@ -135,14 +135,14 @@ a base class and first subclass that could be posted for initial review:: public: RateErrorModel (); virtual ~RateErrorModel (); - enum ErrorUnit GetUnit (void) const; + enum ErrorUnit GetUnit () const; void SetUnit (enum ErrorUnit error_unit); - double GetRate (void) const; + double GetRate () const; void SetRate (double rate); void SetRandomVariable (const RandomVariable &ranvar); private: virtual bool DoCorrupt (Ptr pkt); - virtual void DoReset (void); + virtual void DoReset (); }; @@ -294,7 +294,7 @@ from class Object.:: class ErrorModel : public Object { public: - static TypeId GetTypeId (void); + static TypeId GetTypeId (); ErrorModel (); virtual ~ErrorModel (); @@ -303,7 +303,7 @@ from class Object.:: class RateErrorModel : public ErrorModel { public: - static TypeId GetTypeId (void); + static TypeId GetTypeId (); RateErrorModel (); virtual ~RateErrorModel (); @@ -319,7 +319,7 @@ But we are in ``src/network/model``, so we must include it as "``#include "ns3/object.h"``". Note also that this goes outside the namespace declaration. Second, each class must implement a static public member function called -``GetTypeId (void)``. +``GetTypeId ()``. Third, it is a good idea to implement constructors and destructors rather than to let the compiler generate them, and to make the destructor virtual. In C++, @@ -337,7 +337,7 @@ file.:: NS_OBJECT_ENSURE_REGISTERED (ErrorModel); - TypeId ErrorModel::GetTypeId (void) + TypeId ErrorModel::GetTypeId () { static TypeId tid = TypeId ("ns3::ErrorModel") .SetParent () @@ -356,7 +356,7 @@ file.:: NS_OBJECT_ENSURE_REGISTERED (RateErrorModel); - TypeId RateErrorModel::GetTypeId (void) + TypeId RateErrorModel::GetTypeId () { static TypeId tid = TypeId ("ns3::RateErrorModel") .SetParent () @@ -374,7 +374,7 @@ file.:: { } -What is the ``GetTypeId (void)`` function? This function does a few things. It +What is the ``GetTypeId ()`` function? This function does a few things. It registers a unique string into the TypeId system. It establishes the hierarchy of objects in the attribute system (via ``SetParent``). It also declares that certain objects can be created via the object creation framework @@ -542,19 +542,19 @@ We declare BasicErrorModel to be a subclass of ErrorModel as follows,:: class BasicErrorModel : public ErrorModel { public: - static TypeId GetTypeId (void); + static TypeId GetTypeId (); ... private: // Implement base class pure virtual functions virtual bool DoCorrupt (Ptr p); - virtual bool DoReset (void); + virtual bool DoReset (); ... } and configure the subclass GetTypeId function by setting a unique TypeId string and setting the Parent to ErrorModel:: - TypeId RateErrorModel::GetTypeId (void) + TypeId RateErrorModel::GetTypeId () { static TypeId tid = TypeId ("ns3::RateErrorModel") .SetParent () @@ -570,4 +570,3 @@ Assert Macros Writing Unit Tests ++++++++++++++++++ - diff --git a/doc/manual/source/object-model.rst b/doc/manual/source/object-model.rst index ae79e28a6..1571e4dba 100644 --- a/doc/manual/source/object-model.rst +++ b/doc/manual/source/object-model.rst @@ -250,7 +250,7 @@ configure the attributes on those objects:: void SetTypeId (TypeId tid); void Set (std::string name, const AttributeValue &value); - Ptr Create (void) const; + Ptr Create () const; The first method allows one to use the |ns3| TypeId system to specify the type of objects created. The second allows one to set attributes on the objects to be diff --git a/doc/manual/source/random-variables.rst b/doc/manual/source/random-variables.rst index 457974692..b92aff130 100644 --- a/doc/manual/source/random-variables.rst +++ b/doc/manual/source/random-variables.rst @@ -227,13 +227,13 @@ that access the next value in the substream. * \brief Returns a random double from the underlying distribution * \return A floating point random value */ - double GetValue (void) const; + double GetValue () const; /** * \brief Returns a random integer from the underlying distribution * \return Integer cast of ::GetValue() */ - uint32_t GetInteger (void) const; + uint32_t GetInteger () const; We have already described the seeding configuration above. Different RandomVariable subclasses may have additional API. @@ -273,7 +273,7 @@ that values can be set for them through the |ns3| attribute system. An example is in the propagation models for WifiNetDevice:: TypeId - RandomPropagationDelayModel::GetTypeId (void) + RandomPropagationDelayModel::GetTypeId () { static TypeId tid = TypeId ("ns3::RandomPropagationDelayModel") .SetParent () diff --git a/doc/manual/source/test-framework.rst b/doc/manual/source/test-framework.rst index 166d8ed63..a6ff68e70 100644 --- a/doc/manual/source/test-framework.rst +++ b/doc/manual/source/test-framework.rst @@ -795,8 +795,8 @@ override also the ``DoSetup`` method. class MyTestCase : public TestCase { MyTestCase (); - virtual void DoSetup (void); - virtual void DoRun (void); + virtual void DoSetup (); + virtual void DoRun (); }; MyTestCase::MyTestCase () @@ -805,7 +805,7 @@ override also the ``DoSetup`` method. } void - MyTestCase::DoRun (void) + MyTestCase::DoRun () { NS_TEST_ASSERT_MSG_EQ (true, true, "Some failure message"); } diff --git a/doc/manual/source/tracing.rst b/doc/manual/source/tracing.rst index c27069816..32c2a5e92 100644 --- a/doc/manual/source/tracing.rst +++ b/doc/manual/source/tracing.rst @@ -139,7 +139,7 @@ made using those operators.:: class MyObject : public Object { public: - static TypeId GetTypeId (void) + static TypeId GetTypeId () { static TypeId tid = TypeId ("MyObject") .SetParent (Object::GetTypeId ()) diff --git a/doc/tutorial/source/tracing.rst b/doc/tutorial/source/tracing.rst index 963334421..599a2abed 100644 --- a/doc/tutorial/source/tracing.rst +++ b/doc/tutorial/source/tracing.rst @@ -71,7 +71,7 @@ standard output, as in:: #include ... void - SomeFunction (void) + SomeFunction () { uint32_t x = SOME_INTERESTING_VALUE; ... @@ -363,7 +363,7 @@ simple Object we can work with. class MyObject : public Object { public: - static TypeId GetTypeId (void) + static TypeId GetTypeId () { static TypeId tid = TypeId ("MyObject") .SetParent (Object::GetTypeId ()) @@ -650,7 +650,7 @@ down to the end of the file, you will see a method defined called ``NotifyCourseChange()``:: void - MobilityModel::NotifyCourseChange (void) const + MobilityModel::NotifyCourseChange () const { m_courseChangeTrace(this); } @@ -1000,7 +1000,7 @@ stuff. TracedCallback::Connect (const CallbackB ... TracedCallback::DisconnectWithoutContext ... TracedCallback::Disconnect (const Callba ... - TracedCallback::operator() (void) const ... + TracedCallback::operator() () const ... TracedCallback::operator() (T1 a1) const ... TracedCallback::operator() (T1 a1, T2 a2 ... TracedCallback::operator() (T1 a1, T2 a2 ... @@ -1324,7 +1324,7 @@ had a pointer to the ``TcpSocketBase``, we could ``TraceConnect`` to the "CongestionWindow" trace source. That's exactly what we have here; so it turns out that this line of code does exactly what we want. Let's go ahead and extract the code we need from this function -(``Ns3TcpCwndTestCase1::DoRun (void)``). If you look at this +(``Ns3TcpCwndTestCase1::DoRun ()``). If you look at this function, you will find that it looks just like an |ns3| script. It turns out that is exactly what it is. It is a script run by the test framework, so we can just pull it out and wrap it in ``main`` instead @@ -1477,11 +1477,11 @@ time. uint32_t nPackets, DataRate dataRate); private: - virtual void StartApplication (void); - virtual void StopApplication (void); + virtual void StartApplication (); + virtual void StopApplication (); - void ScheduleTx (void); - void SendPacket (void); + void ScheduleTx (); + void SendPacket (); Ptr m_socket; Address m_peer; @@ -1616,7 +1616,7 @@ what happens when ``Application::DoInitialize`` is called. Take a look at ``src/network/model/application.cc`` and you will find:: void - Application::DoInitialize (void) + Application::DoInitialize () { m_startEvent = Simulator::Schedule (m_startTime, &Application::StartApplication, this); if (m_stopTime != TimeStep (0)) @@ -1702,7 +1702,7 @@ passing it to the ``Setup`` method. :: void - MyApp::StartApplication (void) + MyApp::StartApplication () { m_running = true; m_packetsSent = 0; @@ -1731,7 +1731,7 @@ creating simulation events. :: void - MyApp::StopApplication (void) + MyApp::StopApplication () { m_running = false; @@ -1765,7 +1765,7 @@ chain of events that describes the ``Application`` behavior. :: void - MyApp::SendPacket (void) + MyApp::SendPacket () { Ptr packet = Create (m_packetSize); m_socket->Send (packet); @@ -1788,7 +1788,7 @@ decides it has sent enough. :: void - MyApp::ScheduleTx (void) + MyApp::ScheduleTx () { if (m_running) { diff --git a/src/core/examples/sample-simulator.py b/src/core/examples/sample-simulator.py index 58f2650d2..a8bb55ee7 100755 --- a/src/core/examples/sample-simulator.py +++ b/src/core/examples/sample-simulator.py @@ -47,7 +47,7 @@ ns.cppyy.cppdef(""" { public: /** Start model execution by scheduling a HandleEvent. */ - void Start (void); + void Start (); private: /** @@ -59,7 +59,7 @@ ns.cppyy.cppdef(""" }; void - MyModel::Start (void) + MyModel::Start () { Simulator::Schedule (Seconds (10.0), &MyModel::HandleEvent, @@ -92,7 +92,7 @@ ns.cppyy.cppdef(""" return MakeEvent(&RandomFunctionCpp, model); } - void CancelledFunctionCpp(void) { + void CancelledFunctionCpp() { CPyCppyy::Eval("CancelledEvent()"); } diff --git a/src/internet/doc/internet-stack.rst b/src/internet/doc/internet-stack.rst index 6fc56ff98..81700ec10 100644 --- a/src/internet/doc/internet-stack.rst +++ b/src/internet/doc/internet-stack.rst @@ -202,7 +202,7 @@ to the ``Bind ()``, ``Connect ()``, or ``Send ()`` functions may be a :cpp:class:`Ipv4Address`, :cpp:class:`Ipv6Address`, or :cpp:class:`Address`. If a :cpp:class:`Address` is passed in and contains anything other than a :cpp:class:`Ipv4Address` or :cpp:class:`Ipv6Address`, these functions will -return an error. The ``Bind (void)`` and ``Bind6 (void)`` functions bind to +return an error. The ``Bind ()`` and ``Bind6 ()`` functions bind to "0.0.0.0" and "::" respectively. The socket can also be bound to a specific NetDevice though the diff --git a/src/internet/doc/routing-overview.rst b/src/internet/doc/routing-overview.rst index 8c9bcf060..abff3b31c 100644 --- a/src/internet/doc/routing-overview.rst +++ b/src/internet/doc/routing-overview.rst @@ -472,11 +472,11 @@ found. Finally, a number of additional functions are provided to fetch and remove multicast routes:: - uint32_t GetNMulticastRoutes (void) const; + uint32_t GetNMulticastRoutes () const; Ipv4MulticastRoute *GetMulticastRoute (uint32_t i) const; - Ipv4MulticastRoute *GetDefaultMulticastRoute (void) const; + Ipv4MulticastRoute *GetDefaultMulticastRoute () const; bool RemoveMulticastRoute (Ipv4Address origin, Ipv4Address group, diff --git a/src/network/doc/error-model.rst b/src/network/doc/error-model.rst index f0758f605..871494d56 100644 --- a/src/network/doc/error-model.rst +++ b/src/network/doc/error-model.rst @@ -75,11 +75,11 @@ The base class API is as follows: * ``bool ErrorModel::IsCorrupt (Ptr pkt)``: Evaluate the packet and return true or false whether the packet should be considered errored or not. Some models could potentially alter the contents of the packet bit buffer. -* ``void ErrorModel::Reset (void)``: Reset any state. -* ``void ErrorModel::Enable (void)``: Enable the model -* ``void ErrorModel::Disble (void)``: Disable the model; IsCorrupt() will +* ``void ErrorModel::Reset ()``: Reset any state. +* ``void ErrorModel::Enable ()``: Enable the model +* ``void ErrorModel::Disble ()``: Disable the model; IsCorrupt() will always return false. -* ``bool ErrorModel::IsEnabled (void) const``: Return the enabled state +* ``bool ErrorModel::IsEnabled () const``: Return the enabled state Many |ns3| NetDevices contain attributes holding pointers to error diff --git a/src/network/doc/packets.rst b/src/network/doc/packets.rst index 6084a5b9a..870c337af 100644 --- a/src/network/doc/packets.rst +++ b/src/network/doc/packets.rst @@ -193,7 +193,7 @@ method:: * \returns the size in bytes of the packet (including the zero-filled * initial payload) */ - uint32_t GetSize (void) const; + uint32_t GetSize () const; You can also initialize a packet with a character buffer. The input data is copied and the input buffer is untouched. The constructor @@ -364,7 +364,7 @@ The Packet API for byte tags is given below.:: /** * \returns an iterator over the set of byte tags included in this packet. */ - ByteTagIterator GetByteTagIterator (void) const; + ByteTagIterator GetByteTagIterator () const; /** * \param tag the tag to search in this packet * \returns true if the requested tag type was found, false otherwise. @@ -377,7 +377,7 @@ The Packet API for byte tags is given below.:: /** * Remove all the tags stored in this packet. */ - void RemoveAllByteTags (void); + void RemoveAllByteTags (); /** * \param os output stream in which the data should be printed. @@ -420,7 +420,7 @@ The Packet API for packet tags is given below.:: /** * Remove all packet tags. */ - void RemoveAllPacketTags (void); + void RemoveAllPacketTags (); /** * \param os the stream in which we want to print data. @@ -436,7 +436,7 @@ The Packet API for packet tags is given below.:: * \returns an object which can be used to iterate over the list of * packet tags. */ - PacketTagIterator GetPacketTagIterator (void) const; + PacketTagIterator GetPacketTagIterator () const; Here is a simple example illustrating the use of tags from the code in ``src/internet/model/udp-socket-impl.cc``:: @@ -675,4 +675,3 @@ Dirty operations will always be slower than non-dirty operations, sometimes by several orders of magnitude. However, even the dirty operations have been optimized for common use-cases which means that most of the time, these operations will not trigger data copies and will thus be still very fast. - diff --git a/src/network/doc/queue.rst b/src/network/doc/queue.rst index f26338601..99a5752e9 100644 --- a/src/network/doc/queue.rst +++ b/src/network/doc/queue.rst @@ -51,9 +51,9 @@ Queue is an abstract base class and is subclassed for specific scheduling and drop policies. Subclasses need to define the following public methods: * ``bool Enqueue (Ptr item)``: Enqueue a packet -* ``Ptr Dequeue (void)``: Dequeue a packet -* ``Ptr Remove (void)``: Remove a packet -* ``Ptr Peek (void)``: Peek a packet +* ``Ptr Dequeue ()``: Dequeue a packet +* ``Ptr Remove ()``: Remove a packet +* ``Ptr Peek ()``: Peek a packet The Enqueue method does not allow to store a packet if the queue capacity is exceeded. Subclasses may also define specialized public methods. For instance, the @@ -144,4 +144,3 @@ Examples The drop-tail queue is used in several examples, such as ``examples/udp/udp-echo.cc``. - diff --git a/src/network/doc/sockets-api.rst b/src/network/doc/sockets-api.rst index 646265b9f..408520326 100644 --- a/src/network/doc/sockets-api.rst +++ b/src/network/doc/sockets-api.rst @@ -155,7 +155,7 @@ There are two basic variants of ``Send()`` and ``Recv()`` supported:: virtual int Send (Ptr p) = 0; int Send (const uint8_t* buf, uint32_t size); - Ptr Recv (void); + Ptr Recv (); int Recv (uint8_t* buf, uint32_t size); The non-Packet variants are provided for legacy API reasons. When calling @@ -223,7 +223,7 @@ The native sockets API for ns-3 provides two public methods (of the Socket base class):: void SetIpTos (uint8_t ipTos); - uint8_t GetIpTos (void) const; + uint8_t GetIpTos () const; to set and get, respectively, the type of service associated with the socket. These methods are equivalent to using the IP_TOS option of BSD sockets. @@ -278,7 +278,7 @@ The native sockets API for ns-3 provides two public methods (of the Socket base class):: void SetPriority (uint8_t priority); - uint8_t GetPriority (void) const; + uint8_t GetPriority () const; to set and get, respectively, the priority associated with the socket. These methods are equivalent to using the SO_PRIORITY option of BSD sockets. diff --git a/src/olsr/doc/olsr.rst b/src/olsr/doc/olsr.rst index b75f7d695..fa33282c1 100644 --- a/src/olsr/doc/olsr.rst +++ b/src/olsr/doc/olsr.rst @@ -98,7 +98,7 @@ has been created and unique IP addresses assigned to each node, the simulation script writer can call one of three overloaded functions with different scope to enable OLSR: ``ns3::OlsrHelper::Install (NodeContainer container)``; ``ns3::OlsrHelper::Install (Ptr -node)``; or ``ns3::OlsrHelper::InstallAll (void)`` +node)``; or ``ns3::OlsrHelper::InstallAll ()`` Attributes ++++++++++ diff --git a/src/stats/doc/probe.rst b/src/stats/doc/probe.rst index 6e900939c..684bac61e 100644 --- a/src/stats/doc/probe.rst +++ b/src/stats/doc/probe.rst @@ -168,7 +168,7 @@ The emitter's Count() function is now able to set the value for this DoubleProbe :: void - Emitter::Count (void) + Emitter::Count () { ... m_counter += 1.0; @@ -259,7 +259,7 @@ particular, two ways of emitting data are shown: :: void - Emitter::Count (void) + Emitter::Count () { NS_LOG_FUNCTION (this); NS_LOG_DEBUG ("Counting at " << Simulator::Now ().GetSeconds ()); diff --git a/src/traffic-control/doc/queue-discs.rst b/src/traffic-control/doc/queue-discs.rst index f71508972..ac21560ea 100644 --- a/src/traffic-control/doc/queue-discs.rst +++ b/src/traffic-control/doc/queue-discs.rst @@ -92,13 +92,13 @@ A C++ abstract base class, class QueueDisc, is subclassed to implement a specifi queue disc. A subclass is required to implement the following methods: * ``bool DoEnqueue (Ptr item)``: Enqueue a packet -* ``Ptr DoDequeue (void)``: Dequeue a packet -* ``bool CheckConfig (void) const``: Check if the configuration is correct -* ``void InitializeParams (void)``: Initialize queue disc parameters +* ``Ptr DoDequeue ()``: Dequeue a packet +* ``bool CheckConfig () const``: Check if the configuration is correct +* ``void InitializeParams ()``: Initialize queue disc parameters and may optionally override the default implementation of the following method: -* ``Ptr DoPeek (void) const``: Peek the next packet to extract +* ``Ptr DoPeek () const``: Peek the next packet to extract The default implementation of the ``DoPeek`` method is based on the qdisc_peek_dequeued function of the Linux kernel, which dequeues a packet and retains it in the