19 #ifndef TRACED_VALUE_H
20 #define TRACED_VALUE_H
46 #define TRACED_VALUE_DEBUG(x)
69 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);
114 template <
typename T>
168 template <
typename U>
179 template <
typename U>
326 template <
typename T>
330 return os << rhs.
Get();
341 template <
typename T,
typename U>
346 return lhs.
Get() == rhs.
Get();
350 template <
typename T,
typename U>
355 return lhs.
Get() == rhs;
359 template <
typename T,
typename U>
364 return lhs == rhs.
Get();
368 template <
typename T,
typename U>
373 return lhs.
Get() != rhs.
Get();
377 template <
typename T,
typename U>
382 return lhs.
Get() != rhs;
386 template <
typename T,
typename U>
391 return lhs != rhs.
Get();
395 template <
typename T,
typename U>
400 return lhs.
Get() <= rhs.
Get();
404 template <
typename T,
typename U>
409 return lhs.
Get() <= rhs;
413 template <
typename T,
typename U>
418 return lhs <= rhs.
Get();
422 template <
typename T,
typename U>
427 return lhs.
Get() >= rhs.
Get();
431 template <
typename T,
typename U>
436 return lhs.
Get() >= rhs;
440 template <
typename T,
typename U>
445 return lhs >= rhs.
Get();
449 template <
typename T,
typename U>
454 return lhs.
Get() < rhs.
Get();
458 template <
typename T,
typename U>
463 return lhs.
Get() < rhs;
467 template <
typename T,
typename U>
472 return lhs < rhs.
Get();
476 template <
typename T,
typename U>
481 return lhs.
Get() > rhs.
Get();
485 template <
typename T,
typename U>
490 return lhs.
Get() > rhs;
494 template <
typename T,
typename U>
499 return lhs > rhs.
Get();
515 template <
typename T,
typename U>
521 return TracedValue<decltype(lhs.Get() + rhs.Get())>(lhs.Get() + rhs.Get());
525 template <
typename T,
typename U>
530 return TracedValue<decltype(lhs.Get() + rhs)>(lhs.Get() + rhs);
534 template <
typename T,
typename U>
539 return TracedValue<decltype(lhs + rhs.Get())>(lhs + rhs.Get());
543 template <
typename T,
typename U>
549 return TracedValue<decltype(lhs.Get() - rhs.Get())>(lhs.Get() - rhs.Get());
553 template <
typename T,
typename U>
558 return TracedValue<decltype(lhs.Get() - rhs)>(lhs.Get() - rhs);
562 template <
typename T,
typename U>
567 return TracedValue<decltype(lhs - rhs.Get())>(lhs - rhs.Get());
571 template <
typename T,
typename U>
577 return TracedValue<decltype(lhs.Get() * rhs.Get())>(lhs.Get() * rhs.Get());
581 template <
typename T,
typename U>
586 return TracedValue<decltype(lhs.Get() * rhs)>(lhs.Get() * rhs);
590 template <
typename T,
typename U>
595 return TracedValue<decltype(lhs + rhs.Get())>(lhs * rhs.Get());
599 template <
typename T,
typename U>
605 return TracedValue<decltype(lhs.Get() / rhs.Get())>(lhs.Get() / rhs.Get());
609 template <
typename T,
typename U>
614 return TracedValue<decltype(lhs.Get() / rhs)>(lhs.Get() / rhs);
618 template <
typename T,
typename U>
623 return TracedValue<decltype(lhs / rhs.Get())>(lhs / rhs.Get());
627 template <
typename T,
typename U>
633 return TracedValue<decltype(lhs.Get() % rhs.Get())>(lhs.Get() % rhs.Get());
637 template <
typename T,
typename U>
642 return TracedValue<decltype(lhs.Get() % rhs)>(lhs.Get() % rhs);
646 template <
typename T,
typename U>
651 return TracedValue<decltype(lhs % rhs.Get())>(lhs % rhs.Get());
655 template <
typename T,
typename U>
661 return TracedValue<decltype(lhs.Get() ^ rhs.Get())>(lhs.Get() ^ rhs.Get());
665 template <
typename T,
typename U>
670 return TracedValue<decltype(lhs.Get() ^ rhs)>(lhs.Get() ^ rhs);
674 template <
typename T,
typename U>
679 return TracedValue<decltype(lhs ^ rhs.Get())>(lhs ^ rhs.Get());
683 template <
typename T,
typename U>
689 return TracedValue<decltype(lhs.Get() | rhs.Get())>(lhs.Get() | rhs.Get());
693 template <
typename T,
typename U>
698 return TracedValue<decltype(lhs.Get() | rhs)>(lhs.Get() | rhs);
702 template <
typename T,
typename U>
707 return TracedValue<decltype(lhs | rhs.Get())>(lhs | rhs.Get());
711 template <
typename T,
typename U>
717 return TracedValue<decltype(lhs.Get() & rhs.Get())>(lhs.Get() & rhs.Get());
721 template <
typename T,
typename U>
726 return TracedValue<decltype(lhs.Get() & rhs)>(lhs.Get() & rhs);
730 template <
typename T,
typename U>
735 return TracedValue<decltype(lhs & rhs.Get())>(lhs & rhs.Get());
739 template <
typename T,
typename U>
745 return TracedValue<decltype(lhs.Get() << rhs.Get())>(lhs.Get() << rhs.Get());
749 template <
typename T,
typename U>
754 return TracedValue<decltype(lhs.Get() << rhs)>(lhs.Get() << rhs);
758 template <
typename T,
typename U>
763 return TracedValue<decltype(lhs << rhs.Get())>(lhs << rhs.Get());
767 template <
typename T,
typename U>
773 return TracedValue<decltype(lhs.Get() >> rhs.Get())>(lhs.Get() >> rhs.Get());
777 template <
typename T,
typename U>
782 return TracedValue<decltype(lhs.Get() >> rhs)>(lhs.Get() >> rhs);
786 template <
typename T,
typename U>
791 return TracedValue<decltype(lhs >> rhs.Get())>(lhs >> rhs.Get());
808 template <
typename T,
typename U>
820 template <
typename T,
typename U>
832 template <
typename T,
typename U>
844 template <
typename T,
typename U>
856 template <
typename T,
typename U>
868 template <
typename T,
typename U>
880 template <
typename T,
typename U>
892 template <
typename T,
typename U>
904 template <
typename T,
typename U>
916 template <
typename T,
typename U>
935 template <
typename T>
944 template <
typename T>
953 template <
typename T>
962 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.
void DisconnectWithoutContext(const CallbackBase &cb)
Disconnect a Callback which was connected without context.
TracedCallback< T, T > m_cb
The connected Callback.
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--(int)
Pre/post- increment/decrement operator.
TracedValue & operator--()
Pre/post- increment/decrement operator.
TracedValue(const TracedValue &o)
Copy constructor.
void ConnectWithoutContext(const CallbackBase &cb)
Connect a Callback (without context.)
T Get() const
Get the underlying value.
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 operator++(int)
Pre/post- increment/decrement operator.
TracedValue(const TracedValue< U > &other)
Copy from a TracedValue of a compatible type.
TracedValue & operator=(const TracedValue &o)
Assignment.
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(* Void)()
TracedValue Callback signature for void.
void(* Int16)(int16_t oldValue, int16_t newValue)
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.
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
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)
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.