A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
traced-value.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006,2007 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19#ifndef TRACED_VALUE_H
20#define TRACED_VALUE_H
21
22#include "boolean.h"
23#include "double.h"
24#include "enum.h"
25#include "integer.h"
26#include "traced-callback.h"
27#include "uinteger.h"
28
46#define TRACED_VALUE_DEBUG(x)
47
48namespace ns3
49{
50
69namespace TracedValueCallback
70{
71
82typedef void (*Bool)(bool oldValue, bool newValue);
83typedef void (*Int8)(int8_t oldValue, int8_t newValue);
84typedef void (*Uint8)(uint8_t oldValue, uint8_t newValue);
85typedef void (*Int16)(int16_t oldValue, int16_t newValue);
86typedef void (*Uint16)(uint16_t oldValue, uint16_t newValue);
87typedef void (*Int32)(int32_t oldValue, int32_t newValue);
88typedef void (*Uint32)(uint32_t oldValue, uint32_t newValue);
89typedef void (*Int64)(int64_t oldValue, int64_t newValue);
90typedef void (*Uint64)(uint64_t oldValue, uint64_t newValue);
91typedef void (*Double)(double oldValue, double newValue);
94typedef void (*Void)();
97} // namespace TracedValueCallback
98
114template <typename T>
116{
117 public:
120 : m_v()
121 {
122 }
123
129 : m_v(o.m_v)
130 {
131 }
132
137 TracedValue(const T& v)
138 : m_v(v)
139 {
140 }
141
146 operator T() const
147 {
148 return m_v;
149 }
150
157 {
158 TRACED_VALUE_DEBUG("x=");
159 Set(o.m_v);
160 return *this;
161 }
162
168 template <typename U>
170 : m_v(other.Get())
171 {
172 }
173
179 template <typename U>
180 TracedValue(const U& other)
181 : m_v((T)other)
182 {
183 }
184
191 {
193 }
194
204 void Connect(const CallbackBase& cb, std::string path)
205 {
206 m_cb.Connect(cb, path);
207 }
208
215 {
217 }
218
225 void Disconnect(const CallbackBase& cb, std::string path)
226 {
227 m_cb.Disconnect(cb, path);
228 }
229
236 void Set(const T& v)
237 {
238 if (m_v != v)
239 {
240 m_cb(m_v, v);
241 m_v = v;
242 }
243 }
244
249 T Get() const
250 {
251 return m_v;
252 }
253
262 {
263 TRACED_VALUE_DEBUG("++x");
264 T tmp = Get();
265 ++tmp;
266 Set(tmp);
267 return *this;
268 }
269
271 {
272 TRACED_VALUE_DEBUG("--x");
273 T tmp = Get();
274 --tmp;
275 Set(tmp);
276 return *this;
277 }
278
280 {
281 TRACED_VALUE_DEBUG("x++");
282 TracedValue old(*this);
283 T tmp = Get();
284 tmp++;
285 Set(tmp);
286 return old;
287 }
288
290 {
291 TRACED_VALUE_DEBUG("x--");
292 TracedValue old(*this);
293 T tmp = Get();
294 tmp--;
295 Set(tmp);
296 return old;
297 }
298
301 private:
306};
307
308/********************************************************************
309 Operator implementations for TracedValue
310 ********************************************************************/
311
326template <typename T>
327std::ostream&
328operator<<(std::ostream& os, const TracedValue<T>& rhs)
329{
330 return os << rhs.Get();
331}
332
341template <typename T, typename U>
342bool
344{
345 TRACED_VALUE_DEBUG("x==x");
346 return lhs.Get() == rhs.Get();
347}
348
350template <typename T, typename U>
351bool
352operator==(const TracedValue<T>& lhs, const U& rhs)
353{
354 TRACED_VALUE_DEBUG("x==");
355 return lhs.Get() == rhs;
356}
357
359template <typename T, typename U>
360bool
361operator==(const U& lhs, const TracedValue<T>& rhs)
362{
363 TRACED_VALUE_DEBUG("==x");
364 return lhs == rhs.Get();
365}
366
368template <typename T, typename U>
369bool
371{
372 TRACED_VALUE_DEBUG("x!=x");
373 return lhs.Get() != rhs.Get();
374}
375
377template <typename T, typename U>
378bool
379operator!=(const TracedValue<T>& lhs, const U& rhs)
380{
381 TRACED_VALUE_DEBUG("x!=");
382 return lhs.Get() != rhs;
383}
384
386template <typename T, typename U>
387bool
388operator!=(const U& lhs, const TracedValue<T>& rhs)
389{
390 TRACED_VALUE_DEBUG("!=x");
391 return lhs != rhs.Get();
392}
393
395template <typename T, typename U>
396bool
397operator<=(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
398{
399 TRACED_VALUE_DEBUG("x<=x");
400 return lhs.Get() <= rhs.Get();
401}
402
404template <typename T, typename U>
405bool
406operator<=(const TracedValue<T>& lhs, const U& rhs)
407{
408 TRACED_VALUE_DEBUG("x<=");
409 return lhs.Get() <= rhs;
410}
411
413template <typename T, typename U>
414bool
415operator<=(const U& lhs, const TracedValue<T>& rhs)
416{
417 TRACED_VALUE_DEBUG("<=x");
418 return lhs <= rhs.Get();
419}
420
422template <typename T, typename U>
423bool
425{
426 TRACED_VALUE_DEBUG("x>=x");
427 return lhs.Get() >= rhs.Get();
428}
429
431template <typename T, typename U>
432bool
433operator>=(const TracedValue<T>& lhs, const U& rhs)
434{
435 TRACED_VALUE_DEBUG("x>=");
436 return lhs.Get() >= rhs;
437}
438
440template <typename T, typename U>
441bool
442operator>=(const U& lhs, const TracedValue<T>& rhs)
443{
444 TRACED_VALUE_DEBUG(">=x");
445 return lhs >= rhs.Get();
446}
447
449template <typename T, typename U>
450bool
451operator<(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
452{
453 TRACED_VALUE_DEBUG("x<x");
454 return lhs.Get() < rhs.Get();
455}
456
458template <typename T, typename U>
459bool
460operator<(const TracedValue<T>& lhs, const U& rhs)
461{
462 TRACED_VALUE_DEBUG("x<");
463 return lhs.Get() < rhs;
464}
465
467template <typename T, typename U>
468bool
469operator<(const U& lhs, const TracedValue<T>& rhs)
470{
471 TRACED_VALUE_DEBUG("<x");
472 return lhs < rhs.Get();
473}
474
476template <typename T, typename U>
477bool
479{
480 TRACED_VALUE_DEBUG("x>x");
481 return lhs.Get() > rhs.Get();
482}
483
485template <typename T, typename U>
486bool
487operator>(const TracedValue<T>& lhs, const U& rhs)
488{
489 TRACED_VALUE_DEBUG("x>");
490 return lhs.Get() > rhs;
491}
492
494template <typename T, typename U>
495bool
496operator>(const U& lhs, const TracedValue<T>& rhs)
497{
498 TRACED_VALUE_DEBUG(">x");
499 return lhs > rhs.Get();
500}
501
515template <typename T, typename U>
516auto
518 -> TracedValue<decltype(lhs.Get() + rhs.Get())>
519{
520 TRACED_VALUE_DEBUG("x+x");
521 return TracedValue<decltype(lhs.Get() + rhs.Get())>(lhs.Get() + rhs.Get());
522}
523
525template <typename T, typename U>
526auto
527operator+(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() + rhs)>
528{
529 TRACED_VALUE_DEBUG("x+");
530 return TracedValue<decltype(lhs.Get() + rhs)>(lhs.Get() + rhs);
531}
532
534template <typename T, typename U>
535auto
536operator+(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs + rhs.Get())>
537{
538 TRACED_VALUE_DEBUG("+x");
539 return TracedValue<decltype(lhs + rhs.Get())>(lhs + rhs.Get());
540}
541
543template <typename T, typename U>
544auto
546 -> 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}
551
553template <typename T, typename U>
554auto
555operator-(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() - rhs)>
556{
557 TRACED_VALUE_DEBUG("x-");
558 return TracedValue<decltype(lhs.Get() - rhs)>(lhs.Get() - rhs);
559}
560
562template <typename T, typename U>
563auto
564operator-(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs - rhs.Get())>
565{
566 TRACED_VALUE_DEBUG("-x");
567 return TracedValue<decltype(lhs - rhs.Get())>(lhs - rhs.Get());
568}
569
571template <typename T, typename U>
572auto
574 -> TracedValue<decltype(lhs.Get() * rhs.Get())>
575{
576 TRACED_VALUE_DEBUG("x*x");
577 return TracedValue<decltype(lhs.Get() * rhs.Get())>(lhs.Get() * rhs.Get());
578}
579
581template <typename T, typename U>
582auto
583operator*(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() * rhs)>
584{
585 TRACED_VALUE_DEBUG("x*");
586 return TracedValue<decltype(lhs.Get() * rhs)>(lhs.Get() * rhs);
587}
588
590template <typename T, typename U>
591auto
592operator*(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs + rhs.Get())>
593{
594 TRACED_VALUE_DEBUG("*x");
595 return TracedValue<decltype(lhs + rhs.Get())>(lhs * rhs.Get());
596}
597
599template <typename T, typename U>
600auto
602 -> TracedValue<decltype(lhs.Get() / rhs.Get())>
603{
604 TRACED_VALUE_DEBUG("x/x");
605 return TracedValue<decltype(lhs.Get() / rhs.Get())>(lhs.Get() / rhs.Get());
606}
607
609template <typename T, typename U>
610auto
611operator/(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() / rhs)>
612{
613 TRACED_VALUE_DEBUG("x/");
614 return TracedValue<decltype(lhs.Get() / rhs)>(lhs.Get() / rhs);
615}
616
618template <typename T, typename U>
619auto
620operator/(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs / rhs.Get())>
621{
622 TRACED_VALUE_DEBUG("/x");
623 return TracedValue<decltype(lhs / rhs.Get())>(lhs / rhs.Get());
624}
625
627template <typename T, typename U>
628auto
630 -> TracedValue<decltype(lhs.Get() % rhs.Get())>
631{
632 TRACED_VALUE_DEBUG("x%x");
633 return TracedValue<decltype(lhs.Get() % rhs.Get())>(lhs.Get() % rhs.Get());
634}
635
637template <typename T, typename U>
638auto
639operator%(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() % rhs)>
640{
641 TRACED_VALUE_DEBUG("x%");
642 return TracedValue<decltype(lhs.Get() % rhs)>(lhs.Get() % rhs);
643}
644
646template <typename T, typename U>
647auto
648operator%(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
655template <typename T, typename U>
656auto
658 -> TracedValue<decltype(lhs.Get() ^ rhs.Get())>
659{
660 TRACED_VALUE_DEBUG("x^x");
661 return TracedValue<decltype(lhs.Get() ^ rhs.Get())>(lhs.Get() ^ rhs.Get());
662}
663
665template <typename T, typename U>
666auto
667operator^(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() ^ rhs)>
668{
669 TRACED_VALUE_DEBUG("x^");
670 return TracedValue<decltype(lhs.Get() ^ rhs)>(lhs.Get() ^ rhs);
671}
672
674template <typename T, typename U>
675auto
676operator^(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs ^ rhs.Get())>
677{
678 TRACED_VALUE_DEBUG("^x");
679 return TracedValue<decltype(lhs ^ rhs.Get())>(lhs ^ rhs.Get());
680}
681
683template <typename T, typename U>
684auto
686 -> TracedValue<decltype(lhs.Get() | rhs.Get())>
687{
688 TRACED_VALUE_DEBUG("x|x");
689 return TracedValue<decltype(lhs.Get() | rhs.Get())>(lhs.Get() | rhs.Get());
690}
691
693template <typename T, typename U>
694auto
695operator|(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() | rhs)>
696{
697 TRACED_VALUE_DEBUG("x|");
698 return TracedValue<decltype(lhs.Get() | rhs)>(lhs.Get() | rhs);
699}
700
702template <typename T, typename U>
703auto
704operator|(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs | rhs.Get())>
705{
706 TRACED_VALUE_DEBUG("|x");
707 return TracedValue<decltype(lhs | rhs.Get())>(lhs | rhs.Get());
708}
709
711template <typename T, typename U>
712auto
714 -> TracedValue<decltype(lhs.Get() & rhs.Get())>
715{
716 TRACED_VALUE_DEBUG("x&x");
717 return TracedValue<decltype(lhs.Get() & rhs.Get())>(lhs.Get() & rhs.Get());
718}
719
721template <typename T, typename U>
722auto
723operator&(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() & rhs)>
724{
725 TRACED_VALUE_DEBUG("x&");
726 return TracedValue<decltype(lhs.Get() & rhs)>(lhs.Get() & rhs);
727}
728
730template <typename T, typename U>
731auto
732operator&(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs & rhs.Get())>
733{
734 TRACED_VALUE_DEBUG("&x");
735 return TracedValue<decltype(lhs & rhs.Get())>(lhs & rhs.Get());
736}
737
739template <typename T, typename U>
740auto
741operator<<(const TracedValue<T>& lhs, const TracedValue<U>& rhs)
742 -> TracedValue<decltype(lhs.Get() << rhs.Get())>
743{
744 TRACED_VALUE_DEBUG("x<<x");
745 return TracedValue<decltype(lhs.Get() << rhs.Get())>(lhs.Get() << rhs.Get());
746}
747
749template <typename T, typename U>
750auto
751operator<<(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() << rhs)>
752{
753 TRACED_VALUE_DEBUG("x<<");
754 return TracedValue<decltype(lhs.Get() << rhs)>(lhs.Get() << rhs);
755}
756
758template <typename T, typename U>
759auto
760operator<<(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs << rhs.Get())>
761{
762 TRACED_VALUE_DEBUG("<<x");
763 return TracedValue<decltype(lhs << rhs.Get())>(lhs << rhs.Get());
764}
765
767template <typename T, typename U>
768auto
770 -> TracedValue<decltype(lhs.Get() >> rhs.Get())>
771{
772 TRACED_VALUE_DEBUG("x>>x");
773 return TracedValue<decltype(lhs.Get() >> rhs.Get())>(lhs.Get() >> rhs.Get());
774}
775
777template <typename T, typename U>
778auto
779operator>>(const TracedValue<T>& lhs, const U& rhs) -> TracedValue<decltype(lhs.Get() >> rhs)>
780{
781 TRACED_VALUE_DEBUG("x>>");
782 return TracedValue<decltype(lhs.Get() >> rhs)>(lhs.Get() >> rhs);
783}
784
786template <typename T, typename U>
787auto
788operator>>(const U& lhs, const TracedValue<T>& rhs) -> TracedValue<decltype(lhs >> rhs.Get())>
789{
790 TRACED_VALUE_DEBUG(">>x");
791 return TracedValue<decltype(lhs >> rhs.Get())>(lhs >> rhs.Get());
792}
793
808template <typename T, typename U>
809TracedValue<T>&
810operator+=(TracedValue<T>& lhs, const U& rhs)
811{
812 TRACED_VALUE_DEBUG("x+=");
813 T tmp = lhs.Get();
814 tmp += rhs;
815 lhs.Set(tmp);
816 return lhs;
817}
818
820template <typename T, typename U>
821TracedValue<T>&
822operator-=(TracedValue<T>& lhs, const U& rhs)
823{
824 TRACED_VALUE_DEBUG("x-=");
825 T tmp = lhs.Get();
826 tmp -= rhs;
827 lhs.Set(tmp);
828 return lhs;
829}
830
832template <typename T, typename U>
833TracedValue<T>&
834operator*=(TracedValue<T>& lhs, const U& rhs)
835{
836 TRACED_VALUE_DEBUG("x*=");
837 T tmp = lhs.Get();
838 tmp *= rhs;
839 lhs.Set(tmp);
840 return lhs;
841}
842
844template <typename T, typename U>
845TracedValue<T>&
846operator/=(TracedValue<T>& lhs, const U& rhs)
847{
848 TRACED_VALUE_DEBUG("x/=");
849 T tmp = lhs.Get();
850 tmp /= rhs;
851 lhs.Set(tmp);
852 return lhs;
853}
854
856template <typename T, typename U>
857TracedValue<T>&
858operator%=(TracedValue<T>& lhs, const U& rhs)
859{
860 TRACED_VALUE_DEBUG("x%=");
861 T tmp = lhs.Get();
862 tmp %= rhs;
863 lhs.Set(tmp);
864 return lhs;
865}
866
868template <typename T, typename U>
869TracedValue<T>&
870operator<<=(TracedValue<T>& lhs, const U& rhs)
871{
872 TRACED_VALUE_DEBUG("x<<=");
873 T tmp = lhs.Get();
874 tmp <<= rhs;
875 lhs.Set(tmp);
876 return lhs;
877}
878
880template <typename T, typename U>
881TracedValue<T>&
882operator>>=(TracedValue<T>& lhs, const U& rhs)
883{
884 TRACED_VALUE_DEBUG("x>>=");
885 T tmp = lhs.Get();
886 tmp >>= rhs;
887 lhs.Set(tmp);
888 return lhs;
889}
890
892template <typename T, typename U>
893TracedValue<T>&
894operator&=(TracedValue<T>& lhs, const U& rhs)
895{
896 TRACED_VALUE_DEBUG("x&=");
897 T tmp = lhs.Get();
898 tmp &= rhs;
899 lhs.Set(tmp);
900 return lhs;
901}
902
904template <typename T, typename U>
905TracedValue<T>&
906operator|=(TracedValue<T>& lhs, const U& rhs)
907{
908 TRACED_VALUE_DEBUG("x|=");
909 T tmp = lhs.Get();
910 tmp |= rhs;
911 lhs.Set(tmp);
912 return lhs;
913}
914
916template <typename T, typename U>
917TracedValue<T>&
918operator^=(TracedValue<T>& lhs, const U& rhs)
919{
920 TRACED_VALUE_DEBUG("x^=");
921 T tmp = lhs.Get();
922 tmp ^= rhs;
923 lhs.Set(tmp);
924 return lhs;
925}
926
935template <typename T>
936TracedValue<T>
938{
939 TRACED_VALUE_DEBUG("(+x)");
940 return TracedValue<T>(+lhs.Get());
941}
942
944template <typename T>
945TracedValue<T>
947{
948 TRACED_VALUE_DEBUG("(-x)");
949 return TracedValue<T>(-lhs.Get());
950}
951
953template <typename T>
954TracedValue<T>
956{
957 TRACED_VALUE_DEBUG("(~x)");
958 return TracedValue<T>(~lhs.Get());
959}
960
962template <typename T>
963TracedValue<T>
965{
966 TRACED_VALUE_DEBUG("(!x)");
967 return TracedValue<T>(!lhs.Get());
968}
969 // \ingroup tracing
971
972} // namespace ns3
973
974#endif /* TRACED_VALUE_H */
ns3::BooleanValue attribute value declarations.
Base class for Callback class.
Definition: callback.h:360
Forward calls to a chain of Callback.
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.
Definition: traced-value.h:116
TracedValue(const T &v)
Construct from an explicit variable.
Definition: traced-value.h:137
TracedValue & operator++()
Pre/post- increment/decrement operator.
Definition: traced-value.h:261
void DisconnectWithoutContext(const CallbackBase &cb)
Disconnect a Callback which was connected without context.
Definition: traced-value.h:214
TracedCallback< T, T > m_cb
The connected Callback.
Definition: traced-value.h:305
T m_v
The underlying value.
Definition: traced-value.h:303
TracedValue & operator--()
Pre/post- increment/decrement operator.
Definition: traced-value.h:270
void Connect(const CallbackBase &cb, std::string path)
Connect a Callback with a context string.
Definition: traced-value.h:204
void Disconnect(const CallbackBase &cb, std::string path)
Disconnect a Callback which was connected with context.
Definition: traced-value.h:225
TracedValue operator--(int)
Pre/post- increment/decrement operator.
Definition: traced-value.h:289
TracedValue & operator=(const TracedValue &o)
Assignment.
Definition: traced-value.h:156
TracedValue(const TracedValue &o)
Copy constructor.
Definition: traced-value.h:128
void ConnectWithoutContext(const CallbackBase &cb)
Connect a Callback (without context.)
Definition: traced-value.h:190
T Get() const
Get the underlying value.
Definition: traced-value.h:249
TracedValue()
Default constructor.
Definition: traced-value.h:119
TracedValue(const U &other)
Copy from a variable type compatible with this underlying type.
Definition: traced-value.h:180
void Set(const T &v)
Set the value of the underlying variable.
Definition: traced-value.h:236
TracedValue operator++(int)
Pre/post- increment/decrement operator.
Definition: traced-value.h:279
TracedValue(const TracedValue< U > &other)
Copy from a TracedValue of a compatible type.
Definition: traced-value.h:169
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.
Definition: int64x64.h:133
bool operator>=(const int64x64_t &lhs, const int64x64_t &rhs)
Greater or equal operator.
Definition: int64x64.h:174
bool operator<=(const int64x64_t &lhs, const int64x64_t &rhs)
Less or equal operator.
Definition: int64x64.h:161
int64x64_t operator-(const int64x64_t &lhs, const int64x64_t &rhs)
Subtraction operator.
Definition: int64x64.h:103
int64x64_t operator+(const int64x64_t &lhs, const int64x64_t &rhs)
Addition operator.
Definition: int64x64.h:88
int64x64_t operator*(const int64x64_t &lhs, const int64x64_t &rhs)
Multiplication operator.
Definition: int64x64.h:118
bool operator>(const Length &left, const Length &right)
Check if left has a value greater than right.
Definition: length.cc:421
TracedValue< T > & operator/=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:846
TracedValue< T > & operator|=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:906
TracedValue< T > operator!(const TracedValue< T > &lhs)
Unary arithmetic operator for TracedValue.
Definition: traced-value.h:964
TracedValue< T > & operator%=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:858
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:657
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:685
TracedValue< T > & operator^=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:918
TracedValue< T > & operator*=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:834
TracedValue< T > & operator<<=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:870
TracedValue< T > operator~(const TracedValue< T > &lhs)
Unary arithmetic operator for TracedValue.
Definition: traced-value.h:955
TracedValue< T > & operator>>=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:882
TracedValue< T > & operator&=(TracedValue< T > &lhs, const U &rhs)
Operator assignment for TracedValue.
Definition: traced-value.h:894
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:713
ns3::IntegerValue attribute value declarations and template implementations.
void(* Uint16)(uint16_t oldValue, uint16_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:86
void(* Bool)(bool oldValue, bool newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:82
void(* Int8)(int8_t oldValue, int8_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:83
void(* Void)()
TracedValue Callback signature for void.
Definition: traced-value.h:94
void(* Int16)(int16_t oldValue, int16_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:85
void(* Uint8)(uint8_t oldValue, uint8_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:84
void(* Int64)(int64_t oldValue, int64_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:89
void(* Uint32)(uint32_t oldValue, uint32_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:88
void(* Uint64)(uint64_t oldValue, uint64_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:90
void(* Int32)(int32_t oldValue, int32_t newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:87
void(* Double)(double oldValue, double newValue)
TracedValue Callback signature for POD.
Definition: traced-value.h:91
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.
Definition: callback.h:676
Time operator%(const Time &lhs, const Time &rhs)
Remainder (modulus) from the quotient of two Times.
Definition: nstime.h:1137
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.h:157
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129
Time & operator+=(Time &lhs, const Time &rhs)
Compound addition assignment for Time.
Definition: nstime.h:1183
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:153
bool operator<(const EventId &a, const EventId &b)
Definition: event-id.h:170
Time & operator-=(Time &lhs, const Time &rhs)
Compound subtraction assignment for Time.
Definition: nstime.h:1196
ns3::TracedCallback declaration and template implementation.
#define TRACED_VALUE_DEBUG(x)
Logging macro for TracedValue.
Definition: traced-value.h:46
ns3::UintegerValue attribute value declarations and template implementations.