From f51780101adec157194f1bf6b1e793e6669c0fc0 Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr" Date: Mon, 21 Nov 2022 11:49:30 -0800 Subject: [PATCH] doc: remove space in nested templates --- doc/manual/source/attributes.rst | 8 +++---- doc/manual/source/logging.rst | 4 ++-- doc/tutorial/source/tracing.rst | 14 +++++------ src/buildings/doc/source/buildings-user.rst | 2 +- src/internet/doc/routing-overview.rst | 2 +- src/internet/doc/tcp.rst | 26 ++++++++------------- src/lte/doc/source/lte-design.rst | 2 +- src/lte/doc/source/lte-user.rst | 2 +- src/stats/doc/statistics.rst | 2 +- src/wave/doc/wave.rst | 2 +- 10 files changed, 29 insertions(+), 35 deletions(-) diff --git a/doc/manual/source/attributes.rst b/doc/manual/source/attributes.rst index 4b5225b8e..a62c9f798 100644 --- a/doc/manual/source/attributes.rst +++ b/doc/manual/source/attributes.rst @@ -546,7 +546,7 @@ default values.:: Ptr net0 = CreateObject(); n0->AddDevice(net0); - Ptr > q = CreateObject >(); + Ptr> q = CreateObject> (); net0->AddQueue(q); At this point, we have created a single :cpp:class:`Node` (``n0``) @@ -625,7 +625,7 @@ First, we observe that we can get a pointer to the (base class) PointerValue ptr; net0->GetAttribute("TxQueue", ptr); - Ptr > txQueue = ptr.Get >(); + Ptr> txQueue = ptr.Get>(); Using the :cpp:func:`GetObject()` function, we can perform a safe downcast to a :cpp:class:`DropTailQueue`. The `NS_ASSERT` checks that the pointer is @@ -633,8 +633,8 @@ valid. :: - Ptr > dtq = txQueue->GetObject >(); - NS_ASSERT(dtq); + Ptr> dtq = txQueue->GetObject>(); + NS_ASSERT (dtq); Next, we can get the value of an attribute on this queue. We have introduced wrapper ``Value`` classes for the underlying data types, similar diff --git a/doc/manual/source/logging.rst b/doc/manual/source/logging.rst index e7ff93db6..5e581d2e7 100644 --- a/doc/manual/source/logging.rst +++ b/doc/manual/source/logging.rst @@ -355,7 +355,7 @@ In case you want to add logging statements to the methods of your template class { ... private: - std::list > m_packets; //!< the items in the queue + std::list> m_packets; //!< the items in the queue NS_LOG_TEMPLATE_DECLARE; //!< the log component }; @@ -386,7 +386,7 @@ In case you want to add logging statements to a static member template template void - NetDeviceQueue::PacketEnqueued(Ptr > queue, + NetDeviceQueue::PacketEnqueued(Ptr> queue, Ptr ndqi, uint8_t txq, Ptr item) { diff --git a/doc/tutorial/source/tracing.rst b/doc/tutorial/source/tracing.rst index 7f93b61ab..a1a349e86 100644 --- a/doc/tutorial/source/tracing.rst +++ b/doc/tutorial/source/tracing.rst @@ -635,7 +635,7 @@ variable in ``mobility-model.h`` you will find :: - TracedCallback > m_courseChangeTrace; + TracedCallback> m_courseChangeTrace; The type declaration ``TracedCallback`` identifies ``m_courseChangeTrace`` as a special list of Callbacks that can be @@ -915,7 +915,7 @@ callback will always be ``void``. The formal parameter list for a the declaration. Recall that for our current example, this is in ``mobility-model.h``, where we have previously found:: - TracedCallback > m_courseChangeTrace; + TracedCallback> m_courseChangeTrace; There is a one-to-one correspondence between the template parameter list in the declaration and the formal arguments of the callback @@ -971,7 +971,7 @@ The first thing we need to look at is the declaration of the trace source. Recall that this is in ``mobility-model.h``, where we have previously found:: - TracedCallback > m_courseChangeTrace; + TracedCallback> m_courseChangeTrace; This declaration is for a template. The template parameter is inside the angle-brackets, so we are really interested in finding out what @@ -1052,7 +1052,7 @@ This tells you that TracedCallback is a templated class. It has eight possible type parameters with default values. Go back and compare this with the declaration you are trying to understand:: - TracedCallback > m_courseChangeTrace; + TracedCallback> m_courseChangeTrace; The ``typename T1`` in the templated class declaration corresponds to the ``Ptr`` in the declaration above. All of the @@ -1084,7 +1084,7 @@ instantiated for the declaration above, the compiler will replace void TracedCallback::ConnectWithoutContext ... cb { - Callback > cb; + Callback> cb; cb.Assign(callback); m_callbackList.push_back(cb); } @@ -1115,7 +1115,7 @@ We are trying to figure out what the :: - Callback > cb; + Callback> cb; declaration means. Now we are in a position to understand that the first (non-optional) template argument, ``void``, represents the @@ -1850,7 +1850,7 @@ see that this trace source refers to ``PointToPointNetDevice::m_phyRxDropTrace``. If you then look in ``src/point-to-point/model/point-to-point-net-device.h`` for this member variable, you will find that it is declared as a -``TracedCallback >``. This should tell you that the +``TracedCallback>``. This should tell you that the callback target should be a function that returns void and takes a single parameter which is a ``Ptr`` (assuming we use ``ConnectWithoutContext``) -- just what we have above. diff --git a/src/buildings/doc/source/buildings-user.rst b/src/buildings/doc/source/buildings-user.rst index 5b495f8a9..80c426a93 100644 --- a/src/buildings/doc/source/buildings-user.rst +++ b/src/buildings/doc/source/buildings-user.rst @@ -30,7 +30,7 @@ As an example, let's create a residential 10 x 20 x 10 building:: double y_max = 20.0; double z_min = 0.0; double z_max = 10.0; - Ptr b = CreateObject (); + Ptr b = CreateObject(); b->SetBoundaries(Box(x_min, x_max, y_min, y_max, z_min, z_max)); b->SetBuildingType(Building::Residential); b->SetExtWallsType(Building::ConcreteWithWindows); diff --git a/src/internet/doc/routing-overview.rst b/src/internet/doc/routing-overview.rst index 967379156..629696f5f 100644 --- a/src/internet/doc/routing-overview.rst +++ b/src/internet/doc/routing-overview.rst @@ -272,7 +272,7 @@ be treated like a broadcast CSMA link). The GlobalRouteManager first walks the list of nodes and aggregates a GlobalRouter interface to each one as follows:: - typedef std::vector < Ptr >::iterator Iterator; + typedef std::vector>::iterator Iterator; for (Iterator i = NodeList::Begin(); i != NodeList::End(); i++) { Ptr node = *i; diff --git a/src/internet/doc/tcp.rst b/src/internet/doc/tcp.rst index eb1ea8533..ef50f9295 100644 --- a/src/internet/doc/tcp.rst +++ b/src/internet/doc/tcp.rst @@ -456,23 +456,21 @@ cwnd, 'bytes_acked' is reduced by the value of cwnd. Next, cwnd is incremented by a full-sized segment (SMSS). In contrast, in ns-3 NewReno, cwnd is increased by (1/cwnd) with a rounding off due to type casting into int. -:: - - :label: linuxrenocongavoid +.. code-block:: + :caption: Linux Reno `cwnd` update if (m_cWndCnt >= w) - { + { uint32_t delta = m_cWndCnt / w; m_cWndCnt -= delta * w; tcb->m_cWnd += delta * tcb->m_segmentSize; NS_LOG_DEBUG("Subtracting delta * w from m_cWndCnt " << delta * w); - } + } -:: - - :label: newrenocongavoid +.. code-block:: + :caption: New Reno `cwnd` update if (segmentsAcked > 0) { @@ -1842,8 +1840,7 @@ advertises a zero window. This can be accomplished by implementing the method CreateReceiverSocket, setting an Rx buffer value of 0 bytes (at line 6 of the following code): -:: - +.. code-block:: :linenos: :emphasize-lines: 6,7,8 @@ -1990,8 +1987,7 @@ we expect the persistent timer to fire before any rWnd changes. When it fires, the SENDER should send a window probe, and the receiver should reply reporting again a zero window situation. At first, we investigates on what the sender sends: -:: - +.. code-block:: :linenos: :emphasize-lines: 1,6,7,11 @@ -2024,8 +2020,7 @@ reader: edit the test, getting this value from the Attribute system), we need to check (line 6) between 6.0 and 7.0 simulated seconds that the probe is sent. Only one probe is allowed, and this is the reason for the check at line 11. -:: - +.. code-block:: :linenos: :emphasize-lines: 6,7 @@ -2077,8 +2072,7 @@ the window should be greater than zero (and precisely, set to 2500): To be sure that the sender receives the window update, we can use the Rx method: -:: - +.. code-block:: :linenos: :emphasize-lines: 5 diff --git a/src/lte/doc/source/lte-design.rst b/src/lte/doc/source/lte-design.rst index ae2a30197..9439f3f81 100644 --- a/src/lte/doc/source/lte-design.rst +++ b/src/lte/doc/source/lte-design.rst @@ -3646,7 +3646,7 @@ the following new member variables:: std::vector m_currentUlInterferenceOverloadIndicationList; - std::vector + std::vector m_currentUlHighInterferenceInformationList; EpcX2Sap::RelativeNarrowbandTxBand m_currentRelativeNarrowbandTxBand; diff --git a/src/lte/doc/source/lte-user.rst b/src/lte/doc/source/lte-user.rst index 94525a42a..05e7ee7d7 100644 --- a/src/lte/doc/source/lte-user.rst +++ b/src/lte/doc/source/lte-user.rst @@ -560,7 +560,7 @@ It is to be noted that using other means to configure the frequency used by the double y_max = 20.0; double z_min = 0.0; double z_max = 10.0; - Ptr b = CreateObject (); + Ptr b = CreateObject(); b->SetBoundaries(Box(x_min, x_max, y_min, y_max, z_min, z_max)); b->SetBuildingType(Building::Residential); b->SetExtWallsType(Building::ConcreteWithWindows); diff --git a/src/stats/doc/statistics.rst b/src/stats/doc/statistics.rst index eb1430797..50eb1f55c 100644 --- a/src/stats/doc/statistics.rst +++ b/src/stats/doc/statistics.rst @@ -192,7 +192,7 @@ The first thing to do in implementing this experiment is developing the simulati :: - Ptr > appRx = CreateObject >(); + Ptr> appRx = CreateObject>(); appRx->SetKey("receiver-rx-packets"); receiver->SetCounter(appRx); data.AddDataCalculator(appRx); diff --git a/src/wave/doc/wave.rst b/src/wave/doc/wave.rst index 468258774..b103376ee 100644 --- a/src/wave/doc/wave.rst +++ b/src/wave/doc/wave.rst @@ -527,7 +527,7 @@ From , usage is as follows: double m_gpsAccuracyNs; // array of distances (m) at which safety PDR shall be determined, // e.g. 50m, 100m, 200m, 300m, 400m, 500m, 600m, 800m, 1000m, and 1500m - std::vector m_txSafetyRanges; + std::vector m_txSafetyRanges; // used to get consistent random numbers across scenarios int64_t m_streamIndex;