Support Class Library
A set of tools providing classes and utility
StreamIterator.h
Go to the documentation of this file.
1 #pragma once
4 #include <scl/macros.h>
5 
6 namespace scl{
7  namespace stream{
8  namespace details{
9  namespace iterator{
10  template <class>
11  class StlAdapter;
12 
17  template <class T>
18  class StreamIterator{
19  static_assert(!META::is_void<T>(), "Cannot make a StreamIterator<void>");
21 
22  public:
28 
34 
39  virtual bool hasNext() const = 0;
40 
45  virtual payload_type next() = 0;
46 
51  virtual StlAdapter<T> begin(){
52  return StlAdapter<T>{this};
53  }
54 
59  virtual StlAdapter<T> end(){
60  return StlAdapter<T>{};
61  }
62  };
63  }
64  }
65  }
66 }
virtual payload_type next()=0
Retrieve the next iterator payload.
typename payload_type::value_type value_type
Type alias for the data type manipulated.
Global namespace of the SCL.
Definition: alias.hpp:3
virtual StlAdapter< T > end()
Retrieve a stl-like iterator for the end of this stream iterator.
virtual StlAdapter< T > begin()
Retrieve a stl-like iterator for this stream iterator.
T value_type
The type of value stored.
Definition: payload.h:32
An adapter for STL-like iterators from stream iterators.
Definition: StlAdapter.h:18
Copyable concept, a type is copyable if it is both copy constructible and copy assignable.
Definition: Copyable.h:16
virtual bool hasNext() const =0
Determines whether or not this iterator can produce another value payload.
#define static_require(cpt)
Definition: macros.h:6
A class representing a stream iterator&#39;s payload.
Definition: payload.h:16