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 (*
Double)(
double oldValue,
double newValue);
90 typedef void (*
Void) (void);
110 template <
typename T>
133 operator T ()
const {
151 template <
typename U>
160 template <
typename U>
286 template <
typename T>
287 std::ostream& operator << (std::ostream& os, const TracedValue<T>& rhs)
289 return os<<rhs.Get ();
300 template <
typename T,
typename U>
304 return lhs.
Get () == rhs.
Get ();
307 template <
typename T,
typename U>
311 return lhs.
Get () == rhs;
314 template <
typename T,
typename U>
318 return lhs == rhs.
Get ();
322 template <
typename T,
typename U>
326 return lhs.
Get () != rhs.
Get ();
329 template <
typename T,
typename U>
333 return lhs.
Get () != rhs;
336 template <
typename T,
typename U>
340 return lhs != rhs.
Get ();
344 template <
typename T,
typename U>
348 return lhs.Get () <= rhs.Get ();
351 template <
typename T,
typename U>
352 bool operator <= (const TracedValue<T> &lhs,
const U &rhs)
355 return lhs.Get () <= rhs;
358 template <
typename T,
typename U>
359 bool operator <= (const U &lhs, const TracedValue<T> &rhs)
362 return lhs <= rhs.Get ();
365 template <
typename T,
typename U>
369 return lhs.
Get () >= rhs.
Get ();
372 template <
typename T,
typename U>
376 return lhs.
Get () >= rhs;
379 template <
typename T,
typename U>
383 return lhs >= rhs.
Get ();
387 template <
typename T,
typename U>
391 return lhs.Get () < rhs.Get ();
394 template <
typename T,
typename U>
395 bool operator < (const TracedValue<T> &lhs,
const U &rhs)
398 return lhs.Get () < rhs;
401 template <
typename T,
typename U>
402 bool operator < (const U &lhs, const TracedValue<T> &rhs)
405 return lhs < rhs.Get ();
408 template <
typename T,
typename U>
412 return lhs.
Get () > rhs.
Get ();
415 template <
typename T,
typename U>
419 return lhs.
Get () > rhs;
422 template <
typename T,
typename U>
426 return lhs > rhs.
Get ();
443 template <
typename T,
typename U>
449 template <
typename T,
typename U>
455 template <
typename T,
typename U>
462 template <
typename T,
typename U>
468 template <
typename T,
typename U>
474 template <
typename T,
typename U>
481 template <
typename T,
typename U>
487 template <
typename T,
typename U>
493 template <
typename T,
typename U>
500 template <
typename T,
typename U>
506 template <
typename T,
typename U>
512 template <
typename T,
typename U>
519 template <
typename T,
typename U>
525 template <
typename T,
typename U>
531 template <
typename T,
typename U>
538 template <
typename T,
typename U>
544 template <
typename T,
typename U>
550 template <
typename T,
typename U>
557 template <
typename T,
typename U>
563 template <
typename T,
typename U>
569 template <
typename T,
typename U>
576 template <
typename T,
typename U>
582 template <
typename T,
typename U>
588 template <
typename T,
typename U>
595 template <
typename T,
typename U>
601 template <
typename T,
typename U>
607 template <
typename T,
typename U>
614 template <
typename T,
typename U>
620 template <
typename T,
typename U>
626 template <
typename T,
typename U>
646 template <
typename T,
typename U>
655 template <
typename T,
typename U>
664 template <
typename T,
typename U>
673 template <
typename T,
typename U>
682 template <
typename T,
typename U>
691 template <
typename T,
typename U>
700 template <
typename T,
typename U>
709 template <
typename T,
typename U>
718 template <
typename T,
typename U>
727 template <
typename T,
typename U>
745 template <
typename T>
751 template <
typename T>
757 template <
typename T>
763 template <
typename T>
Boolean attribute value declarations.
Double attribute value declarations and template implementations.
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
TracedValue< T > & operator|=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
int64x64_t operator+(const int64x64_t &lhs)
Unary plus operator.
int64x64_t & operator/=(int64x64_t &lhs, const int64x64_t &rhs)
Compound division operator.
T m_v
The underlying value.
Unsigned integer attribute value declarations and template implementations.
TracedValue & operator=(const TracedValue &o)
Assignment.
int64x64_t operator-(const int64x64_t &lhs)
Unary negation operator (change sign operator).
TracedValue< T > operator&(const TracedValue< T > &lhs, const TracedValue< U > &rhs)
Infix arithmetic operator for TracedValue.
Base class for Callback class.
void Disconnect(const CallbackBase &cb, std::string path)
Disconnect a Callback which was connected with context.
void(* Uint8)(uint8_t oldValue, uint8_t newValue)
TracedValue Callback signature for POD.
int64x64_t & operator+=(int64x64_t &lhs, const int64x64_t &rhs)
Compound addition operator.
void Set(const T &v)
Set the value of the underlying variable.
Trace classes with value semantics.
T Get(void) const
Get the underlying value.
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
TracedValue(const TracedValue< U > &other)
Copy from a TracedValue of a compatable type.
void(* Int16)(int16_t oldValue, int16_t newValue)
TracedValue Callback signature for POD.
TracedValue< T > operator~(const TracedValue< T > &lhs)
Unary arithmetic operator for TracedValue.
ns3::TracedCallback declaration and template implementation.
void ConnectWithoutContext(const CallbackBase &cb)
Connect a Callback (without context.)
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
void Connect(const CallbackBase &cb, std::string path)
Connect a Callback with a context string.
TracedValue< T > operator^(const TracedValue< T > &lhs, const TracedValue< U > &rhs)
Infix arithmetic operator for TracedValue.
TracedValue()
Default constructor.
void(* Int8)(int8_t oldValue, int8_t newValue)
TracedValue Callback signature for POD.
void DisconnectWithoutContext(const CallbackBase &callback)
Remove from the chain a Callback which was connected without a context.
Enum attribute value declarations.
TracedValue & operator--()
Pre/post- increment/decrement operator.
void Disconnect(const CallbackBase &callback, std::string path)
Remove from the chain a Callback which was connected with a context.
void(* Int32)(int32_t oldValue, int32_t newValue)
TracedValue Callback signature for POD.
TracedValue(const U &other)
Copy from a variable type compatible with this underlying type.
TracedValue< T > & operator%=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
int64x64_t & operator*=(int64x64_t &lhs, const int64x64_t &rhs)
Compound multiplication operator.
TracedValue< T > & operator>>=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue< T > operator%(const TracedValue< T > &lhs, const TracedValue< U > &rhs)
Infix arithmetic operator for TracedValue.
TracedValue< T > & operator^=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
TracedValue(const T &v)
Construct from an explicit variable.
void Connect(const CallbackBase &callback, std::string path)
Append a Callback to the chain with a context.
TracedValue(const TracedValue &o)
Copy constructor.
void(* Double)(double oldValue, double newValue)
TracedValue Callback signature for POD.
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
TracedValue< T > & operator&=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
void(* Void)(void)
TracedValue Callback signature for POD.
bool operator>(const int64x64_t &lhs, const int64x64_t &rhs)
Greater operator.
bool operator==(const EventId &a, const EventId &b)
Integer attribute value declarations and template implementations.
void DisconnectWithoutContext(const CallbackBase &cb)
Disconnect a Callback which was connected without context.
#define TRACED_VALUE_DEBUG(x)
Logging macro for TracedValue.
void(* Uint16)(uint16_t oldValue, uint16_t newValue)
TracedValue Callback signature for POD.
TracedValue< T > operator|(const TracedValue< T > &lhs, const TracedValue< U > &rhs)
Infix arithmetic operator for TracedValue.
TracedValue & operator++()
Pre/post- increment/decrement operator.
void(* Uint32)(uint32_t oldValue, uint32_t newValue)
TracedValue Callback signature for POD.
TracedCallback< T, T > m_cb
The connected Callback.
int64x64_t operator!(const int64x64_t &lhs)
Logical not operator.
void(* Bool)(bool oldValue, bool newValue)
TracedValue Callback signature for POD.
int64x64_t & operator-=(int64x64_t &lhs, const int64x64_t &rhs)
Compound subtraction operator.