doc: (void)' -> ()' in documentation

This commit is contained in:
Peter D. Barnes, Jr
2022-11-16 17:09:48 -08:00
committed by Peter Barnes
parent 3557cd86ea
commit 820c029e8b
21 changed files with 79 additions and 91 deletions

View File

@@ -262,7 +262,7 @@ TAB_SIZE = 4
## Inferred template parameters are clear from the context:
## template <typename T> void Func (T x);
## Explicit template parameters must be given at the call site:
## template <typename T> void Func (void);
## template <typename T> void Func ();
## which is called as
## Func<MyClass> ();

View File

@@ -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<Object> ()
@@ -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<Queue> ()
@@ -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<MobilityModel> ()
@@ -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<Object> ()
.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.

View File

@@ -27,7 +27,7 @@ so that they can invoke methods on each other::
class B {
public:
void DoSomething (void);
void DoSomething ();
...
private:

View File

@@ -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 ();

View File

@@ -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
********************************

View File

@@ -112,13 +112,13 @@ a base class and first subclass that could be posted for initial review::
ErrorModel ();
virtual ~ErrorModel ();
bool IsCorrupt (Ptr<Packet> 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<Packet> 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<Packet> 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<Object> ()
@@ -356,7 +356,7 @@ file.::
NS_OBJECT_ENSURE_REGISTERED (RateErrorModel);
TypeId RateErrorModel::GetTypeId (void)
TypeId RateErrorModel::GetTypeId ()
{
static TypeId tid = TypeId ("ns3::RateErrorModel")
.SetParent<ErrorModel> ()
@@ -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<Packet> 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<ErrorModel> ()
@@ -570,4 +570,3 @@ Assert Macros
Writing Unit Tests
++++++++++++++++++

View File

@@ -250,7 +250,7 @@ configure the attributes on those objects::
void SetTypeId (TypeId tid);
void Set (std::string name, const AttributeValue &value);
Ptr<T> Create (void) const;
Ptr<T> 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

View File

@@ -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<PropagationDelayModel> ()

View File

@@ -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");
}

View File

@@ -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 ())

View File

@@ -71,7 +71,7 @@ standard output, as in::
#include <iostream>
...
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<T1,T2,T3,T4,T5,T6,T7,T8>::Connect (const CallbackB ...
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::DisconnectWithoutContext ...
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::Disconnect (const Callba ...
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (void) const ...
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() () const ...
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1) const ...
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::operator() (T1 a1, T2 a2 ...
TracedCallback<T1,T2,T3,T4,T5,T6,T7,T8>::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<Socket> 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> packet = Create<Packet> (m_packetSize);
m_socket->Send (packet);
@@ -1788,7 +1788,7 @@ decides it has sent enough.
::
void
MyApp::ScheduleTx (void)
MyApp::ScheduleTx ()
{
if (m_running)
{

View File

@@ -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()");
}

View File

@@ -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

View File

@@ -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,

View File

@@ -75,11 +75,11 @@ The base class API is as follows:
* ``bool ErrorModel::IsCorrupt (Ptr<Packet> 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

View File

@@ -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.

View File

@@ -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> item)``: Enqueue a packet
* ``Ptr<Item> Dequeue (void)``: Dequeue a packet
* ``Ptr<Item> Remove (void)``: Remove a packet
* ``Ptr<const Item> Peek (void)``: Peek a packet
* ``Ptr<Item> Dequeue ()``: Dequeue a packet
* ``Ptr<Item> Remove ()``: Remove a packet
* ``Ptr<const Item> 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``.

View File

@@ -155,7 +155,7 @@ There are two basic variants of ``Send()`` and ``Recv()`` supported::
virtual int Send (Ptr<Packet> p) = 0;
int Send (const uint8_t* buf, uint32_t size);
Ptr<Packet> Recv (void);
Ptr<Packet> 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.

View File

@@ -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>
node)``; or ``ns3::OlsrHelper::InstallAll (void)``
node)``; or ``ns3::OlsrHelper::InstallAll ()``
Attributes
++++++++++

View File

@@ -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 ());

View File

@@ -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<QueueDiscItem> item)``: Enqueue a packet
* ``Ptr<QueueDiscItem> DoDequeue (void)``: Dequeue a packet
* ``bool CheckConfig (void) const``: Check if the configuration is correct
* ``void InitializeParams (void)``: Initialize queue disc parameters
* ``Ptr<QueueDiscItem> 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<const QueueDiscItem> DoPeek (void) const``: Peek the next packet to extract
* ``Ptr<const QueueDiscItem> 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