Trace classes with value semantics. More...
#include "traced-value.h"
Public Member Functions | |
TracedValue () | |
Default constructor. More... | |
TracedValue (const TracedValue &o) | |
Copy constructor. More... | |
TracedValue (const T &v) | |
Construct from an explicit variable. 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 (void) 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 111 of file traced-value.h.
|
inline |
Default constructor.
Definition at line 115 of file traced-value.h.
|
inline |
|
inline |
Construct from an explicit variable.
[in] | v | The variable to trace. |
Definition at line 127 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 152 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 161 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 181 of file traced-value.h.
|
inline |
Connect a Callback (without context.)
[in] | cb | The callback to connect. |
Definition at line 169 of file traced-value.h.
|
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 198 of file traced-value.h.
|
inline |
Disconnect a Callback which was connected without context.
[in] | cb | The Callback to disconnect. |
Definition at line 189 of file traced-value.h.
|
inline |
Get the underlying value.
Definition at line 218 of file traced-value.h.
Referenced by ns3::TcpLedbat::CongestionAvoidance(), ns3::TcpNewReno::CongestionAvoidance(), ns3::TcpTxBuffer::CopyFromSequence(), ns3::TcpTxBuffer::DiscardUpTo(), ns3::TcpSocketBase::DoForwardUp(), TcpHighSpeedIncrementTest::DoRun(), TcpHyblaIncrementTest::DoRun(), TcpScalableIncrementTest::DoRun(), TcpHtcpIncrementTest::DoRun(), TcpVegasTest::DoRun(), TcpVenoTest::DoRun(), PrrRecoveryTest::DoRun(), TcpYeahIncrementTest::DoRun(), TcpIllinoisTest::DoRun(), ns3::TcpSocketBase::EstimateRtt(), ns3::TcpLpToNewReno::ExecuteTest(), TcpLedbatToNewReno::ExecuteTest(), TcpBicIncrementTest::ExecuteTest(), ns3::TcpLpInferenceTest1::ExecuteTest(), TcpLedbatIncrementTest::ExecuteTest(), ns3::TcpLpInferenceTest2::ExecuteTest(), TcpLedbatDecrementTest::ExecuteTest(), ns3::TcpPrrRecovery::ExitRecovery(), ns3::TcpClassicRecovery::ExitRecovery(), ns3::GetCongStateFrom(), ns3::TcpLedbat::IncreaseWindow(), ns3::QueueBase::IsEmpty(), ns3::TcpSocketBase::NewAck(), TcpVenoTest::NewReno_CongestionAvoidance(), ns3::operator!(), ns3::operator!=(), ns3::operator%=(), ns3::operator&=(), ns3::operator*=(), ns3::operator+(), ns3::TracedValue< uint64_t >::operator++(), ns3::operator+=(), ns3::operator-(), ns3::TracedValue< uint64_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::TcpLp::PktsAcked(), ns3::TcpSocketBase::ReTxTimeout(), ns3::TcpSocketCongestedRouter::SendDataPacket(), ns3::TcpSocketBase::SendDataPacket(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::TcpSocketBase::SendEmptyPacket(), ns3::TcpSocketBase::SendPendingData(), and ns3::TcpSocketBase::Window().
|
inline |
Cast to the underlying type.
Definition at line 133 of file traced-value.h.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 228 of file traced-value.h.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 242 of file traced-value.h.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 235 of file traced-value.h.
|
inline |
Pre/post- increment/decrement operator.
This invokes the Callback.
Definition at line 250 of file traced-value.h.
|
inline |
Assignment.
[in] | o | The value to assign to this instance. |
Definition at line 141 of file traced-value.h.
|
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 207 of file traced-value.h.
Referenced by ns3::operator%=(), ns3::operator&=(), ns3::operator*=(), ns3::TracedValue< uint64_t >::operator++(), ns3::operator+=(), ns3::TracedValue< uint64_t >::operator--(), ns3::operator-=(), ns3::operator/=(), ns3::operator<<=(), ns3::TracedValue< uint64_t >::operator=(), ns3::operator>>=(), ns3::operator^=(), and ns3::operator|=().
|
private |
The connected Callback.
Definition at line 264 of file traced-value.h.
Referenced by ns3::TracedValue< uint64_t >::Connect(), ns3::TracedValue< uint64_t >::ConnectWithoutContext(), ns3::TracedValue< uint64_t >::Disconnect(), ns3::TracedValue< uint64_t >::DisconnectWithoutContext(), and ns3::TracedValue< uint64_t >::Set().
|
private |
The underlying value.
Definition at line 262 of file traced-value.h.
Referenced by ns3::TracedValue< uint64_t >::Get(), ns3::TracedValue< ValueClassTest >::operator ValueClassTest(), ns3::TracedValue< uint64_t >::operator=(), and ns3::TracedValue< uint64_t >::Set().