From 399ff3cccbebde9d8409d91a8b1cca764d4628a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Wed, 6 Mar 2024 15:24:33 +0100 Subject: [PATCH] core: Move TimerImpl to namespace internal --- src/core/model/timer-impl.h | 10 +++++----- src/core/model/timer.h | 11 ++++++++--- src/core/model/trickle-timer.h | 11 ++++++++--- src/core/model/watchdog.h | 11 ++++++++--- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/core/model/timer-impl.h b/src/core/model/timer-impl.h index a49696dbf..16bd1f63c 100644 --- a/src/core/model/timer-impl.h +++ b/src/core/model/timer-impl.h @@ -35,6 +35,9 @@ namespace ns3 { +namespace internal +{ + /** * \ingroup timer * The timer implementation underlying Timer and Watchdog. @@ -67,15 +70,10 @@ class TimerImpl virtual void Invoke() = 0; }; -} // namespace ns3 - /******************************************************************** * Implementation of TimerImpl implementation functions. ********************************************************************/ -namespace ns3 -{ - /** * \ingroup timer * \defgroup timerimpl TimerImpl Implementation @@ -210,6 +208,8 @@ TimerImpl::SetArgs(Args... args) impl->SetArguments(args...); } +} // namespace internal + } // namespace ns3 #endif /* TIMER_IMPL_H */ diff --git a/src/core/model/timer.h b/src/core/model/timer.h index 6cc78b513..2734f2f50 100644 --- a/src/core/model/timer.h +++ b/src/core/model/timer.h @@ -50,8 +50,13 @@ namespace ns3 * Timer is destroyed. */ +namespace internal +{ + class TimerImpl; +} // namespace internal + /** * \ingroup timer * \brief A simple virtual Timer class @@ -254,7 +259,7 @@ class Timer * The timer implementation, which contains the bound callback * function and arguments. */ - TimerImpl* m_impl; + internal::TimerImpl* m_impl; /** The amount of time left on the Timer while it is suspended. */ Time m_delayLeft; }; @@ -275,7 +280,7 @@ void Timer::SetFunction(FN fn) { delete m_impl; - m_impl = MakeTimerImpl(fn); + m_impl = internal::MakeTimerImpl(fn); } template @@ -283,7 +288,7 @@ void Timer::SetFunction(MEM_PTR memPtr, OBJ_PTR objPtr) { delete m_impl; - m_impl = MakeTimerImpl(memPtr, objPtr); + m_impl = internal::MakeTimerImpl(memPtr, objPtr); } template diff --git a/src/core/model/trickle-timer.h b/src/core/model/trickle-timer.h index 301e20074..d50d86786 100644 --- a/src/core/model/trickle-timer.h +++ b/src/core/model/trickle-timer.h @@ -33,8 +33,13 @@ namespace ns3 { +namespace internal +{ + class TimerImpl; +} // namespace internal + /** * \ingroup timer * \brief A Trickle Timer following \RFC{6206}. @@ -230,7 +235,7 @@ class TrickleTimer * The timer implementation, which contains the bound callback * function and arguments. */ - TimerImpl* m_impl; + internal::TimerImpl* m_impl; /** The future event scheduled to expire the timer. */ EventId m_timerExpiration; @@ -265,7 +270,7 @@ void TrickleTimer::SetFunction(FN fn) { delete m_impl; - m_impl = MakeTimerImpl(fn); + m_impl = internal::MakeTimerImpl(fn); } template @@ -273,7 +278,7 @@ void TrickleTimer::SetFunction(MEM_PTR memPtr, OBJ_PTR objPtr) { delete m_impl; - m_impl = MakeTimerImpl(memPtr, objPtr); + m_impl = internal::MakeTimerImpl(memPtr, objPtr); } template diff --git a/src/core/model/watchdog.h b/src/core/model/watchdog.h index 5ac1e259b..e3fe5eee2 100644 --- a/src/core/model/watchdog.h +++ b/src/core/model/watchdog.h @@ -31,8 +31,13 @@ namespace ns3 { +namespace internal +{ + class TimerImpl; +} // namespace internal + /** * \ingroup timer * \brief A very simple watchdog operating in virtual time. @@ -115,7 +120,7 @@ class Watchdog * The timer implementation, which contains the bound callback * function and arguments. */ - TimerImpl* m_impl; + internal::TimerImpl* m_impl; /** The future event scheduled to expire the timer. */ EventId m_event; /** The absolute time when the timer will expire. */ @@ -138,7 +143,7 @@ void Watchdog::SetFunction(FN fn) { delete m_impl; - m_impl = MakeTimerImpl(fn); + m_impl = internal::MakeTimerImpl(fn); } template @@ -146,7 +151,7 @@ void Watchdog::SetFunction(MEM_PTR memPtr, OBJ_PTR objPtr) { delete m_impl; - m_impl = MakeTimerImpl(memPtr, objPtr); + m_impl = internal::MakeTimerImpl(memPtr, objPtr); } template