1 #ifndef GENESIS_POPULATION_WINDOW_WINDOW_VIEW_STREAM_H_
2 #define GENESIS_POPULATION_WINDOW_WINDOW_VIEW_STREAM_H_
45 namespace population {
73 template<
class InputStreamIterator,
class Data =
typename InputStreamIterator::value_type>
75 InputStreamIterator, Data, ::genesis::population::WindowView<Data>
95 std::is_same<WindowViewStream, self_type>::value,
"WindowViewStream != self_type"
99 using InputType =
typename InputStreamIterator::value_type;
119 InputStreamIterator, DataType, WindowViewType
140 using InputType =
typename InputStreamIterator::value_type;
149 std::is_same<DerivedIterator, self_type>::value,
"DerivedIterator != self_type"
171 current_ = parent_->window_stream_->begin();
172 end_ = parent_->window_stream_->end();
175 if( current_ == end_ ) {
189 DerivedIterator(
self_type const& ) =
default;
190 DerivedIterator(
self_type&& ) =
default;
203 void increment_() override final
211 if( current_ == end_ ) {
221 value_type& get_current_window_() const override final
223 return const_cast<value_type&
>( window_view_ );
226 base_type const* get_parent_() const override final
254 std::unique_ptr<WrappedWindowStream> window_iterator
256 : window_stream_( std::move( window_iterator ))
275 std::unique_ptr<typename base_type::BaseIterator>
284 std::unique_ptr<typename base_type::BaseIterator>
287 return std::unique_ptr<DerivedIterator>(
new DerivedIterator(
nullptr ));
298 std::unique_ptr<WrappedWindowStream> window_stream_;
316 WindowViewStream<typename T::InputStreamType, typename T::DataType>
318 T
const& window_iterator
320 using InputStreamType =
typename T::InputStreamType;
321 using DataType =
typename T::DataType;
325 std::unique_ptr<BaseWindowStreamType>(
new T{ window_iterator })
336 WindowViewStream<typename T::InputStreamType, typename T::DataType>
340 using InputStreamType =
typename T::InputStreamType;
341 using DataType =
typename T::DataType;
345 std::unique_ptr<BaseWindowStreamType>(
new T{ std::move( window_iterator )})
352 #endif // include guard