Trace classes with value semantics. More...
#include "traced-value.h"
Public Member Functions | |
TracedValue () | |
Default constructor. More... | |
TracedValue (const T &v) | |
Construct from an explicit variable. More... | |
TracedValue (const TracedValue &o) | |
Copy constructor. More... | |
template<typename U > | |
TracedValue (const TracedValue< U > &other) | |
Copy from a TracedValue of a compatible type. More... | |
template<typename U > | |
TracedValue (const U &other) | |
Copy from a variable type compatible with this underlying type. More... | |
void | Connect (const CallbackBase &cb, std::string path) |
Connect a Callback with a context string. More... | |
void | ConnectWithoutContext (const CallbackBase &cb) |
Connect a Callback (without context.) More... | |
void | Disconnect (const CallbackBase &cb, std::string path) |
Disconnect a Callback which was connected with context. More... | |
void | DisconnectWithoutContext (const CallbackBase &cb) |
Disconnect a Callback which was connected without context. More... | |
T | Get () const |
Get the underlying value. More... | |
operator T () const | |
Cast to the underlying type. More... | |
TracedValue & | operator= (const TracedValue &o) |
Assignment. More... | |
void | Set (const T &v) |
Set the value of the underlying variable. More... | |
TracedValue & | operator++ () |
Pre/post- increment/decrement operator. More... | |
TracedValue & | operator-- () |
Pre/post- increment/decrement operator. More... | |
TracedValue | operator++ (int) |
Pre/post- increment/decrement operator. More... | |
TracedValue | operator-- (int) |
Pre/post- increment/decrement operator. More... | |
Private Attributes | |
TracedCallback< T, T > | m_cb |
The connected Callback. More... | |
T | m_v |
The underlying value. More... | |
Trace classes with value semantics.
If you want to trace the change of value of a class or primitive type which have value semantics (they must support operator !=), you can wrap them in an instance of this template. This instance will behave just like the original class (if it did not export any special method), and will define Connect/DisconnectWithoutContext methods to work with MakeTraceSourceAccessor.
T | [explicit] The type of the underlying value being traced. |
Definition at line 115 of file traced-value.h.
|
inline |
Default constructor.
Definition at line 119 of file traced-value.h.
|
inline |
|
inline |
Construct from an explicit variable.
[in] | v | The variable to trace. |
Definition at line 137 of file traced-value.h.
|
inline |
Copy from a TracedValue of a compatible type.
U | [deduced] The underlying type of the other TracedValue. |
[in] | other | The other TracedValuet to copy. |
Definition at line 169 of file traced-value.h.
|
inline |
Copy from a variable type compatible with this underlying type.
U | [deduced] Type of the other variable. |
[in] | other | The other variable to copy. |
Definition at line 180 of file traced-value.h.
|
inline |
Connect a Callback with a context string.
The context string will be provided as the first argument to the Callback function.
[in] | cb | The Callback to connect to the target trace source. |
[in] | path | The context to bind to the user callback. |
Definition at line 204 of file traced-value.h.
References ns3::TracedCallback< Ts >::Connect(), and ns3::TracedValue< T >::m_cb.
|
inline |
Connect a Callback (without context.)
[in] | cb | The callback to connect. |
Definition at line 190 of file traced-value.h.
References ns3::TracedCallback< Ts >::ConnectWithoutContext(), and ns3::TracedValue< T >::m_cb.
|
inline |
Disconnect a Callback which was connected with context.
[in] | cb | The Callback to disconnect. |
[in] | path | The context to bind to the user callback. |
Definition at line 225 of file traced-value.h.
References ns3::TracedCallback< Ts >::Disconnect(), and ns3::TracedValue< T >::m_cb.
|
inline |
Disconnect a Callback which was connected without context.
[in] | cb | The Callback to disconnect. |
Definition at line 214 of file traced-value.h.
References ns3::TracedCallback< Ts >::DisconnectWithoutContext(), and ns3::TracedValue< T >::m_cb.
|
inline |
Get the underlying value.
Definition at line 249 of file traced-value.h.
References ns3::TracedValue< T >::m_v.
Referenced by ns3::TcpDctcp::CeState1to0(), ns3::TcpNewReno::CongestionAvoidance(), ns3::TcpLedbat::CongestionAvoidance(), ns3::TcpBbr::CongestionStateSet(), ns3::TcpTxBuffer::CopyFromSequence(), ns3::TcpTxBuffer::DiscardUpTo(), ns3::TcpSocketBase::DoForwardUp(), TcpHighSpeedIncrementTest::DoRun(), TcpHtcpIncrementTest::DoRun(), TcpHyblaIncrementTest::DoRun(), TcpIllinoisTest::DoRun(), ns3::TcpLpToNewReno::DoRun(), ns3::TcpLpInferenceTest1::DoRun(), ns3::TcpLpInferenceTest2::DoRun(), PrrRecoveryTest::DoRun(), TcpScalableIncrementTest::DoRun(), TcpVegasTest::DoRun(), TcpVenoTest::DoRun(), TcpYeahIncrementTest::DoRun(), ns3::TcpSocketBase::EstimateRtt(), TcpBicIncrementTest::ExecuteTest(), TcpDctcpToLinuxReno::ExecuteTest(), TcpLedbatToNewReno::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), ns3::TcpClassicRecovery::ExitRecovery(), ns3::TcpSocketBase::GetHighRxAck(), ns3::TcpSocketBase::GetRWnd(), ns3::TcpBbr::HandleProbeRTT(), ns3::TcpBbr::HandleRestartFromIdle(), ns3::TcpLedbat::IncreaseWindow(), ns3::QueueBase::IsEmpty(), ns3::TcpBbr::ModulateCwndForProbeRTT(), ns3::TcpBbr::ModulateCwndForRecovery(), ns3::TcpSocketBase::NewAck(), TcpVenoTest::NewReno_CongestionAvoidance(), ns3::operator!(), ns3::operator!=(), ns3::operator%=(), ns3::operator&=(), ns3::operator*=(), ns3::operator+(), ns3::TracedValue< T >::operator++(), ns3::operator+=(), ns3::operator-(), ns3::TracedValue< T >::operator--(), ns3::operator-=(), ns3::operator/=(), ns3::operator<(), ns3::operator<<(), ns3::operator<=(), ns3::operator==(), ns3::operator>(), ns3::operator>=(), ns3::operator>>=(), ns3::operator^=(), ns3::operator|=(), ns3::operator~(), ns3::TcpLp::PktsAcked(), ns3::TcpSocketBase::ProcessAck(), ns3::TcpSocketBase::ReceivedAck(), ns3::TcpBbr::RestoreCwnd(), ns3::TcpSocketBase::ReTxTimeout(), ns3::TcpSocketBase::SendDataPacket(), TcpDctcpCongestedRouter::SendDataPacket(), ns3::TcpSocketCongestedRouter::SendDataPacket(), ns3::TcpSocketBase::SendEmptyPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::TcpSocketBase::SendPendingData(), ns3::TcpBbr::SetCwnd(), ns3::TcpBbr::UpdateAckAggregation(), ns3::TcpSocketBase::UpdatePacingRate(), and ns3::TcpSocketBase::Window().
|
inline |
Cast to the underlying type.
Definition at line 146 of file traced-value.h.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 261 of file traced-value.h.
References ns3::TracedValue< T >::Get(), ns3::TracedValue< T >::Set(), and TRACED_VALUE_DEBUG.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 279 of file traced-value.h.
References ns3::TracedValue< T >::Get(), ns3::TracedValue< T >::Set(), and TRACED_VALUE_DEBUG.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 270 of file traced-value.h.
References ns3::TracedValue< T >::Get(), ns3::TracedValue< T >::Set(), and TRACED_VALUE_DEBUG.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 289 of file traced-value.h.
References ns3::TracedValue< T >::Get(), ns3::TracedValue< T >::Set(), and TRACED_VALUE_DEBUG.
|
inline |
Assignment.
[in] | o | The value to assign to this instance. |
Definition at line 156 of file traced-value.h.
References ns3::TracedValue< T >::m_v, ns3::TracedValue< T >::Set(), and TRACED_VALUE_DEBUG.
|
inline |
Set the value of the underlying variable.
If the new value differs from the old, the Callback will be invoked.
[in] | v | The new value. |
Definition at line 236 of file traced-value.h.
References ns3::TracedValue< T >::m_cb, and ns3::TracedValue< T >::m_v.
Referenced by ns3::operator%=(), ns3::operator&=(), ns3::operator*=(), ns3::TracedValue< T >::operator++(), ns3::operator+=(), ns3::TracedValue< T >::operator--(), ns3::operator-=(), ns3::operator/=(), ns3::TracedValue< T >::operator=(), ns3::operator>>=(), ns3::operator^=(), and ns3::operator|=().
|
private |
The connected Callback.
Definition at line 305 of file traced-value.h.
Referenced by ns3::TracedValue< T >::Connect(), ns3::TracedValue< T >::ConnectWithoutContext(), ns3::TracedValue< T >::Disconnect(), ns3::TracedValue< T >::DisconnectWithoutContext(), and ns3::TracedValue< T >::Set().
|
private |
The underlying value.
Definition at line 303 of file traced-value.h.
Referenced by ns3::TracedValue< T >::Get(), ns3::TracedValue< bool >::operator bool(), ns3::TracedValue< T >::operator=(), and ns3::TracedValue< T >::Set().