Support Class Library
A set of tools providing classes and utility
EndStreamIterator.h
Go to the documentation of this file.
1 #pragma once
7 
8 namespace scl{
9  namespace stream{
10  namespace details{
11  namespace iterator{
17  template <class Ret, class T>
18  class EndStreamIterator : public virtual StreamIterator<T>{
19  public:
25 
30  using result_type = Ret;
31 
37 
43 
45 
50  virtual result_type process() = 0;
51 
56  parent_type parent() const{ return this->parent_; }
57 
62  explicit EndStreamIterator(parent_type p) : parent_{std::move(p)}{
63  }
64 
68  bool hasNext() const override{ return this->parent_->hasNext(); }
69 
73  payload_type next() override{ return this->parent_->next(); }
74 
78  StlAdapter<T> begin() override{
79  return this->parent_->begin();
80  }
81 
85  StlAdapter<T> end() override{
86  return this->parent_->end();
87  }
88 
89  protected:
95  };
96  }
97  }
98  }
99 }
Abstract base class for stream iterators defining the required behavior.
Definition: StlAdapter.h:11
Iterator powering an intermediate operation.
StreamIteratorPayload< T > payload_type
Type alias for the payload used.
Global namespace of the SCL.
Definition: alias.hpp:3
virtual result_type process()=0
Process the return value.
typename OpStreamIterator< T >::parent_type parent_type
parent_type parent() const
Getter for the parent iterator.
EndStreamIterator(parent_type p)
Construct from a parent iterator.
A class for iterators that start a stream chain.
parent_type parent_
This iterator&#39;s parent.
An adapter for STL-like iterators from stream iterators.
Definition: StlAdapter.h:18
A class for iterators used in end operations.
A class representing a stream iterator&#39;s payload.
Definition: payload.h:16
void result_type
Type alias for the computed result.