-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatusImpl.h
More file actions
1240 lines (1067 loc) · 40.4 KB
/
Copy pathStatusImpl.h
File metadata and controls
1240 lines (1067 loc) · 40.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef DCPS_Status_StatusImpl_h_Included
#define DCPS_Status_StatusImpl_h_Included
#include"DCPS/CommonDefines.h"
#include"DCPS/Status/State.h"
#include"DCPS/Export.h"
namespace DCPS { namespace Status { namespace Impl
{
/**
* @brief Count number of inconsistent topics
*
* @arg totalCount_
* Total cumulative count of the Topics discovered whose name matches
* the Topic to which this status is attached and whose type is
* inconsistent with the Topic.
*
* @arg totalCountChange_
* The incremental number of inconsistent topics discovered since the
* last time the listener was called or the status was read.
*/
class DLL_STATE InconsistentTopicStatusImpl
{
public:
InconsistentTopicStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
{ }
InconsistentTopicStatusImpl(int32_t totalCount, int32_t totalCountChange)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
{ }
CLASS_TRAITS(InconsistentTopicStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const InconsistentTopicStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ && totalCountChange_ == other.totalCountChange_);
}
bool operator!=(const InconsistentTopicStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const InconsistentTopicStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const InconsistentTopicStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const InconsistentTopicStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const InconsistentTopicStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
};
/**
* @brief Count number of samples lost
*
* @arg totalCount_
* Total cumulative count of all samples lost across of instances
* of data published under the Topic.
*
* @arg totalCountChange_
* The incremental number of samples lost since the last time the
* listener was called or the status was read.
*/
class DLL_STATE SampleLostStatusImpl
{
public:
SampleLostStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
{ }
SampleLostStatusImpl(int32_t totalCount, int32_t totalCountChange)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
{ }
CLASS_TRAITS(SampleLostStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const SampleLostStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ && totalCountChange_ == other.totalCountChange_);
}
bool operator!=(const SampleLostStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const SampleLostStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const SampleLostStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const SampleLostStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const SampleLostStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
};
/**
* @brief Count number of samples rejected
*
* @arg totalCount_
* Total cumulative count of samples rejected by the DataReader.
*
* @arg totalCountChange_
* The incremental number of samples rejected since the last time the listener
* was called or the status was read.
*
* @arg lastReason_
* Reason for rejecting the last sample rejected. If no samples have been
* rejected, the reason is the special value NOT_REJECTED.
*
* @arg lastInstanceHandle_
* Handle to the instance being updated by the last sample that was rejected.
*
*/
class DLL_STATE SampleRejectedStatusImpl
{
public:
SampleRejectedStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
, lastReason_(Status::SampleRejectedState::NotRejected())
, lastInstanceHandle_()
{ }
SampleRejectedStatusImpl(int32_t totalCount
, int32_t totalCountChange
, Status::SampleRejectedState lastReason
, InstanceHandle lastInstancHandle)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
, lastReason_(lastReason)
, lastInstanceHandle_(lastInstancHandle)
{ }
CLASS_TRAITS(SampleRejectedStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
Status::SampleRejectedState GetLastReason() const { return lastReason_; }
InstanceHandle GetLastInstanceHandle() const { return lastInstanceHandle_; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
void SetLastReason(const Status::SampleRejectedState &lastReason) { lastReason_ = lastReason; }
void SetLastInstanceHandle(const InstanceHandle &lastHandle) { lastInstanceHandle_ = lastHandle; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const SampleRejectedStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ &&
totalCountChange_ == other.totalCountChange_ &&
lastReason_ == other.lastReason_ &&
lastInstanceHandle_ == other.lastInstanceHandle_);
}
bool operator!=(const SampleRejectedStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const SampleRejectedStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const SampleRejectedStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const SampleRejectedStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const SampleRejectedStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
Status::SampleRejectedState lastReason_;
InstanceHandle lastInstanceHandle_;
};
/**
* @brief Count number of time a DataWriter failed to report alive
*
* @arg totalCount_
* Total cumulative number of times that a previously-alive DataWriter
* became not alive due to a failure to actively signal its liveliness within
* its offered liveliness period. This count does not change when an already
* not alive DataWriter simply remains not alive for another liveliness period.
*
* @arg totalCountChange_
* The change in total_count since the last time the listener was called or
* the status was read.
*/
class DLL_STATE LivelinessLostStatusImpl
{
public:
LivelinessLostStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
{ }
LivelinessLostStatusImpl(int32_t totalCount, int32_t totalCountChange)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
{ }
CLASS_TRAITS(LivelinessLostStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const LivelinessLostStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ && totalCountChange_ == other.totalCountChange_);
}
bool operator!=(const LivelinessLostStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const LivelinessLostStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const LivelinessLostStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const LivelinessLostStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const LivelinessLostStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
};
/**
* @brief Status on the number of times the liveliness of a DataWriter changed
*
* @arg aliveCount_
*
* The total number of currently active DataWriters that write the Topic
* read by the DataReader. This count increases when a newly matched
* DataWriter asserts its liveliness for the first time or when a DataWriter
* previously considered to be not alive reasserts its liveliness. The count
* decreases when a DataWriter considered alive fails to assert its liveliness
* and becomes not alive, whether because it was deleted normally or for some other reason.
*
* @arg notAliveCount_
*
* The total count of currently DataWriters that write the Topic read by
* the DataReader that are no longer asserting their liveliness. This count
* increases when a DataWriter considered alive fails to assert its
* liveliness and becomes not alive for some reason other than the normal
* deletion of that DataWriter. It decreases when a previously not alive
* DataWriter either reasserts its liveliness or is deleted normally.
*
* @arg aliveCountChange_
*
* The change in the alive_count since the last time the listener was
* called or the status was read.
*
* @arg notAliveCountChange_
*
* The change in the not_alive_count since the last time the listener was
* called or the status was read.
*
* @arg lastPublicationHandle_
*
* Handle to the last DataWriter whose change in liveliness caused this
* status to change.
*/
class DLL_STATE LivelinessChangedStatusImpl
{
public:
LivelinessChangedStatusImpl()
: aliveCount_(0)
, notAliveCount_(0)
, aliveCountChange_(0)
, notAliveCountChange_(0)
, lastPublicationHandle_()
{ }
LivelinessChangedStatusImpl(int32_t aliveCount
, int32_t notAliveCount
, int32_t aliveCountChange
, int32_t notAliveCountChange
, InstanceHandle lastPublicationHandle)
: aliveCount_(aliveCount)
, notAliveCount_(notAliveCount)
, aliveCountChange_(aliveCountChange)
, notAliveCountChange_(notAliveCountChange)
, lastPublicationHandle_(lastPublicationHandle)
{ }
CLASS_TRAITS(LivelinessChangedStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetAliveCount() const { return aliveCount_; }
int32_t GetNotAliveCount() const { return notAliveCount_; }
int32_t GetAliveCountChange() const { return aliveCountChange_; }
int32_t GetNotAliveCountChhange() const { return notAliveCountChange_; }
const InstanceHandle GetLastPublicationHandle() const
{
return lastPublicationHandle_;
}
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetAliveCount(int32_t aliveCount) { aliveCount_ = aliveCount; }
void SetNotAliveCount(int32_t notAliveCount) { notAliveCount_ = notAliveCount; }
void SetAliveCountChange(int32_t aliveCountChange) { aliveCountChange_ = aliveCountChange; }
void SetNotAliveCountChhange(int32_t notAliveCountChange) { notAliveCountChange_ = notAliveCountChange; }
void SetLastPublicationHandle(const InstanceHandle &lastPublicationHandle)
{
lastPublicationHandle_ = lastPublicationHandle;
}
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncAliveCount() { aliveCount_++; }
void IncAliveCountChange() { aliveCountChange_++; }
void IncNotAliveCount() { notAliveCount_++; }
void IncNotAliveCountChange() { notAliveCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const LivelinessChangedStatusImpl &other) const
{
return (aliveCount_ == other.aliveCount_ &&
notAliveCount_ == other.notAliveCount_ &&
aliveCountChange_ == other.aliveCountChange_ &&
notAliveCountChange_ == other.notAliveCountChange_);
}
bool operator!=(const LivelinessChangedStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const LivelinessChangedStatusImpl &other) const
{
return (aliveCount_ < other.aliveCount_ &&
notAliveCount_ < other.notAliveCount_);
}
bool operator<=(const LivelinessChangedStatusImpl &other) const
{
return (aliveCount_ <= other.aliveCount_ &&
notAliveCount_ <= other.notAliveCount_);
}
bool operator>(const LivelinessChangedStatusImpl &other) const
{
return (aliveCount_ > other.aliveCount_ &&
notAliveCount_ > other.notAliveCount_);
}
bool operator>=(const LivelinessChangedStatusImpl &other) const
{
return (aliveCount_ >= other.aliveCount_ &&
notAliveCount_ >= other.notAliveCount_);
}
protected:
int32_t aliveCount_;
int32_t notAliveCount_;
int32_t aliveCountChange_;
int32_t notAliveCountChange_;
InstanceHandle lastPublicationHandle_;
};
/**
* @brief Count number of deadline misses.
*
* @arg totalCount_
* Total cumulative number of offered deadline periods elapsed during
* which a DataWriter failed to provide data. Missed deadlines accumulate;
* that is, each deadline period the total_count will be incremented by one.
*
* @arg totalCountChange_
* The change in total_count since the last time the listener was called or
* the status was read.
*
* @arg lastInstanceHandle_
* Handle to the last instance in the DataWriter for which an offered
* deadline was missed.
*/
class DLL_STATE OfferedDeadlineMissedStatusImpl
{
public:
OfferedDeadlineMissedStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
, lastInstanceHandle_()
{ }
OfferedDeadlineMissedStatusImpl(int32_t totalCount
, int32_t totalCountChange
, InstanceHandle lastInstancHandle)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
, lastInstanceHandle_(lastInstancHandle)
{ }
CLASS_TRAITS(OfferedDeadlineMissedStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
InstanceHandle GetLastInstanceHandle() const { return lastInstanceHandle_; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
void SetLastInstanceHandle(const InstanceHandle &lastHandle) { lastInstanceHandle_ = lastHandle; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const OfferedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ &&
totalCountChange_ == other.totalCountChange_ &&
lastInstanceHandle_ == other.lastInstanceHandle_);
}
bool operator!=(const OfferedDeadlineMissedStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const OfferedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const OfferedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const OfferedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const OfferedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
InstanceHandle lastInstanceHandle_;
};
/**
* @brief Count number of deadline misses on DataReader.
*
* @arg totalCount_
* Total cumulative number of missed deadlines detected for any instance
* read by the DataReader. Missed deadlines accumulate; that is, each
* deadline period the total_count will be incremented by one for each
* instance for which data was not received.
*
* @arg totalCountChange_
* The change in total_count since the last time the listener was called or
* the status was read.
*
* @arg lastInstanceHandle_
* Handle to the last instance in the DataReader for which a deadline was
* detected.
*/
class DLL_STATE RequestedDeadlineMissedStatusImpl
{
public:
RequestedDeadlineMissedStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
, lastInstanceHandle_()
{ }
RequestedDeadlineMissedStatusImpl(int32_t totalCount
, int32_t totalCountChange
, InstanceHandle lastInstancHandle)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
, lastInstanceHandle_(lastInstancHandle)
{ }
CLASS_TRAITS(RequestedDeadlineMissedStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
InstanceHandle GetLastInstanceHandle() const { return lastInstanceHandle_; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
void SetLastInstanceHandle(const InstanceHandle &lastHandle) { lastInstanceHandle_ = lastHandle; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const RequestedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ &&
totalCountChange_ == other.totalCountChange_ &&
lastInstanceHandle_ == other.lastInstanceHandle_);
}
bool operator!=(const RequestedDeadlineMissedStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const RequestedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const RequestedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const RequestedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const RequestedDeadlineMissedStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
InstanceHandle lastInstanceHandle_;
};
/**
* @brief Status on how often there has been an incompatibility in the offered QoS.
*
* @arg totalCount_
* Total cumulative number of times the concerned DataWriter
* discovered a DataReader for the same Topic with a requested QoS that
* is incompatible with that offered by the DataWriter.
*
* @arg totalCountChange_
* The change in total_count since the last time the listener was called or
* the status was read.
*
* @arg lastPolicyId_
* The PolicyId_t of one of the policies that was found to be incompatible
* the last time an incompatibility was detected.
*
* @arg policies_
* A list containing for each policy the total number of times that the
* concerned DataWriter discovered a DataReader for the same Topic with
* a requested QoS that is incompatible with that offered by the DataWriter.
*/
class DLL_STATE OfferedIncompatibleQosStatusImpl
{
public:
OfferedIncompatibleQosStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
, lastPolicyId_(0)
, policies_()
{ }
OfferedIncompatibleQosStatusImpl(int32_t totalCount
, int32_t totalCountChange
, DDS::Policy::QosPolicyId lastPolicyId
, const DDS::Policy::QosPolicyCountSeq &policies)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
, lastPolicyId_(lastPolicyId)
, policies_(policies)
{ }
CLASS_TRAITS(OfferedIncompatibleQosStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
DDS::Policy::QosPolicyId GetLastPolicyId() const { return lastPolicyId_; }
DDS::Policy::QosPolicyCountSeq GetPolicies() const { return policies_; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
void SetLastPolicyId(const DDS::Policy::QosPolicyId &lastPolicyId) { lastPolicyId_ = lastPolicyId; }
void SetPolicies(const DDS::Policy::QosPolicyCountSeq &policies) { policies_ = policies; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const OfferedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ &&
totalCountChange_ == other.totalCountChange_ &&
lastPolicyId_ == other.lastPolicyId_);
// && policies_ == other.policies_);
}
bool operator!=(const OfferedIncompatibleQosStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const OfferedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const OfferedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const OfferedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const OfferedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
DDS::Policy::QosPolicyId lastPolicyId_;
DDS::Policy::QosPolicyCountSeq policies_;
};
/**
* @brief Status on how often there has been an incompatibility in the requested QoS.
*
* @arg totalCount_
* Total cumulative number of times the concerned DataReader
* discovered a DataWriter for the same Topic with an offered QoS that
* was incompatible with that requested by the DataReader.
*
* @arg totalCountChange_
* The change in total_count since the last time the listener was called or
* the status was read.
*
* @arg lastPolicyId_
* The PolicyId_t of one of the policies that was found to be incompatible
* the last time an incompatibility was detected.
*
* @arg policies_
* A list containing for each policy the total number of times that the
* concerned DataReader discovered a DataWriter for the same Topic
* with an offered QoS that is incompatible with that requested by the
* DataReader.
*/
class DLL_STATE RequestedIncompatibleQosStatusImpl
{
public:
RequestedIncompatibleQosStatusImpl()
: totalCount_(0)
, totalCountChange_(0)
, lastPolicyId_(0)
, policies_()
{ }
RequestedIncompatibleQosStatusImpl(int32_t totalCount
, int32_t totalCountChange
, DDS::Policy::QosPolicyId lastPolicyId
, const DDS::Policy::QosPolicyCountSeq &policies)
: totalCount_(totalCount)
, totalCountChange_(totalCountChange)
, lastPolicyId_(lastPolicyId)
, policies_(policies)
{ }
CLASS_TRAITS(RequestedIncompatibleQosStatusImpl)
public:
// ------------------------------------------------
// Getters
// ------------------------------------------------
int32_t GetTotalCount() const { return totalCount_; }
int32_t GetTotalCountChange() const { return totalCountChange_; }
DDS::Policy::QosPolicyId GetLastPolicyId() const { return lastPolicyId_; }
const DDS::Policy::QosPolicyCountSeq GetPolicies() const { return policies_; }
public:
// ------------------------------------------------
// Setters
// ------------------------------------------------
void SetTotalCount(int32_t totalCount) { totalCount_ = totalCount; }
void SetTotalCountChange(int32_t totalCountChange) { totalCountChange_ = totalCountChange; }
void SetLastPolicyId(const DDS::Policy::QosPolicyId &lastPolicyId) { lastPolicyId_ = lastPolicyId; }
void SetPolicies(const DDS::Policy::QosPolicyCountSeq &policies) { policies_ = policies; }
public:
// ------------------------------------------------
// Convenience functions
// ------------------------------------------------
void IncTotalCount() { totalCount_++; }
void IncTotalCountChange() { totalCountChange_++; }
public:
// ------------------------------------------------
// operator comparisons
// ------------------------------------------------
bool operator==(const RequestedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ == other.totalCount_ &&
totalCountChange_ == other.totalCountChange_ &&
lastPolicyId_ == other.lastPolicyId_);
//policies_ == other.policies_);
}
bool operator!=(const RequestedIncompatibleQosStatusImpl &other) const
{
return !(other == *this);
}
bool operator<(const RequestedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ < other.totalCount_);
}
bool operator<=(const RequestedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ <= other.totalCount_);
}
bool operator>(const RequestedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ > other.totalCount_);
}
bool operator>=(const RequestedIncompatibleQosStatusImpl &other) const
{
return (totalCount_ >= other.totalCount_);
}
protected:
int32_t totalCount_;
int32_t totalCountChange_;
DDS::Policy::QosPolicyId lastPolicyId_;
DDS::Policy::QosPolicyCountSeq policies_;
};
/**
* @brief Status on number of times publications were matched.
*
* @arg totalCount_
* Total cumulative count the concerned DataWriter discovered a
* "match" with a DataReader. That is, it found a DataReader for the
* same Topic with a requested QoS that is compatible with that offered
* by the DataWriter.
*
* @arg totalCountChange_
* The change in total_count since the last time the listener was called
* or the status was read.
*
* @arg currentCount_
* The number of DataReaders currently matched to the concerned DataWriter.
*
* @arg currentCountChange_
* The change in current_count since the last time the listener was called
* or the status was read.
*
* @arg lastSubscriptionHandle_
* Handle to the last DataReader that matched the DataWriter causing the
* status to change.
*/
class DLL_STATE PublicationMatchedStatusImpl
{
public:
PublicationMatchedStatusImpl()
: totalCount_(0)