A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
type-traits.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*/
7
8
#ifndef TYPE_TRAITS_H
9
#define TYPE_TRAITS_H
10
11
#include "
deprecated.h
"
12
#include "
ptr.h
"
13
14
/**
15
* \file
16
* \ingroup object
17
* ns3::TypeTraits introspection declaration and template implementation.
18
*/
19
20
namespace
ns3
21
{
22
23
/**
24
* \ingroup object
25
* Inspect a type to deduce its features.
26
* \tparam T \deduced The type to inspect.
27
*/
28
template
<
typename
T>
29
struct
NS_DEPRECATED_3_43
(
"Use functions provided by #include <type_traits>"
)
TypeTraits
30
{
31
private
:
32
/** Null value type traits. */
33
struct
NullType
34
{
35
};
36
37
/**
38
* Not a const type.
39
* \tparam U \deduced The type being inspected.
40
*/
41
template
<
typename
U>
42
struct
UnConst
43
{
44
typedef
U
Result
;
/**< Non-const type. */
45
};
46
47
/**
48
* Const type.
49
* \tparam U \deduced The type being inspected.
50
*/
51
template
<
typename
U>
52
struct
UnConst
<const U>
53
{
54
typedef
U
Result
;
/**< Non-const type. */
55
};
56
57
/**
58
* Not a reference type.
59
* \tparam U \deduced The type being inspected.
60
*/
61
template
<
typename
U>
62
struct
ReferenceTraits
63
{
64
/** Value. */
65
enum
66
{
67
IsReference = 0
/**< Not a reference type. */
68
};
69
70
typedef
U
ReferencedType
;
/**< Base type. */
71
};
72
73
/**
74
* Reference type.
75
* \tparam U \deduced The type being inspected.
76
*/
77
template
<
typename
U>
78
struct
ReferenceTraits
<U&>
79
{
80
/** Value. */
81
enum
82
{
83
IsReference = 1
/**< Reference type. */
84
};
85
86
typedef
U
ReferencedType
;
/**< Base type. */
87
};
88
89
/**
90
* Not a pointer type.
91
* \tparam U \deduced The type being inspected.
92
*/
93
template
<
typename
U>
94
struct
PointerTraits
95
{
96
/** Value. */
97
enum
98
{
99
IsPointer = 0,
/**< Not a pointer type. */
100
IsPtr = 0
/**< Not a Ptr type. */
101
};
102
103
typedef
U
PointeeType
;
/**< Base type. */
104
};
105
106
/**
107
* Pointer type.
108
* \tparam U \deduced The type being inspected.
109
*/
110
template
<
typename
U>
111
struct
PointerTraits
<U*>
112
{
113
/** Value. */
114
enum
115
{
116
IsPointer = 1,
/**< Pointer type. */
117
IsPtr = 0
/**< Not a Ptr type. */
118
};
119
120
typedef
U
PointeeType
;
/**< Pointee type. */
121
};
122
123
/**
124
* Ptr type.
125
* \tparam U \deduced The type being inspected.
126
*/
127
template
<
typename
U>
128
struct
PointerTraits
<
ns3
::
Ptr
<U>>
129
{
130
/** Value. */
131
enum
132
{
133
IsPointer = 0,
/**< Not a pointer type. */
134
IsPtr = 1
/**< Ptr type. */
135
};
136
137
typedef
U
PointeeType
;
/**< Pointee type. */
138
};
139
140
/**
141
* Base type, after removing \c &, \c * and \c const.
142
* \tparam U \deduced The type being inspected.
143
*/
144
template
<
typename
U>
145
struct
Base
146
{
147
typedef
U
Type
;
/**< Base type. */
148
};
149
150
/**
151
* Base type, after removing \c &.
152
* \tparam U \deduced The type being inspected.
153
*/
154
template
<
typename
U>
155
struct
Base
<U&>
156
{
157
typedef
typename
Base<U>::Type
Type
;
/**< Base type. */
158
};
159
160
/**
161
* Base type, after removing \c *.
162
* \tparam U \deduced The type being inspected.
163
*/
164
template
<
typename
U>
165
struct
Base
<U*>
166
{
167
typedef
typename
Base<U>::Type
Type
;
/**< Base type. */
168
};
169
170
/**
171
* Base type, after removing \c const.
172
* \tparam U \deduced The type being inspected.
173
*/
174
template
<
typename
U>
175
struct
Base
<const U>
176
{
177
typedef
typename
Base<U>::Type
Type
;
/**< Base type. */
178
};
179
180
/**
181
* Base type of a Ptr.
182
* \tparam U \deduced The type being inspected.
183
*/
184
template
<
typename
U>
185
struct
PtrBase
186
{
187
typedef
U
Type
;
/**< Base type. */
188
};
189
190
/**
191
* Base type of a Ptr.
192
* \tparam U \deduced The type being inspected.
193
*/
194
template
<
typename
U>
195
struct
PtrBase
<
ns3
::
Ptr
<U>>
196
{
197
typedef
U
Type
;
/**< Base type. */
198
};
199
200
/**
201
* Not a function pointer type.
202
* \tparam U \deduced The type being inspected.
203
*/
204
template
<
typename
U>
205
struct
FunctionPtrTraits
206
{
207
/** Value. */
208
enum
209
{
210
IsFunctionPointer = 0
/**< Not a function pointer. */
211
};
212
213
typedef
NullType
ReturnType
;
/**< Return type. */
214
};
215
216
/**
217
* Function pointer type.
218
* \tparam U \deduced Return type.
219
*/
220
template
<
typename
U>
221
struct
FunctionPtrTraits
<U (*)()>
222
{
223
/** Value. */
224
enum
225
{
226
IsFunctionPointer = 1
/**< Function pointer. */
227
};
228
229
/** Value. */
enum
230
{
231
nArgs = 0
/**< Number of arguments. */
232
};
233
234
typedef
U
ReturnType
;
/**< Return type. */
235
};
236
237
/**
238
* Function pointer type.
239
* \tparam U \deduced Return type.
240
* \tparam V1 \deduced Argument type.
241
*/
242
template
<
typename
U,
typename
V1>
243
struct
FunctionPtrTraits
<U (*)(V1)>
244
{
245
/** Value. */
246
enum
247
{
248
IsFunctionPointer = 1
/**< Function pointer. */
249
};
250
251
/** Value. */
enum
252
{
253
nArgs = 1
/**< Number of arguments. */
254
};
255
256
typedef
U
ReturnType
;
/**< Return type. */
257
typedef
V1
Arg1Type
;
/**< First argument type. */
258
};
259
260
/**
261
* Function pointer type.
262
* \tparam U \deduced Return type.
263
* \tparam V1 \deduced Argument type.
264
* \tparam V2 \deduced Argument type.
265
*/
266
template
<
typename
U,
typename
V1,
typename
V2>
267
struct
FunctionPtrTraits
<U (*)(V1, V2)>
268
{
269
/** Value. */
270
enum
271
{
272
IsFunctionPointer = 1
/**< Function pointer. */
273
};
274
275
/** Value. */
enum
276
{
277
nArgs = 2
/**< Number of arguments. */
278
};
279
280
typedef
U
ReturnType
;
/**< Return type. */
281
typedef
V1
Arg1Type
;
/**< First argument type. */
282
typedef
V2
Arg2Type
;
/**< Second argument type. */
283
};
284
285
/**
286
* Function pointer type.
287
* \tparam U \deduced Return type.
288
* \tparam V1 \deduced Argument type.
289
* \tparam V2 \deduced Argument type.
290
* \tparam V3 \deduced Argument type.
291
*/
292
template
<
typename
U,
typename
V1,
typename
V2,
typename
V3>
293
struct
FunctionPtrTraits
<U (*)(V1, V2, V3)>
294
{
295
/** Value. */
296
enum
297
{
298
IsFunctionPointer = 1
/**< Function pointer. */
299
};
300
301
/** Value. */
enum
302
{
303
nArgs = 3
/**< Number of arguments. */
304
};
305
306
typedef
U
ReturnType
;
/**< Return type. */
307
typedef
V1
Arg1Type
;
/**< First argument type. */
308
typedef
V2
Arg2Type
;
/**< Second argument type. */
309
typedef
V3
Arg3Type
;
/**< Third argument type. */
310
};
311
312
/**
313
* Function pointer type.
314
* \tparam U \deduced Return type.
315
* \tparam V1 \deduced Argument type.
316
* \tparam V2 \deduced Argument type.
317
* \tparam V3 \deduced Argument type.
318
* \tparam V4 \deduced Argument type.
319
*/
320
template
<
typename
U,
typename
V1,
typename
V2,
typename
V3,
typename
V4>
321
struct
FunctionPtrTraits
<U (*)(V1, V2, V3, V4)>
322
{
323
/** Value. */
324
enum
325
{
326
IsFunctionPointer = 1
/**< Function pointer. */
327
};
328
329
/** Value. */
enum
330
{
331
nArgs = 4
/**< Number of arguments. */
332
};
333
334
typedef
U
ReturnType
;
/**< Return type. */
335
typedef
V1
Arg1Type
;
/**< First argument type. */
336
typedef
V2
Arg2Type
;
/**< Second argument type. */
337
typedef
V3
Arg3Type
;
/**< Third argument type. */
338
typedef
V4
Arg4Type
;
/**< Fourth argument type. */
339
};
340
341
/**
342
* Function pointer type.
343
* \tparam U \deduced Return type.
344
* \tparam V1 \deduced Argument type.
345
* \tparam V2 \deduced Argument type.
346
* \tparam V3 \deduced Argument type.
347
* \tparam V4 \deduced Argument type.
348
* \tparam V5 \deduced Argument type.
349
*/
350
template
<
typename
U,
typename
V1,
typename
V2,
typename
V3,
typename
V4,
typename
V5>
351
struct
FunctionPtrTraits
<U (*)(V1, V2, V3, V4, V5)>
352
{
353
/** Value. */
354
enum
355
{
356
IsFunctionPointer = 1
/**< Function pointer. */
357
};
358
359
/** Value. */
enum
360
{
361
nArgs = 5
/**< Number of arguments. */
362
};
363
364
typedef
U
ReturnType
;
/**< Return type. */
365
typedef
V1
Arg1Type
;
/**< First argument type. */
366
typedef
V2
Arg2Type
;
/**< Second argument type. */
367
typedef
V3
Arg3Type
;
/**< Third argument type. */
368
typedef
V4
Arg4Type
;
/**< Fourth argument type. */
369
typedef
V5
Arg5Type
;
/**< Fifth argument type. */
370
};
371
372
/**
373
* Function pointer type.
374
* \tparam U \deduced Return type.
375
* \tparam V1 \deduced Argument type.
376
* \tparam V2 \deduced Argument type.
377
* \tparam V3 \deduced Argument type.
378
* \tparam V4 \deduced Argument type.
379
* \tparam V5 \deduced Argument type.
380
* \tparam V6 \deduced Argument type.
381
*/
382
template
<
typename
U,
383
typename
V1,
384
typename
V2,
385
typename
V3,
386
typename
V4,
387
typename
V5,
388
typename
V6>
389
struct
FunctionPtrTraits
<U (*)(V1, V2, V3, V4, V5, V6)>
390
{
391
/** Value. */
392
enum
393
{
394
IsFunctionPointer = 1
/**< Function pointer. */
395
};
396
397
/** Value. */
enum
398
{
399
nArgs = 6
/**< Number of arguments. */
400
};
401
402
typedef
U
ReturnType
;
/**< Return type. */
403
typedef
V1
Arg1Type
;
/**< First argument type. */
404
typedef
V2
Arg2Type
;
/**< Second argument type. */
405
typedef
V3
Arg3Type
;
/**< Third argument type. */
406
typedef
V4
Arg4Type
;
/**< Fourth argument type. */
407
typedef
V5
Arg5Type
;
/**< Fifth argument type. */
408
typedef
V6
Arg6Type
;
/**< Sixth argument type. */
409
};
410
411
/**
412
* Not a pointer to member type.
413
* \tparam U \deduced Return type.
414
*/
415
template
<
typename
U>
416
struct
PtrToMemberTraits
417
{
418
/** Value. */
419
enum
420
{
421
IsPointerToMember = 0
/**< Not a pointer to member. */
422
};
423
};
424
425
/**
426
* Pointer to member function.
427
* \tparam U \deduced Return type.
428
* \tparam V \deduced Class type.
429
*/
430
template
<
typename
U,
typename
V>
431
struct
PtrToMemberTraits
<U (V::*)()>
432
{
433
/** Value. */
434
enum
435
{
436
IsPointerToMember = 1
/**< Pointer to member function. */
437
};
438
439
/** Value. */
enum
440
{
441
nArgs = 0
/**< Number of arguments. */
442
};
443
444
typedef
U
ReturnType
;
/**< Return type. */
445
};
446
447
/**
448
* Pointer to const member function.
449
* \tparam U \deduced Return type.
450
* \tparam V \deduced Class type.
451
*/
452
template
<
typename
U,
typename
V>
453
struct
PtrToMemberTraits
<U (V::*)() const>
454
{
455
/** Value. */
456
enum
457
{
458
IsPointerToMember = 1
/**< Pointer to member function. */
459
};
460
461
/** Value. */
enum
462
{
463
nArgs = 0
/**< Number of arguments. */
464
};
465
466
typedef
U
ReturnType
;
/**< Return type. */
467
};
468
469
/**
470
* Pointer to member function.
471
* \tparam U \deduced Return type.
472
* \tparam V \deduced Class type.
473
* \tparam W1 \deduced Argument type.
474
*/
475
template
<
typename
U,
typename
V,
typename
W1>
476
struct
PtrToMemberTraits
<U (V::*)(W1)>
477
{
478
/** Value. */
479
enum
480
{
481
IsPointerToMember = 1
/**< Pointer to member function. */
482
};
483
484
/** Value. */
enum
485
{
486
nArgs = 1
/**< Number of arguments. */
487
};
488
489
typedef
U
ReturnType
;
/**< Return type. */
490
typedef
W1
Arg1Type
;
/**< First argument type. */
491
};
492
493
/**
494
* Pointer to const member function.
495
* \tparam U \deduced Return type.
496
* \tparam V \deduced Class type.
497
* \tparam W1 \deduced Argument type.
498
*/
499
template
<
typename
U,
typename
V,
typename
W1>
500
struct
PtrToMemberTraits
<U (V::*)(W1) const>
501
{
502
/** Value. */
503
enum
504
{
505
IsPointerToMember = 1
/**< Pointer to member function. */
506
};
507
508
/** Value. */
enum
509
{
510
nArgs = 1
/**< Number of arguments. */
511
};
512
513
typedef
U
ReturnType
;
/**< Return type. */
514
typedef
W1
Arg1Type
;
/**< First argument type. */
515
};
516
517
/**
518
* Pointer to member function.
519
* \tparam U \deduced Return type.
520
* \tparam V \deduced Class type.
521
* \tparam W1 \deduced Argument type.
522
* \tparam W2 \deduced Argument type.
523
*/
524
template
<
typename
U,
typename
V,
typename
W1,
typename
W2>
525
struct
PtrToMemberTraits
<U (V::*)(W1, W2)>
526
{
527
/** Value. */
528
enum
529
{
530
IsPointerToMember = 1
/**< Pointer to member function. */
531
};
532
533
/** Value. */
enum
534
{
535
nArgs = 2
/**< Number of arguments. */
536
};
537
538
typedef
U
ReturnType
;
/**< Return type. */
539
typedef
W1
Arg1Type
;
/**< First argument type. */
540
typedef
W2
Arg2Type
;
/**< Second argument type. */
541
};
542
543
/**
544
* Pointer to const member function.
545
* \tparam U \deduced Return type.
546
* \tparam V \deduced Class type.
547
* \tparam W1 \deduced Argument type.
548
* \tparam W2 \deduced Argument type.
549
*/
550
template
<
typename
U,
typename
V,
typename
W1,
typename
W2>
551
struct
PtrToMemberTraits
<U (V::*)(W1, W2) const>
552
{
553
/** Value. */
554
enum
555
{
556
IsPointerToMember = 1
/**< Pointer to member function. */
557
};
558
559
/** Value. */
enum
560
{
561
nArgs = 2
/**< Number of arguments. */
562
};
563
564
typedef
U
ReturnType
;
/**< Return type. */
565
typedef
W1
Arg1Type
;
/**< First argument type. */
566
typedef
W2
Arg2Type
;
/**< Second argument type. */
567
};
568
569
/**
570
* Pointer to member function.
571
* \tparam U \deduced Return type.
572
* \tparam V \deduced Class type.
573
* \tparam W1 \deduced Argument type.
574
* \tparam W2 \deduced Argument type.
575
* \tparam W3 \deduced Argument type.
576
*/
577
template
<
typename
U,
typename
V,
typename
W1,
typename
W2,
typename
W3>
578
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3)>
579
{
580
/** Value. */
581
enum
582
{
583
IsPointerToMember = 1
/**< Pointer to member function. */
584
};
585
586
/** Value. */
enum
587
{
588
nArgs = 3
/**< Number of arguments. */
589
};
590
591
typedef
U
ReturnType
;
/**< Return type. */
592
typedef
W1
Arg1Type
;
/**< First argument type. */
593
typedef
W2
Arg2Type
;
/**< Second argument type. */
594
typedef
W3
Arg3Type
;
/**< Third argument type. */
595
};
596
597
/**
598
* Pointer to const member function.
599
* \tparam U \deduced Return type.
600
* \tparam V \deduced Class type.
601
* \tparam W1 \deduced Argument type.
602
* \tparam W2 \deduced Argument type.
603
* \tparam W3 \deduced Argument type.
604
*/
605
template
<
typename
U,
typename
V,
typename
W1,
typename
W2,
typename
W3>
606
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3) const>
607
{
608
/** Value. */
609
enum
610
{
611
IsPointerToMember = 1
/**< Pointer to member function. */
612
};
613
614
/** Value. */
enum
615
{
616
nArgs = 3
/**< Number of arguments. */
617
};
618
619
typedef
U
ReturnType
;
/**< Return type. */
620
typedef
W1
Arg1Type
;
/**< First argument type. */
621
typedef
W2
Arg2Type
;
/**< Second argument type. */
622
typedef
W3
Arg3Type
;
/**< Third argument type. */
623
};
624
625
/**
626
* Pointer to member function.
627
* \tparam U \deduced Return type.
628
* \tparam V \deduced Class type.
629
* \tparam W1 \deduced Argument type.
630
* \tparam W2 \deduced Argument type.
631
* \tparam W3 \deduced Argument type.
632
* \tparam W4 \deduced Argument type.
633
*/
634
template
<
typename
U,
typename
V,
typename
W1,
typename
W2,
typename
W3,
typename
W4>
635
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3, W4)>
636
{
637
/** Value. */
638
enum
639
{
640
IsPointerToMember = 1
/**< Pointer to member function. */
641
};
642
643
/** Value. */
enum
644
{
645
nArgs = 4
/**< Number of arguments. */
646
};
647
648
typedef
U
ReturnType
;
/**< Return type. */
649
typedef
W1
Arg1Type
;
/**< First argument type. */
650
typedef
W2
Arg2Type
;
/**< Second argument type. */
651
typedef
W3
Arg3Type
;
/**< Third argument type. */
652
typedef
W4
Arg4Type
;
/**< Fourth argument type. */
653
};
654
655
/**
656
* Pointer to const member function.
657
* \tparam U \deduced Return type.
658
* \tparam V \deduced Class type.
659
* \tparam W1 \deduced Argument type.
660
* \tparam W2 \deduced Argument type.
661
* \tparam W3 \deduced Argument type.
662
* \tparam W4 \deduced Argument type.
663
*/
664
template
<
typename
U,
typename
V,
typename
W1,
typename
W2,
typename
W3,
typename
W4>
665
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3, W4) const>
666
{
667
/** Value. */
668
enum
669
{
670
IsPointerToMember = 1
/**< Pointer to member function. */
671
};
672
673
/** Value. */
enum
674
{
675
nArgs = 4
/**< Number of arguments. */
676
};
677
678
typedef
U
ReturnType
;
/**< Return type. */
679
typedef
W1
Arg1Type
;
/**< First argument type. */
680
typedef
W2
Arg2Type
;
/**< Second argument type. */
681
typedef
W3
Arg3Type
;
/**< Third argument type. */
682
typedef
W4
Arg4Type
;
/**< Fourth argument type. */
683
};
684
685
/**
686
* Pointer to member function.
687
* \tparam U \deduced Return type.
688
* \tparam V \deduced Class type.
689
* \tparam W1 \deduced Argument type.
690
* \tparam W2 \deduced Argument type.
691
* \tparam W3 \deduced Argument type.
692
* \tparam W4 \deduced Argument type.
693
* \tparam W5 \deduced Argument type.
694
*/
695
template
<
typename
U,
696
typename
V,
697
typename
W1,
698
typename
W2,
699
typename
W3,
700
typename
W4,
701
typename
W5>
702
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3, W4, W5)>
703
{
704
/** Value. */
705
enum
706
{
707
IsPointerToMember = 1
/**< Pointer to member function. */
708
};
709
710
/** Value. */
enum
711
{
712
nArgs = 5
/**< Number of arguments. */
713
};
714
715
typedef
U
ReturnType
;
/**< Return type. */
716
typedef
W1
Arg1Type
;
/**< First argument type. */
717
typedef
W2
Arg2Type
;
/**< Second argument type. */
718
typedef
W3
Arg3Type
;
/**< Third argument type. */
719
typedef
W4
Arg4Type
;
/**< Fourth argument type. */
720
typedef
W5
Arg5Type
;
/**< Fifth argument type. */
721
};
722
723
/**
724
* Pointer to const member function.
725
* \tparam U \deduced Return type.
726
* \tparam V \deduced Class type.
727
* \tparam W1 \deduced Argument type.
728
* \tparam W2 \deduced Argument type.
729
* \tparam W3 \deduced Argument type.
730
* \tparam W4 \deduced Argument type.
731
* \tparam W5 \deduced Argument type.
732
*/
733
template
<
typename
U,
734
typename
V,
735
typename
W1,
736
typename
W2,
737
typename
W3,
738
typename
W4,
739
typename
W5>
740
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3, W4, W5) const>
741
{
742
/** Value. */
743
enum
744
{
745
IsPointerToMember = 1
/**< Pointer to member function. */
746
};
747
748
/** Value. */
enum
749
{
750
nArgs = 5
/**< Number of arguments. */
751
};
752
753
typedef
U
ReturnType
;
/**< Return type. */
754
typedef
W1
Arg1Type
;
/**< First argument type. */
755
typedef
W2
Arg2Type
;
/**< Second argument type. */
756
typedef
W3
Arg3Type
;
/**< Third argument type. */
757
typedef
W4
Arg4Type
;
/**< Fourth argument type. */
758
typedef
W5
Arg5Type
;
/**< Fifth argument type. */
759
};
760
761
/**
762
* Pointer to member function.
763
* \tparam U \deduced Return type.
764
* \tparam V \deduced Class type.
765
* \tparam W1 \deduced Argument type.
766
* \tparam W2 \deduced Argument type.
767
* \tparam W3 \deduced Argument type.
768
* \tparam W4 \deduced Argument type.
769
* \tparam W5 \deduced Argument type.
770
* \tparam W6 \deduced Argument type.
771
*/
772
template
<
typename
U,
773
typename
V,
774
typename
W1,
775
typename
W2,
776
typename
W3,
777
typename
W4,
778
typename
W5,
779
typename
W6>
780
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3, W4, W5, W6)>
781
{
782
/** Value. */
783
enum
784
{
785
IsPointerToMember = 1
/**< Pointer to member function. */
786
};
787
788
/** Value. */
enum
789
{
790
nArgs = 6
/**< Number of arguments. */
791
};
792
793
typedef
U
ReturnType
;
/**< Return type. */
794
typedef
W1
Arg1Type
;
/**< First argument type. */
795
typedef
W2
Arg2Type
;
/**< Second argument type. */
796
typedef
W3
Arg3Type
;
/**< Third argument type. */
797
typedef
W4
Arg4Type
;
/**< Fourth argument type. */
798
typedef
W5
Arg5Type
;
/**< Fifth argument type. */
799
typedef
W6
Arg6Type
;
/**< Sixth argument type. */
800
};
801
802
/**
803
* Pointer to const member function.
804
* \tparam U \deduced Return type.
805
* \tparam V \deduced Class type.
806
* \tparam W1 \deduced Argument type.
807
* \tparam W2 \deduced Argument type.
808
* \tparam W3 \deduced Argument type.
809
* \tparam W4 \deduced Argument type.
810
* \tparam W5 \deduced Argument type.
811
* \tparam W6 \deduced Argument type.
812
*/
813
template
<
typename
U,
814
typename
V,
815
typename
W1,
816
typename
W2,
817
typename
W3,
818
typename
W4,
819
typename
W5,
820
typename
W6>
821
struct
PtrToMemberTraits
<U (V::*)(W1, W2, W3, W4, W5, W6) const>
822
{
823
/** Value. */
824
enum
825
{
826
IsPointerToMember = 1
/**< Pointer to member function. */
827
};
828
829
/** Value. */
enum
830
{
831
nArgs = 6
/**< Number of arguments. */
832
};
833
834
typedef
U
ReturnType
;
/**< Return type. */
835
typedef
W1
Arg1Type
;
/**< First argument type. */
836
typedef
W2
Arg2Type
;
/**< Second argument type. */
837
typedef
W3
Arg3Type
;
/**< Third argument type. */
838
typedef
W4
Arg4Type
;
/**< Fourth argument type. */
839
typedef
W5
Arg5Type
;
/**< Fifth argument type. */
840
typedef
W6
Arg6Type
;
/**< Sixth argument type. */
841
};
842
843
public
:
844
/** Not a const type. */
845
typedef
typename
UnConst<T>::Result
NonConstType
;
846
/** Referenced type. */
847
typedef
typename
ReferenceTraits<T>::ReferencedType
ReferencedType
;
848
/** Pointee type. */
849
typedef
typename
PointerTraits<T>::PointeeType
PointeeType
;
850
/** Base type, after removing \c &, \c * and \c const. */
851
typedef
typename
Base<T>::Type
BaseType
;
852
/** Ptr base type. */
853
typedef
typename
PtrBase<T>::Type
PtrBaseType
;
854
855
/** Predicates. */
856
enum
857
{
858
/** Pointer to member predicate. */
859
IsPointerToMember =
PtrToMemberTraits<T>::IsPointerToMember
,
860
/** Pointer predicate. */
861
IsPointer =
PointerTraits<T>::IsPointer
,
862
/** Ptr predicate. */
863
IsPtr =
PointerTraits<T>::IsPtr
,
864
/** Reference predicate. */
865
IsReference =
ReferenceTraits<T>::IsReference
,
866
/** Function pointer predicate. */
867
IsFunctionPointer =
FunctionPtrTraits<T>::IsFunctionPointer
868
};
869
870
/** Pointer to member traits type. */
871
typedef
PtrToMemberTraits<T>
PointerToMemberTraits
;
872
/** Function pointer traits. */
873
typedef
FunctionPtrTraits<T>
FunctionPointerTraits
;
874
};
875
876
}
// namespace ns3
877
878
#endif
/* TYPE_TRAITS_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
deprecated.h
NS_DEPRECATED macro definition.
NS_DEPRECATED_3_43
#define NS_DEPRECATED_3_43(msg)
Tag for things deprecated in version ns-3.43.
Definition
deprecated.h:91
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ptr.h
ns3::Ptr smart pointer declaration and implementation.
ns3::TypeTraits::Base< U * >::Type
Base< U >::Type Type
Base type.
Definition
type-traits.h:167
ns3::TypeTraits::Base< U & >::Type
Base< U >::Type Type
Base type.
Definition
type-traits.h:157
ns3::TypeTraits::Base< const U >::Type
Base< U >::Type Type
Base type.
Definition
type-traits.h:177
ns3::TypeTraits::Base
Base type, after removing &, * and const.
Definition
type-traits.h:146
ns3::TypeTraits::Base::Type
U Type
Base type.
Definition
type-traits.h:147
ns3::TypeTraits::FunctionPtrTraits< U(*)()>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:234
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5, V6)>::Arg4Type
V4 Arg4Type
Fourth argument type.
Definition
type-traits.h:406
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5, V6)>::Arg1Type
V1 Arg1Type
First argument type.
Definition
type-traits.h:403
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5, V6)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:402
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5, V6)>::Arg5Type
V5 Arg5Type
Fifth argument type.
Definition
type-traits.h:407
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5, V6)>::Arg3Type
V3 Arg3Type
Third argument type.
Definition
type-traits.h:405
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5, V6)>::Arg2Type
V2 Arg2Type
Second argument type.
Definition
type-traits.h:404
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5, V6)>::Arg6Type
V6 Arg6Type
Sixth argument type.
Definition
type-traits.h:408
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5)>::Arg4Type
V4 Arg4Type
Fourth argument type.
Definition
type-traits.h:368
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5)>::Arg3Type
V3 Arg3Type
Third argument type.
Definition
type-traits.h:367
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5)>::Arg2Type
V2 Arg2Type
Second argument type.
Definition
type-traits.h:366
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5)>::Arg1Type
V1 Arg1Type
First argument type.
Definition
type-traits.h:365
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:364
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4, V5)>::Arg5Type
V5 Arg5Type
Fifth argument type.
Definition
type-traits.h:369
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4)>::Arg3Type
V3 Arg3Type
Third argument type.
Definition
type-traits.h:337
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:334
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4)>::Arg4Type
V4 Arg4Type
Fourth argument type.
Definition
type-traits.h:338
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4)>::Arg1Type
V1 Arg1Type
First argument type.
Definition
type-traits.h:335
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3, V4)>::Arg2Type
V2 Arg2Type
Second argument type.
Definition
type-traits.h:336
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3)>::Arg1Type
V1 Arg1Type
First argument type.
Definition
type-traits.h:307
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3)>::Arg3Type
V3 Arg3Type
Third argument type.
Definition
type-traits.h:309
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3)>::Arg2Type
V2 Arg2Type
Second argument type.
Definition
type-traits.h:308
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2, V3)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:306
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:280
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2)>::Arg2Type
V2 Arg2Type
Second argument type.
Definition
type-traits.h:282
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1, V2)>::Arg1Type
V1 Arg1Type
First argument type.
Definition
type-traits.h:281
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1)>::Arg1Type
V1 Arg1Type
First argument type.
Definition
type-traits.h:257
ns3::TypeTraits::FunctionPtrTraits< U(*)(V1)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:256
ns3::TypeTraits::FunctionPtrTraits
Not a function pointer type.
Definition
type-traits.h:206
ns3::TypeTraits::FunctionPtrTraits::ReturnType
NullType ReturnType
Return type.
Definition
type-traits.h:213
ns3::TypeTraits::NullType
Null value type traits.
Definition
type-traits.h:34
ns3::TypeTraits::PointerTraits< U * >::PointeeType
U PointeeType
Pointee type.
Definition
type-traits.h:120
ns3::TypeTraits::PointerTraits< ns3::Ptr< U > >::PointeeType
U PointeeType
Pointee type.
Definition
type-traits.h:137
ns3::TypeTraits::PointerTraits
Not a pointer type.
Definition
type-traits.h:95
ns3::TypeTraits::PointerTraits::PointeeType
U PointeeType
Base type.
Definition
type-traits.h:103
ns3::TypeTraits::PtrBase< ns3::Ptr< U > >::Type
U Type
Base type.
Definition
type-traits.h:197
ns3::TypeTraits::PtrBase
Base type of a Ptr.
Definition
type-traits.h:186
ns3::TypeTraits::PtrBase::Type
U Type
Base type.
Definition
type-traits.h:187
ns3::TypeTraits::PtrToMemberTraits< U(V::*)() const >::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:466
ns3::TypeTraits::PtrToMemberTraits< U(V::*)()>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:444
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:793
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6)>::Arg5Type
W5 Arg5Type
Fifth argument type.
Definition
type-traits.h:798
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6)>::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:794
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6)>::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:796
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6)>::Arg4Type
W4 Arg4Type
Fourth argument type.
Definition
type-traits.h:797
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6)>::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:795
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6)>::Arg6Type
W6 Arg6Type
Sixth argument type.
Definition
type-traits.h:799
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5)>::Arg5Type
W5 Arg5Type
Fifth argument type.
Definition
type-traits.h:720
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5)>::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:717
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5)>::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:716
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5)>::Arg4Type
W4 Arg4Type
Fourth argument type.
Definition
type-traits.h:719
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5)>::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:718
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:715
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4) const >::Arg4Type
W4 Arg4Type
Fourth argument type.
Definition
type-traits.h:682
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4) const >::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:678
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4) const >::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:681
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4) const >::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:680
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4) const >::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:679
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4)>::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:649
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4)>::Arg4Type
W4 Arg4Type
Fourth argument type.
Definition
type-traits.h:652
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:648
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4)>::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:651
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4)>::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:650
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3) const >::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:619
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3) const >::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:621
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3) const >::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:620
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3) const >::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:622
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3)>::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:594
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3)>::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:592
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3)>::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:593
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:591
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5) const >::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:755
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5) const >::Arg5Type
W5 Arg5Type
Fifth argument type.
Definition
type-traits.h:758
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5) const >::Arg4Type
W4 Arg4Type
Fourth argument type.
Definition
type-traits.h:757
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5) const >::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:754
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5) const >::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:753
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5) const >::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:756
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6) const >::Arg6Type
W6 Arg6Type
Sixth argument type.
Definition
type-traits.h:840
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6) const >::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:835
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6) const >::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:836
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6) const >::Arg5Type
W5 Arg5Type
Fifth argument type.
Definition
type-traits.h:839
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6) const >::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:834
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6) const >::Arg4Type
W4 Arg4Type
Fourth argument type.
Definition
type-traits.h:838
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2, W3, W4, W5, W6) const >::Arg3Type
W3 Arg3Type
Third argument type.
Definition
type-traits.h:837
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2) const >::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:565
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2) const >::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:566
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2) const >::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:564
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2)>::Arg2Type
W2 Arg2Type
Second argument type.
Definition
type-traits.h:540
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2)>::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:539
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1, W2)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:538
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1) const >::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:513
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1) const >::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:514
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1)>::ReturnType
U ReturnType
Return type.
Definition
type-traits.h:489
ns3::TypeTraits::PtrToMemberTraits< U(V::*)(W1)>::Arg1Type
W1 Arg1Type
First argument type.
Definition
type-traits.h:490
ns3::TypeTraits::PtrToMemberTraits
Not a pointer to member type.
Definition
type-traits.h:417
ns3::TypeTraits::ReferenceTraits< U & >::ReferencedType
U ReferencedType
Base type.
Definition
type-traits.h:86
ns3::TypeTraits::ReferenceTraits
Not a reference type.
Definition
type-traits.h:63
ns3::TypeTraits::ReferenceTraits::ReferencedType
U ReferencedType
Base type.
Definition
type-traits.h:70
ns3::TypeTraits::UnConst< const U >::Result
U Result
Non-const type.
Definition
type-traits.h:54
ns3::TypeTraits::UnConst
Not a const type.
Definition
type-traits.h:43
ns3::TypeTraits::UnConst::Result
U Result
Non-const type.
Definition
type-traits.h:44
ns3::TypeTraits
Inspect a type to deduce its features.
Definition
type-traits.h:30
ns3::TypeTraits::ReferencedType
ReferenceTraits< T >::ReferencedType ReferencedType
Referenced type.
Definition
type-traits.h:847
ns3::TypeTraits::PointerToMemberTraits
PtrToMemberTraits< T > PointerToMemberTraits
Pointer to member traits type.
Definition
type-traits.h:871
ns3::TypeTraits::PtrBaseType
PtrBase< T >::Type PtrBaseType
Ptr base type.
Definition
type-traits.h:853
ns3::TypeTraits::FunctionPointerTraits
FunctionPtrTraits< T > FunctionPointerTraits
Function pointer traits.
Definition
type-traits.h:873
ns3::TypeTraits::BaseType
Base< T >::Type BaseType
Base type, after removing &, * and const.
Definition
type-traits.h:851
ns3::TypeTraits::PointeeType
PointerTraits< T >::PointeeType PointeeType
Pointee type.
Definition
type-traits.h:849
ns3::TypeTraits::NonConstType
UnConst< T >::Result NonConstType
Not a const type.
Definition
type-traits.h:845
src
core
model
type-traits.h
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0