18 #ifndef RTI_ROUTING_PROCESSOR_SAMPLE_ITERATOR_HPP_
19 #define RTI_ROUTING_PROCESSOR_SAMPLE_ITERATOR_HPP_
22 #include <rti/routing/processor/LoanedSample.hpp>
25 namespace rti {
namespace routing {
namespace processor {
35 template <
typename T,
typename U>
39 typedef std::random_access_iterator_tag iterator_category;
40 typedef const LoanedSample<T,U> value_type;
41 typedef value_type reference;
42 typedef value_type pointer;
43 typedef std::ptrdiff_t difference_type;
44 typedef RTI_RoutingServiceSample* SampleSeqType;
45 typedef RTI_RoutingServiceSampleInfo* InfoSeqType;
55 const SampleSeqType sample_seq,
56 const InfoSeqType info_seq,
59 : _sample_seq(sample_seq),
66 : _sample_seq(other._sample_seq),
67 _info_seq(other._info_seq),
68 _length(other._length),
74 _sample_seq = other._sample_seq;
75 _info_seq = other._info_seq;
76 _length = other._length;
82 value_type operator * ()
const {
83 return value_type(_sample_seq[_pos], _info_seq[_pos]);
86 value_type operator ->()
const {
87 return value_type(_sample_seq[_pos], _info_seq[_pos]);
90 value_type operator [] (difference_type offset)
const {
91 return value_type(_sample_seq[_pos + offset], _info_seq[_pos + offset]);
138 return s1._pos - s2._pos;
143 return s1._pos < s2._pos;
148 return s1._pos > s2._pos;
153 return s1._pos <= s2._pos;
158 return s1._pos >= s2._pos;
163 return (s1._sample_seq == s2._sample_seq) && (s1._pos == s2._pos);
171 bool is_end()
const {
172 return (_length == _pos);
178 SampleSeqType _sample_seq;
179 InfoSeqType _info_seq;
187 #endif // RTI_ROUTING_PROCESSOR_SAMPLE_ITERATOR_HPP_