A Discrete-Event Network Simulator
API
traced-value.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006,2007 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef TRACED_VALUE_H
21 #define TRACED_VALUE_H
22 
23 #include "traced-callback.h"
24 #include "integer.h"
25 #include "uinteger.h"
26 #include "boolean.h"
27 #include "double.h"
28 #include "enum.h"
29 
48 #define TRACED_VALUE_DEBUG(x)
49 
50 namespace ns3 {
51 
70 namespace TracedValueCallback {
71 
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);
92 } // namespace TracedValueCallback
93 
94 
110 template <typename T>
112 {
113 public:
116  : m_v ()
117  {}
123  : m_v (o.m_v)
124  {}
129  TracedValue (const T &v)
130  : m_v (v)
131  {}
136  operator T () const {
137  return m_v;
138  }
145  {
146  TRACED_VALUE_DEBUG ("x=");
147  Set (o.m_v);
148  return *this;
149  }
155  template <typename U>
157  : m_v (other.Get ())
158  {}
164  template <typename U>
165  TracedValue (const U &other)
166  : m_v ((T)other)
167  {}
174  {
176  }
186  void Connect (const CallbackBase &cb, std::string path)
187  {
188  m_cb.Connect (cb, path);
189  }
196  {
198  }
205  void Disconnect (const CallbackBase &cb, std::string path)
206  {
207  m_cb.Disconnect (cb, path);
208  }
215  void Set (const T &v)
216  {
217  if (m_v != v)
218  {
219  m_cb (m_v, v);
220  m_v = v;
221  }
222  }
227  T Get (void) const
228  {
229  return m_v;
230  }
239  {
240  TRACED_VALUE_DEBUG ("++x");
241  T tmp = Get ();
242  ++tmp;
243  Set (tmp);
244  return *this;
245  }
247  {
248  TRACED_VALUE_DEBUG ("--x");
249  T tmp = Get ();
250  --tmp;
251  Set (tmp);
252  return *this;
253  }
255  {
256  TRACED_VALUE_DEBUG ("x++");
257  TracedValue old (*this);
258  T tmp = Get ();
259  tmp++;
260  Set (tmp);
261  return old;
262  }
264  {
265  TRACED_VALUE_DEBUG ("x--");
266  TracedValue old (*this);
267  T tmp = Get ();
268  tmp--;
269  Set (tmp);
270  return old;
271  }
274 private:
276  T m_v;
279 };
280 
281 
282 /********************************************************************
283  Operator implementations for TracedValue
284  ********************************************************************/
285 
300 template <typename T>
301 std::ostream& operator << (std::ostream& os, const TracedValue<T>& rhs)
302 {
303  return os << rhs.Get ();
304 }
305 
314 template <typename T, typename U>
315 bool operator == (const TracedValue<T> &lhs, const TracedValue<U> &rhs)
316 {
317  TRACED_VALUE_DEBUG ("x==x");
318  return lhs.Get () == rhs.Get ();
319 }
321 template <typename T, typename U>
322 bool operator == (const TracedValue<T> &lhs, const U &rhs)
323 {
324  TRACED_VALUE_DEBUG ("x==");
325  return lhs.Get () == rhs;
326 }
328 template <typename T, typename U>
329 bool operator == (const U &lhs, const TracedValue<T> &rhs)
330 {
331  TRACED_VALUE_DEBUG ("==x");
332  return lhs == rhs.Get ();
333 }
334 
336 template <typename T, typename U>
337 bool operator != (const TracedValue<T> &lhs, const TracedValue<U> &rhs)
338 {
339  TRACED_VALUE_DEBUG ("x!=x");
340  return lhs.Get () != rhs.Get ();
341 }
343 template <typename T, typename U>
344 bool operator != (const TracedValue<T> &lhs, const U &rhs)
345 {
346  TRACED_VALUE_DEBUG ("x!=");
347  return lhs.Get () != rhs;
348 }
350 template <typename T, typename U>
351 bool operator != (const U &lhs, const TracedValue<T> &rhs)
352 {
353  TRACED_VALUE_DEBUG ("!=x");
354  return lhs != rhs.Get ();
355 }
356 
358 template <typename T, typename U>
359 bool operator <= (const TracedValue<T> &lhs, const TracedValue<U> &rhs)
360 {
361  TRACED_VALUE_DEBUG ("x<=x");
362  return lhs.Get () <= rhs.Get ();
363 }
365 template <typename T, typename U>
366 bool operator <= (const TracedValue<T> &lhs, const U &rhs)
367 {
368  TRACED_VALUE_DEBUG ("x<=");
369  return lhs.Get () <= rhs;
370 }
372 template <typename T, typename U>
373 bool operator <= (const U &lhs, const TracedValue<T> &rhs)
374 {
375  TRACED_VALUE_DEBUG ("<=x");
376  return lhs <= rhs.Get ();
377 }
379 template <typename T, typename U>
380 bool operator >= (const TracedValue<T> &lhs, const TracedValue<U> &rhs)
381 {
382  TRACED_VALUE_DEBUG ("x>=x");
383  return lhs.Get () >= rhs.Get ();
384 }
386 template <typename T, typename U>
387 bool operator >= (const TracedValue<T> &lhs, const U &rhs)
388 {
389  TRACED_VALUE_DEBUG ("x>=");
390  return lhs.Get () >= rhs;
391 }
393 template <typename T, typename U>
394 bool operator >= (const U &lhs, const TracedValue<T> &rhs)
395 {
396  TRACED_VALUE_DEBUG (">=x");
397  return lhs >= rhs.Get ();
398 }
399 
401 template <typename T, typename U>
402 bool operator < (const TracedValue<T> &lhs, const TracedValue<U> &rhs)
403 {
404  TRACED_VALUE_DEBUG ("x<x");
405  return lhs.Get () < rhs.Get ();
406 }
408 template <typename T, typename U>
409 bool operator < (const TracedValue<T> &lhs, const U &rhs)
410 {
411  TRACED_VALUE_DEBUG ("x<");
412  return lhs.Get () < rhs;
413 }
415 template <typename T, typename U>
416 bool operator < (const U &lhs, const TracedValue<T> &rhs)
417 {
418  TRACED_VALUE_DEBUG ("<x");
419  return lhs < rhs.Get ();
420 }
422 template <typename T, typename U>
423 bool operator > (const TracedValue<T> &lhs, const TracedValue<U> &rhs)
424 {
425  TRACED_VALUE_DEBUG ("x>x");
426  return lhs.Get () > rhs.Get ();
427 }
429 template <typename T, typename U>
430 bool operator > (const TracedValue<T> &lhs, const U &rhs)
431 {
432  TRACED_VALUE_DEBUG ("x>");
433  return lhs.Get () > rhs;
434 }
436 template <typename T, typename U>
437 bool operator > (const U &lhs, const TracedValue<T> &rhs)
438 {
439  TRACED_VALUE_DEBUG (">x");
440  return lhs > rhs.Get ();
441 }
442 
443 
457 template <typename T, typename U>
458 auto operator + (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () + rhs.Get ())>
459 {
460  TRACED_VALUE_DEBUG ("x+x");
461  return TracedValue<decltype(lhs.Get () + rhs.Get ())> (lhs.Get () + rhs.Get ());
462 }
464 template <typename T, typename U>
465 auto operator + (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () + rhs)>
466 {
467  TRACED_VALUE_DEBUG ("x+");
468  return TracedValue<decltype(lhs.Get () + rhs)> (lhs.Get () + rhs);
469 }
471 template <typename T, typename U>
472 auto operator + (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs + rhs.Get ())>
473 {
474  TRACED_VALUE_DEBUG ("+x");
475  return TracedValue<decltype(lhs + rhs.Get ())> (lhs + rhs.Get ());
476 }
477 
479 template <typename T, typename U>
480 auto operator - (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () - rhs.Get ())>
481 {
482  TRACED_VALUE_DEBUG ("x-x");
483  return TracedValue<decltype(lhs.Get () - rhs.Get ())> (lhs.Get () - rhs.Get ());
484 }
486 template <typename T, typename U>
487 auto operator - (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () - rhs)>
488 {
489  TRACED_VALUE_DEBUG ("x-");
490  return TracedValue<decltype(lhs.Get () - rhs)> (lhs.Get () - rhs);
491 }
493 template <typename T, typename U>
494 auto operator - (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs - rhs.Get ())>
495 {
496  TRACED_VALUE_DEBUG ("-x");
497  return TracedValue<decltype(lhs - rhs.Get ())> (lhs - rhs.Get ());
498 }
499 
501 template <typename T, typename U>
502 auto operator * (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () * rhs.Get ())>
503 {
504  TRACED_VALUE_DEBUG ("x*x");
505  return TracedValue<decltype(lhs.Get () * rhs.Get ())> (lhs.Get () * rhs.Get ());
506 }
508 template <typename T, typename U>
509 auto operator * (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () * rhs)>
510 {
511  TRACED_VALUE_DEBUG ("x*");
512  return TracedValue<decltype(lhs.Get () * rhs)> (lhs.Get () * rhs);
513 }
515 template <typename T, typename U>
516 auto operator * (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs + rhs.Get ())>
517 {
518  TRACED_VALUE_DEBUG ("*x");
519  return TracedValue<decltype(lhs + rhs.Get ())> (lhs * rhs.Get ());
520 }
521 
523 template <typename T, typename U>
524 auto operator / (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () / rhs.Get ())>
525 {
526  TRACED_VALUE_DEBUG ("x/x");
527  return TracedValue<decltype(lhs.Get () / rhs.Get ())> (lhs.Get () / rhs.Get ());
528 }
530 template <typename T, typename U>
531 auto operator / (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () / rhs)>
532 {
533  TRACED_VALUE_DEBUG ("x/");
534  return TracedValue<decltype(lhs.Get () / rhs)> (lhs.Get () / rhs);
535 }
537 template <typename T, typename U>
538 auto operator / (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs / rhs.Get ())>
539 {
540  TRACED_VALUE_DEBUG ("/x");
541  return TracedValue<decltype(lhs / rhs.Get ())> (lhs / rhs.Get ());
542 }
543 
545 template <typename T, typename U>
546 auto operator % (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () % rhs.Get ())>
547 {
548  TRACED_VALUE_DEBUG ("x%x");
549  return TracedValue<decltype(lhs.Get () % rhs.Get ())> (lhs.Get () % rhs.Get ());
550 }
552 template <typename T, typename U>
553 auto operator % (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () % rhs)>
554 {
555  TRACED_VALUE_DEBUG ("x%");
556  return TracedValue<decltype(lhs.Get () % rhs)> (lhs.Get () % rhs);
557 }
559 template <typename T, typename U>
560 auto operator % (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs % rhs.Get ())>
561 {
562  TRACED_VALUE_DEBUG ("%x");
563  return TracedValue<decltype(lhs % rhs.Get ())> (lhs % rhs.Get ());
564 }
565 
567 template <typename T, typename U>
568 auto operator ^ (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () ^ rhs.Get ())>
569 {
570  TRACED_VALUE_DEBUG ("x^x");
571  return TracedValue<decltype(lhs.Get () ^ rhs.Get ())> (lhs.Get () ^ rhs.Get ());
572 }
574 template <typename T, typename U>
575 auto operator ^ (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () ^ rhs)>
576 {
577  TRACED_VALUE_DEBUG ("x^");
578  return TracedValue<decltype(lhs.Get () ^ rhs)> (lhs.Get () ^ rhs);
579 }
581 template <typename T, typename U>
582 auto operator ^ (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs ^ rhs.Get ())>
583 {
584  TRACED_VALUE_DEBUG ("^x");
585  return TracedValue<decltype(lhs ^ rhs.Get ())> (lhs ^ rhs.Get ());
586 }
587 
589 template <typename T, typename U>
590 auto operator | (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () | rhs.Get ())>
591 {
592  TRACED_VALUE_DEBUG ("x|x");
593  return TracedValue<decltype(lhs.Get () | rhs.Get ())> (lhs.Get () | rhs.Get ());
594 }
596 template <typename T, typename U>
597 auto operator | (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () | rhs)>
598 {
599  TRACED_VALUE_DEBUG ("x|");
600  return TracedValue<decltype(lhs.Get () | rhs)> (lhs.Get () | rhs);
601 }
603 template <typename T, typename U>
604 auto operator | (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs | rhs.Get ())>
605 {
606  TRACED_VALUE_DEBUG ("|x");
607  return TracedValue<decltype(lhs | rhs.Get ())> (lhs | rhs.Get ());
608 }
609 
611 template <typename T, typename U>
612 auto operator & (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () & rhs.Get ())>
613 {
614  TRACED_VALUE_DEBUG ("x&x");
615  return TracedValue<decltype(lhs.Get () & rhs.Get ())> (lhs.Get () & rhs.Get ());
616 }
618 template <typename T, typename U>
619 auto operator & (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () & rhs)>
620 {
621  TRACED_VALUE_DEBUG ("x&");
622  return TracedValue<decltype(lhs.Get () & rhs)> (lhs.Get () & rhs);
623 }
625 template <typename T, typename U>
626 auto operator & (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs & rhs.Get ())>
627 {
628  TRACED_VALUE_DEBUG ("&x");
629  return TracedValue<decltype(lhs & rhs.Get ())> (lhs & rhs.Get ());
630 }
631 
633 template <typename T, typename U>
634 auto operator << (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () << rhs.Get ())>
635 {
636  TRACED_VALUE_DEBUG ("x<<x");
637  return TracedValue<decltype(lhs.Get () << rhs.Get ())> (lhs.Get () << rhs.Get ());
638 }
640 template <typename T, typename U>
641 auto operator << (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () << rhs)>
642 {
643  TRACED_VALUE_DEBUG ("x<<");
644  return TracedValue<decltype(lhs.Get () << rhs)> (lhs.Get () << rhs);
645 }
647 template <typename T, typename U>
648 auto operator << (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs << rhs.Get ())>
649 {
650  TRACED_VALUE_DEBUG ("<<x");
651  return TracedValue<decltype(lhs << rhs.Get ())> (lhs << rhs.Get ());
652 }
653 
655 template <typename T, typename U>
656 auto operator >> (const TracedValue<T> &lhs, const TracedValue<U> &rhs)->TracedValue<decltype(lhs.Get () >> rhs.Get ())>
657 {
658  TRACED_VALUE_DEBUG ("x>>x");
659  return TracedValue<decltype(lhs.Get () >> rhs.Get ())> (lhs.Get () >> rhs.Get ());
660 }
662 template <typename T, typename U>
663 auto operator >> (const TracedValue<T> &lhs, const U &rhs)->TracedValue<decltype(lhs.Get () >> rhs)>
664 {
665  TRACED_VALUE_DEBUG ("x>>");
666  return TracedValue<decltype(lhs.Get () >> rhs)> (lhs.Get () >> rhs);
667 }
669 template <typename T, typename U>
670 auto operator >> (const U &lhs, const TracedValue<T> &rhs)->TracedValue<decltype(lhs >> rhs.Get ())>
671 {
672  TRACED_VALUE_DEBUG (">>x");
673  return TracedValue<decltype(lhs >> rhs.Get ())> (lhs >> rhs.Get ());
674 }
675 
690 template <typename T, typename U>
692 {
693  TRACED_VALUE_DEBUG ("x+=");
694  T tmp = lhs.Get ();
695  tmp += rhs;
696  lhs.Set (tmp);
697  return lhs;
698 }
700 template <typename T, typename U>
702 {
703  TRACED_VALUE_DEBUG ("x-=");
704  T tmp = lhs.Get ();
705  tmp -= rhs;
706  lhs.Set (tmp);
707  return lhs;
708 }
710 template <typename T, typename U>
712 {
713  TRACED_VALUE_DEBUG ("x*=");
714  T tmp = lhs.Get ();
715  tmp *= rhs;
716  lhs.Set (tmp);
717  return lhs;
718 }
720 template <typename T, typename U>
722 {
723  TRACED_VALUE_DEBUG ("x/=");
724  T tmp = lhs.Get ();
725  tmp /= rhs;
726  lhs.Set (tmp);
727  return lhs;
728 }
730 template <typename T, typename U>
732 {
733  TRACED_VALUE_DEBUG ("x%=");
734  T tmp = lhs.Get ();
735  tmp %= rhs;
736  lhs.Set (tmp);
737  return lhs;
738 }
740 template <typename T, typename U>
741 TracedValue<T> &operator <<= (TracedValue<T> &lhs, const U &rhs)
742 {
743  TRACED_VALUE_DEBUG ("x<<=");
744  T tmp = lhs.Get ();
745  tmp <<= rhs;
746  lhs.Set (tmp);
747  return lhs;
748 }
750 template <typename T, typename U>
752 {
753  TRACED_VALUE_DEBUG ("x>>=");
754  T tmp = lhs.Get ();
755  tmp >>= rhs;
756  lhs.Set (tmp);
757  return lhs;
758 }
760 template <typename T, typename U>
762 {
763  TRACED_VALUE_DEBUG ("x&=");
764  T tmp = lhs.Get ();
765  tmp &= rhs;
766  lhs.Set (tmp);
767  return lhs;
768 }
770 template <typename T, typename U>
772 {
773  TRACED_VALUE_DEBUG ("x|=");
774  T tmp = lhs.Get ();
775  tmp |= rhs;
776  lhs.Set (tmp);
777  return lhs;
778 }
780 template <typename T, typename U>
782 {
783  TRACED_VALUE_DEBUG ("x^=");
784  T tmp = lhs.Get ();
785  tmp ^= rhs;
786  lhs.Set (tmp);
787  return lhs;
788 }
789 
790 
799 template <typename T>
801 {
802  TRACED_VALUE_DEBUG ("(+x)");
803  return TracedValue<T> (+lhs.Get ());
804 }
806 template <typename T>
808 {
809  TRACED_VALUE_DEBUG ("(-x)");
810  return TracedValue<T> (-lhs.Get ());
811 }
813 template <typename T>
815 {
816  TRACED_VALUE_DEBUG ("(~x)");
817  return TracedValue<T> (~lhs.Get ());
818 }
820 template <typename T>
822 {
823  TRACED_VALUE_DEBUG ("(!x)");
824  return TracedValue<T> (!lhs.Get ());
825 }
826  // \ingroup tracing
828 
829 } // namespace ns3
830 
831 #endif /* TRACED_VALUE_H */
ns3::BooleanValue attribute value declarations.
int64x64_t & operator+=(int64x64_t &lhs, const int64x64_t &rhs)
Compound addition operator.
Definition: int64x64-128.h:377
ns3::DoubleValue attribute value declarations and template implementations.
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition: angles.cc:48
TracedValue< T > & operator|=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:771
auto operator&(const TracedValue< T > &lhs, const TracedValue< U > &rhs) -> TracedValue< decltype(lhs.Get() &rhs.Get())>
Infix arithmetic operator for TracedValue.
Definition: traced-value.h:612
int64x64_t operator+(const int64x64_t &lhs)
Unary plus operator.
Definition: int64x64-128.h:414
T m_v
The underlying value.
Definition: traced-value.h:276
ns3::UintegerValue attribute value declarations and template implementations.
TracedValue & operator=(const TracedValue &o)
Assignment.
Definition: traced-value.h:144
int64x64_t & operator*=(int64x64_t &lhs, const int64x64_t &rhs)
Compound multiplication operator.
Definition: int64x64-128.h:395
int64x64_t operator-(const int64x64_t &lhs)
Unary negation operator (change sign operator).
Definition: int64x64-128.h:422
auto operator%(const TracedValue< T > &lhs, const TracedValue< U > &rhs) -> TracedValue< decltype(lhs.Get() % rhs.Get())>
Infix arithmetic operator for TracedValue.
Definition: traced-value.h:546
Base class for Callback class.
Definition: callback.h:1194
void Disconnect(const CallbackBase &cb, std::string path)
Disconnect a Callback which was connected with context.
Definition: traced-value.h:205
void(* Uint8)(uint8_t oldValue, uint8_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:84
void Set(const T &v)
Set the value of the underlying variable.
Definition: traced-value.h:215
Trace classes with value semantics.
Definition: traced-value.h:111
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
Definition: int64x64.h:145
TracedValue(const TracedValue< U > &other)
Copy from a TracedValue of a compatible type.
Definition: traced-value.h:156
void(* Int16)(int16_t oldValue, int16_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:85
TracedValue< T > operator~(const TracedValue< T > &lhs)
Unary arithmetic operator for TracedValue.
Definition: traced-value.h:814
ns3::TracedCallback declaration and template implementation.
void ConnectWithoutContext(const CallbackBase &cb)
Connect a Callback (without context.)
Definition: traced-value.h:173
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
Definition: int64x64.h:108
void Connect(const CallbackBase &cb, std::string path)
Connect a Callback with a context string.
Definition: traced-value.h:186
TracedValue()
Default constructor.
Definition: traced-value.h:115
void(* Int8)(int8_t oldValue, int8_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:83
void DisconnectWithoutContext(const CallbackBase &callback)
Remove from the chain a Callback which was connected without a context.
ns3::EnumValue attribute value declarations.
TracedValue & operator--()
Pre/post- increment/decrement operator.
Definition: traced-value.h:246
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.
Definition: traced-value.h:87
TracedValue(const U &other)
Copy from a variable type compatible with this underlying type.
Definition: traced-value.h:165
TracedValue< T > & operator%=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:731
int64x64_t operator/(const int64x64_t &lhs, const int64x64_t &rhs)
Division operator.
Definition: int64x64.h:119
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.
Definition: callback.h:1592
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TracedValue< T > & operator>>=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:751
TracedValue< T > & operator^=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:781
TracedValue(const T &v)
Construct from an explicit variable.
Definition: traced-value.h:129
void Connect(const CallbackBase &callback, std::string path)
Append a Callback to the chain with a context.
TracedValue(const TracedValue &o)
Copy constructor.
Definition: traced-value.h:122
void(* Double)(double oldValue, double newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:89
void ConnectWithoutContext(const CallbackBase &callback)
Append a Callback to the chain (without a context).
T Get(void) const
Get the underlying value.
Definition: traced-value.h:227
void(* Void)(void)
TracedValue Callback signature for POD.
Definition: traced-value.h:90
bool operator>(const int64x64_t &lhs, const int64x64_t &rhs)
Greater operator.
Definition: int64x64-128.h:368
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.h:137
ns3::IntegerValue attribute value declarations and template implementations.
void DisconnectWithoutContext(const CallbackBase &cb)
Disconnect a Callback which was connected without context.
Definition: traced-value.h:195
int64x64_t & operator-=(int64x64_t &lhs, const int64x64_t &rhs)
Compound subtraction operator.
Definition: int64x64-128.h:386
#define TRACED_VALUE_DEBUG(x)
Logging macro for TracedValue.
Definition: traced-value.h:48
void(* Uint16)(uint16_t oldValue, uint16_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:86
auto operator|(const TracedValue< T > &lhs, const TracedValue< U > &rhs) -> TracedValue< decltype(lhs.Get()|rhs.Get())>
Infix arithmetic operator for TracedValue.
Definition: traced-value.h:590
int64x64_t & operator/=(int64x64_t &lhs, const int64x64_t &rhs)
Compound division operator.
Definition: int64x64-128.h:404
TracedValue & operator++()
Pre/post- increment/decrement operator.
Definition: traced-value.h:238
void(* Uint32)(uint32_t oldValue, uint32_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:88
TracedCallback< T, T > m_cb
The connected Callback.
Definition: traced-value.h:278
int64x64_t operator!(const int64x64_t &lhs)
Logical not operator.
Definition: int64x64-128.h:430
void(* Bool)(bool oldValue, bool newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:82
auto operator^(const TracedValue< T > &lhs, const TracedValue< U > &rhs) -> TracedValue< decltype(lhs.Get() ^ rhs.Get())>
Infix arithmetic operator for TracedValue.
Definition: traced-value.h:568
TracedValue< T > & operator&=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:761