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);
92 typedef void (*
Void) (void);
112 template <
typename T>
138 operator T ()
const {
157 template <
typename U>
166 template <
typename U>
302 template <
typename T>
305 return os << rhs.
Get ();
316 template <
typename T,
typename U>
320 return lhs.
Get () == rhs.
Get ();
323 template <
typename T,
typename U>
327 return lhs.
Get () == rhs;
330 template <
typename T,
typename U>
334 return lhs == rhs.
Get ();
338 template <
typename T,
typename U>
342 return lhs.
Get () != rhs.
Get ();
345 template <
typename T,
typename U>
349 return lhs.
Get () != rhs;
352 template <
typename T,
typename U>
356 return lhs != rhs.
Get ();
360 template <
typename T,
typename U>
364 return lhs.
Get () <= rhs.
Get ();
367 template <
typename T,
typename U>
371 return lhs.
Get () <= rhs;
374 template <
typename T,
typename U>
378 return lhs <= rhs.
Get ();
381 template <
typename T,
typename U>
385 return lhs.
Get () >= rhs.
Get ();
388 template <
typename T,
typename U>
392 return lhs.
Get () >= rhs;
395 template <
typename T,
typename U>
399 return lhs >= rhs.
Get ();
403 template <
typename T,
typename U>
407 return lhs.
Get () < rhs.
Get ();
410 template <
typename T,
typename U>
414 return lhs.
Get () < rhs;
417 template <
typename T,
typename U>
421 return lhs < rhs.
Get ();
424 template <
typename T,
typename U>
428 return lhs.
Get () > rhs.
Get ();
431 template <
typename T,
typename U>
435 return lhs.
Get () > rhs;
438 template <
typename T,
typename U>
442 return lhs > rhs.
Get ();
459 template <
typename T,
typename U>
463 return TracedValue<decltype(lhs.Get () + rhs.Get ())> (lhs.Get () + rhs.Get ());
466 template <
typename T,
typename U>
470 return TracedValue<decltype(lhs.Get () + rhs)> (lhs.Get () + rhs);
473 template <
typename T,
typename U>
477 return TracedValue<decltype(lhs + rhs.Get ())> (lhs + rhs.Get ());
481 template <
typename T,
typename U>
485 return TracedValue<decltype(lhs.Get () - rhs.Get ())> (lhs.Get () - rhs.Get ());
488 template <
typename T,
typename U>
492 return TracedValue<decltype(lhs.Get () - rhs)> (lhs.Get () - rhs);
495 template <
typename T,
typename U>
499 return TracedValue<decltype(lhs - rhs.Get ())> (lhs - rhs.Get ());
503 template <
typename T,
typename U>
507 return TracedValue<decltype(lhs.Get () * rhs.Get ())> (lhs.Get () * rhs.Get ());
510 template <
typename T,
typename U>
514 return TracedValue<decltype(lhs.Get () * rhs)> (lhs.Get () * rhs);
517 template <
typename T,
typename U>
521 return TracedValue<decltype(lhs + rhs.Get ())> (lhs * rhs.Get ());
525 template <
typename T,
typename U>
529 return TracedValue<decltype(lhs.Get () / rhs.Get ())> (lhs.Get () / rhs.Get ());
532 template <
typename T,
typename U>
536 return TracedValue<decltype(lhs.Get () / rhs)> (lhs.Get () / rhs);
539 template <
typename T,
typename U>
543 return TracedValue<decltype(lhs / rhs.Get ())> (lhs / rhs.Get ());
547 template <
typename T,
typename U>
551 return TracedValue<decltype(lhs.Get () % rhs.Get ())> (lhs.Get () % rhs.Get ());
554 template <
typename T,
typename U>
558 return TracedValue<decltype(lhs.Get () % rhs)> (lhs.Get () % rhs);
561 template <
typename T,
typename U>
565 return TracedValue<decltype(lhs % rhs.Get ())> (lhs % rhs.Get ());
569 template <
typename T,
typename U>
573 return TracedValue<decltype(lhs.Get () ^ rhs.Get ())> (lhs.Get () ^ rhs.Get ());
576 template <
typename T,
typename U>
580 return TracedValue<decltype(lhs.Get () ^ rhs)> (lhs.Get () ^ rhs);
583 template <
typename T,
typename U>
587 return TracedValue<decltype(lhs ^ rhs.Get ())> (lhs ^ rhs.Get ());
591 template <
typename T,
typename U>
595 return TracedValue<decltype(lhs.Get () | rhs.Get ())> (lhs.Get () | rhs.Get ());
598 template <
typename T,
typename U>
602 return TracedValue<decltype(lhs.Get () | rhs)> (lhs.Get () | rhs);
605 template <
typename T,
typename U>
609 return TracedValue<decltype(lhs | rhs.Get ())> (lhs | rhs.Get ());
613 template <
typename T,
typename U>
617 return TracedValue<decltype(lhs.Get () & rhs.Get ())> (lhs.Get () & rhs.Get ());
620 template <
typename T,
typename U>
624 return TracedValue<decltype(lhs.Get () & rhs)> (lhs.Get () & rhs);
627 template <
typename T,
typename U>
631 return TracedValue<decltype(lhs & rhs.Get ())> (lhs & rhs.Get ());
635 template <
typename T,
typename U>
639 return TracedValue<decltype(lhs.Get () << rhs.Get ())> (lhs.Get () << rhs.Get ());
642 template <
typename T,
typename U>
646 return TracedValue<decltype(lhs.Get () << rhs)> (lhs.Get () << rhs);
649 template <
typename T,
typename U>
653 return TracedValue<decltype(lhs << rhs.Get ())> (lhs << rhs.Get ());
657 template <
typename T,
typename U>
661 return TracedValue<decltype(lhs.Get () >> rhs.Get ())> (lhs.Get () >> rhs.Get ());
664 template <
typename T,
typename U>
668 return TracedValue<decltype(lhs.Get () >> rhs)> (lhs.Get () >> rhs);
671 template <
typename T,
typename U>
675 return TracedValue<decltype(lhs >> rhs.Get ())> (lhs >> rhs.Get ());
692 template <
typename T,
typename U>
702 template <
typename T,
typename U>
712 template <
typename T,
typename U>
722 template <
typename T,
typename U>
732 template <
typename T,
typename U>
742 template <
typename T,
typename U>
743 TracedValue<T> &
operator <<= (TracedValue<T> &lhs,
const U &rhs)
752 template <
typename T,
typename U>
762 template <
typename T,
typename U>
772 template <
typename T,
typename U>
782 template <
typename T,
typename U>
801 template <
typename T>
808 template <
typename T>
815 template <
typename T>
822 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.
bool operator>(const int64x64_t &lhs, const int64x64_t &rhs)
Greater operator.
int64x64_t operator+(const int64x64_t &lhs)
Unary plus operator.
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
int64x64_t operator-(const int64x64_t &lhs)
Unary negation operator (change sign operator).
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
int64x64_t & operator/=(int64x64_t &lhs, const int64x64_t &rhs)
Compound division operator.
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
int64x64_t operator!(const int64x64_t &lhs)
Logical not operator.
int64x64_t & operator*=(int64x64_t &lhs, const int64x64_t &rhs)
Compound multiplication operator.
int64x64_t & operator+=(int64x64_t &lhs, const int64x64_t &rhs)
Compound addition operator.
int64x64_t & operator-=(int64x64_t &lhs, const int64x64_t &rhs)
Compound subtraction operator.
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
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&=(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 POD.
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)
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)
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.