| 108 | /// A random access iterator over the bytes in a buffer sequence. |
| 109 | template <typename BufferSequence, typename ByteType = char> |
| 110 | class buffers_iterator |
| 111 | { |
| 112 | private: |
| 113 | typedef typename detail::buffers_iterator_types< |
| 114 | BufferSequence, ByteType>::buffer_type buffer_type; |
| 115 | |
| 116 | typedef typename detail::buffers_iterator_types<BufferSequence, |
| 117 | ByteType>::const_iterator buffer_sequence_iterator_type; |
| 118 | |
| 119 | public: |
| 120 | /// The type used for the distance between two iterators. |
| 121 | typedef std::ptrdiff_t difference_type; |
| 122 | |
| 123 | /// The type of the value pointed to by the iterator. |
| 124 | typedef ByteType value_type; |
| 125 | |
| 126 | #if defined(GENERATING_DOCUMENTATION) |
| 127 | /// The type of the result of applying operator->() to the iterator. |
| 128 | /** |
| 129 | * If the buffer sequence stores buffer objects that are convertible to |
| 130 | * mutable_buffer, this is a pointer to a non-const ByteType. Otherwise, a |
| 131 | * pointer to a const ByteType. |
| 132 | */ |
| 133 | typedef const_or_non_const_ByteType* pointer; |
| 134 | #else // defined(GENERATING_DOCUMENTATION) |
| 135 | typedef typename detail::buffers_iterator_types< |
| 136 | BufferSequence, ByteType>::byte_type* pointer; |
| 137 | #endif // defined(GENERATING_DOCUMENTATION) |
| 138 | |
| 139 | #if defined(GENERATING_DOCUMENTATION) |
| 140 | /// The type of the result of applying operator*() to the iterator. |
| 141 | /** |
| 142 | * If the buffer sequence stores buffer objects that are convertible to |
| 143 | * mutable_buffer, this is a reference to a non-const ByteType. Otherwise, a |
| 144 | * reference to a const ByteType. |
| 145 | */ |
| 146 | typedef const_or_non_const_ByteType& reference; |
| 147 | #else // defined(GENERATING_DOCUMENTATION) |
| 148 | typedef typename detail::buffers_iterator_types< |
| 149 | BufferSequence, ByteType>::byte_type& reference; |
| 150 | #endif // defined(GENERATING_DOCUMENTATION) |
| 151 | |
| 152 | /// The iterator category. |
| 153 | typedef std::random_access_iterator_tag iterator_category; |
| 154 | |
| 155 | /// Default constructor. Creates an iterator in an undefined state. |
| 156 | buffers_iterator() |
| 157 | : current_buffer_(), |
| 158 | current_buffer_position_(0), |
| 159 | begin_(), |
| 160 | current_(), |
| 161 | end_(), |
| 162 | position_(0) |
| 163 | { |
| 164 | } |
| 165 | |
| 166 | /// Construct an iterator representing the beginning of the buffers' data. |
| 167 | static buffers_iterator begin(const BufferSequence& buffers) |
nothing calls this directly
no test coverage detected