20 #ifndef TRACED_VALUE_H
21 #define TRACED_VALUE_H
48 #define TRACED_VALUE_DEBUG(x)
70 namespace TracedValueCallback {
82 typedef void (*
Bool) (
bool oldValue,
bool newValue);
83 typedef void (*
Int8) (int8_t oldValue, int8_t newValue);
84 typedef void (*
Uint8) (uint8_t oldValue, uint8_t newValue);
85 typedef void (*
Int16) (int16_t oldValue, int16_t newValue);
86 typedef void (*
Uint16)(uint16_t oldValue, uint16_t newValue);
87 typedef void (*
Int32) (int32_t oldValue, int32_t newValue);
88 typedef void (*
Uint32)(uint32_t oldValue, uint32_t newValue);
89 typedef void (*
Int64) (int64_t oldValue, int64_t newValue);
90 typedef void (*
Uint64)(uint64_t oldValue, uint64_t newValue);
91 typedef void (*
Double)(
double oldValue,
double newValue);
94 typedef void (*
Void) (void);
115 template <
typename T>
141 operator T ()
const {
160 template <
typename U>
169 template <
typename U>
305 template <
typename T>
308 return os << rhs.
Get ();
319 template <
typename T,
typename U>
323 return lhs.
Get () == rhs.
Get ();
326 template <
typename T,
typename U>
330 return lhs.
Get () == rhs;
333 template <
typename T,
typename U>
337 return lhs == rhs.
Get ();
341 template <
typename T,
typename U>
345 return lhs.
Get () != rhs.
Get ();
348 template <
typename T,
typename U>
352 return lhs.
Get () != rhs;
355 template <
typename T,
typename U>
359 return lhs != rhs.
Get ();
363 template <
typename T,
typename U>
367 return lhs.
Get () <= rhs.
Get ();
370 template <
typename T,
typename U>
374 return lhs.
Get () <= rhs;
377 template <
typename T,
typename U>
381 return lhs <= rhs.
Get ();
384 template <
typename T,
typename U>
388 return lhs.
Get () >= rhs.
Get ();
391 template <
typename T,
typename U>
395 return lhs.
Get () >= rhs;
398 template <
typename T,
typename U>
402 return lhs >= rhs.
Get ();
406 template <
typename T,
typename U>
410 return lhs.
Get () < rhs.
Get ();
413 template <
typename T,
typename U>
417 return lhs.
Get () < rhs;
420 template <
typename T,
typename U>
424 return lhs < rhs.
Get ();
427 template <
typename T,
typename U>
431 return lhs.
Get () > rhs.
Get ();
434 template <
typename T,
typename U>
438 return lhs.
Get () > rhs;
441 template <
typename T,
typename U>
445 return lhs > rhs.
Get ();
462 template <
typename T,
typename U>
466 return TracedValue<decltype(lhs.Get () + rhs.Get ())> (lhs.Get () + rhs.Get ());
469 template <
typename T,
typename U>
473 return TracedValue<decltype(lhs.Get () + rhs)> (lhs.Get () + rhs);
476 template <
typename T,
typename U>
480 return TracedValue<decltype(lhs + rhs.Get ())> (lhs + rhs.Get ());
484 template <
typename T,
typename U>
488 return TracedValue<decltype(lhs.Get () - rhs.Get ())> (lhs.Get () - rhs.Get ());
491 template <
typename T,
typename U>
495 return TracedValue<decltype(lhs.Get () - rhs)> (lhs.Get () - rhs);
498 template <
typename T,
typename U>
502 return TracedValue<decltype(lhs - rhs.Get ())> (lhs - rhs.Get ());
506 template <
typename T,
typename U>
510 return TracedValue<decltype(lhs.Get () * rhs.Get ())> (lhs.Get () * rhs.Get ());
513 template <
typename T,
typename U>
517 return TracedValue<decltype(lhs.Get () * rhs)> (lhs.Get () * rhs);
520 template <
typename T,
typename U>
524 return TracedValue<decltype(lhs + rhs.Get ())> (lhs * rhs.Get ());
528 template <
typename T,
typename U>
532 return TracedValue<decltype(lhs.Get () / rhs.Get ())> (lhs.Get () / rhs.Get ());
535 template <
typename T,
typename U>
539 return TracedValue<decltype(lhs.Get () / rhs)> (lhs.Get () / rhs);
542 template <
typename T,
typename U>
546 return TracedValue<decltype(lhs / rhs.Get ())> (lhs / rhs.Get ());
550 template <
typename T,
typename U>
554 return TracedValue<decltype(lhs.Get () % rhs.Get ())> (lhs.Get () % rhs.Get ());
557 template <
typename T,
typename U>
561 return TracedValue<decltype(lhs.Get () % rhs)> (lhs.Get () % rhs);
564 template <
typename T,
typename U>
568 return TracedValue<decltype(lhs % rhs.Get ())> (lhs % rhs.Get ());
572 template <
typename T,
typename U>
576 return TracedValue<decltype(lhs.Get () ^ rhs.Get ())> (lhs.Get () ^ rhs.Get ());
579 template <
typename T,
typename U>
583 return TracedValue<decltype(lhs.Get () ^ rhs)> (lhs.Get () ^ rhs);
586 template <
typename T,
typename U>
590 return TracedValue<decltype(lhs ^ rhs.Get ())> (lhs ^ rhs.Get ());
594 template <
typename T,
typename U>
598 return TracedValue<decltype(lhs.Get () | rhs.Get ())> (lhs.Get () | rhs.Get ());
601 template <
typename T,
typename U>
605 return TracedValue<decltype(lhs.Get () | rhs)> (lhs.Get () | rhs);
608 template <
typename T,
typename U>
612 return TracedValue<decltype(lhs | rhs.Get ())> (lhs | rhs.Get ());
616 template <
typename T,
typename U>
620 return TracedValue<decltype(lhs.Get () & rhs.Get ())> (lhs.Get () & rhs.Get ());
623 template <
typename T,
typename U>
627 return TracedValue<decltype(lhs.Get () & rhs)> (lhs.Get () & rhs);
630 template <
typename T,
typename U>
634 return TracedValue<decltype(lhs & rhs.Get ())> (lhs & rhs.Get ());
638 template <
typename T,
typename U>
642 return TracedValue<decltype(lhs.Get () << rhs.Get ())> (lhs.Get () << rhs.Get ());
645 template <
typename T,
typename U>
649 return TracedValue<decltype(lhs.Get () << rhs)> (lhs.Get () << rhs);
652 template <
typename T,
typename U>
656 return TracedValue<decltype(lhs << rhs.Get ())> (lhs << rhs.Get ());
660 template <
typename T,
typename U>
664 return TracedValue<decltype(lhs.Get () >> rhs.Get ())> (lhs.Get () >> rhs.Get ());
667 template <
typename T,
typename U>
671 return TracedValue<decltype(lhs.Get () >> rhs)> (lhs.Get () >> rhs);
674 template <
typename T,
typename U>
678 return TracedValue<decltype(lhs >> rhs.Get ())> (lhs >> rhs.Get ());
695 template <
typename T,
typename U>
705 template <
typename T,
typename U>
715 template <
typename T,
typename U>
725 template <
typename T,
typename U>
735 template <
typename T,
typename U>
745 template <
typename T,
typename U>
746 TracedValue<T> &
operator <<= (TracedValue<T> &lhs,
const U &rhs)
755 template <
typename T,
typename U>
765 template <
typename T,
typename U>
775 template <
typename T,
typename U>
785 template <
typename T,
typename U>
804 template <
typename T>
811 template <
typename T>
818 template <
typename T>
825 template <
typename T>
ns3::BooleanValue attribute value declarations.
Base class for Callback class.
void Disconnect(const CallbackBase &callback, std::string path)
Remove from the chain a Callback which was connected with a context.
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
void DisconnectWithoutContext(const CallbackBase &callback)
Remove from the chain a Callback which was connected without a context.
void Connect(const CallbackBase &callback, std::string path)
Append a Callback to the chain with a context.
Trace classes with value semantics.
TracedValue(const T &v)
Construct from an explicit variable.
TracedCallback< T, T > m_cb
The connected Callback.
void DisconnectWithoutContext(const CallbackBase &cb)
Disconnect a Callback which was connected without context.
T m_v
The underlying value.
void Connect(const CallbackBase &cb, std::string path)
Connect a Callback with a context string.
void Disconnect(const CallbackBase &cb, std::string path)
Disconnect a Callback which was connected with context.
TracedValue & operator--()
Pre/post- increment/decrement operator.
TracedValue(const TracedValue &o)
Copy constructor.
void ConnectWithoutContext(const CallbackBase &cb)
Connect a Callback (without context.)
TracedValue()
Default constructor.
TracedValue & operator++()
Pre/post- increment/decrement operator.
TracedValue(const U &other)
Copy from a variable type compatible with this underlying type.
void Set(const T &v)
Set the value of the underlying variable.
TracedValue(const TracedValue< U > &other)
Copy from a TracedValue of a compatible type.
TracedValue & operator=(const TracedValue &o)
Assignment.
T Get(void) const
Get the underlying value.
ns3::DoubleValue attribute value declarations and template implementations.
ns3::EnumValue attribute value declarations.
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
int64x64_t operator-(const int64x64_t &lhs, const int64x64_t &rhs)
Subtraction operator.
int64x64_t operator+(const int64x64_t &lhs, const int64x64_t &rhs)
Addition operator.
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
bool operator>(const Length &left, const Length &right)
Check if left has a value greater than right.
TracedValue< T > & operator|=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue< T > & operator>>=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue< T > & operator^=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue< T > operator~(const TracedValue< T > &lhs)
Unary arithmetic operator for TracedValue.
auto operator^(const TracedValue< T > &lhs, const TracedValue< U > &rhs) -> TracedValue< decltype(lhs.Get() ^ rhs.Get())>
Infix arithmetic operator for TracedValue.
TracedValue< T > & operator%=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
auto operator|(const TracedValue< T > &lhs, const TracedValue< U > &rhs) -> TracedValue< decltype(lhs.Get()|rhs.Get())>
Infix arithmetic operator for TracedValue.
TracedValue< T > & operator<<=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue< T > operator!(const TracedValue< T > &lhs)
Unary arithmetic operator for TracedValue.
TracedValue< T > & operator*=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue< T > & operator&=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue< T > & operator/=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
auto operator&(const TracedValue< T > &lhs, const TracedValue< U > &rhs) -> TracedValue< decltype(lhs.Get() &rhs.Get())>
Infix arithmetic operator for TracedValue.
ns3::IntegerValue attribute value declarations and template implementations.
void(* Uint16)(uint16_t oldValue, uint16_t newValue)
TracedValue Callback signature for POD.
void(* Bool)(bool oldValue, bool newValue)
TracedValue Callback signature for POD.
void(* Int8)(int8_t oldValue, int8_t newValue)
TracedValue Callback signature for POD.
void(* Int16)(int16_t oldValue, int16_t newValue)
TracedValue Callback signature for POD.
void(* Void)(void)
TracedValue Callback signature for void.
void(* Uint8)(uint8_t oldValue, uint8_t newValue)
TracedValue Callback signature for POD.
void(* Int64)(int64_t oldValue, int64_t newValue)
TracedValue Callback signature for POD.
void(* Uint32)(uint32_t oldValue, uint32_t newValue)
TracedValue Callback signature for POD.
void(* Uint64)(uint64_t oldValue, uint64_t newValue)
TracedValue Callback signature for POD.
void(* Int32)(int32_t oldValue, int32_t newValue)
TracedValue Callback signature for POD.
void(* Double)(double oldValue, double newValue)
TracedValue Callback signature for POD.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time operator%(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
bool operator==(const EventId &a, const EventId &b)
Time & operator+=(Time &lhs, const Time &rhs)
Compound addition assignment for Time.
bool operator<(const EventId &a, const EventId &b)
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
std::istream & operator>>(std::istream &is, Angles &a)
Time & operator-=(Time &lhs, const Time &rhs)
Compound subtraction assignment for Time.
std::ostream & operator<<(std::ostream &os, const Angles &a)
ns3::TracedCallback declaration and template implementation.
#define TRACED_VALUE_DEBUG(x)
Logging macro for TracedValue.
ns3::UintegerValue attribute value declarations and template implementations.