uTL
micro Template library
dev_iterators.h
Go to the documentation of this file.
1 
21 #ifndef __utl_dev_dev_iterators_h__
22 #define __utl_dev_dev_iterators_h__
23 
24 #include <utl/core/impl.h>
25 #include <utl/meta/meta.h>
26 
27 namespace utl {
28 
33 
42  template <typename _Cat, typename _Tp, typename _Diff =ptrdiff_t>
44  using iterator_category = _Cat;
45  using value_type = _Tp;
46  using difference_type = _Diff;
47  using pointer = _Tp*;
48  using reference = _Tp&;
49  };
50 
56  struct input_iterator_tag {};
61 
62 
63 
64  /*
65  * ================ Output device Iterator =================
66  */
67 
68  template <typename cont_t, typename data_t>
69  class ostreamdev_it {
71  public:
72  using type = iterator_t;
73  public:
82 
83  private:
84  cont_t* owner_ {nullptr};
93  public:
96  ostreamdev_it (cont_t* owner =nullptr) noexcept
97  : owner_ {owner} { }
99  ostreamdev_it (const iterator_t& it) noexcept
100  : owner_ {const_cast<cont_t*>(it.owner_)} { }
102  iterator_t& operator= (const iterator_t& it) noexcept {
103  owner_ = const_cast<cont_t*>(it.owner_);
104  return *this;
105  }
107 
109  public:
110  iterator_t& operator* () noexcept { return *this; }
118  if (owner_ != nullptr)
119  owner_->put (value);
120  return *this;
121  }
122  iterator_t& operator++ () noexcept { return *this; }
123  iterator_t& operator++ (int) noexcept { return *this; }
125  };
126 
127  template <typename cont_t, typename data_t>
130  public:
131  using type = iterator_t;
132  public:
142  enum Cursor {
143  init = 0,
144  valid = 1,
145  eos = 2
146  };
148  private:
149  cont_t* owner_ {nullptr};
157 
160  public:
163  istreamdev_it (cont_t* owner =nullptr, Cursor cursor =eos) noexcept :
164  owner_ {owner},
165  value_ {},
166  cursor_{cursor} { }
168  istreamdev_it (const iterator_t& it) noexcept :
169  owner_ {const_cast<cont_t*>(it.owner_)},
170  value_ {it.value_},
171  cursor_ {it.cursor_} { }
173  iterator_t& operator= (const iterator_t& it) noexcept {
174  owner_ = const_cast<cont_t*>(it.owner_);
175  value_ = it.value_;
176  cursor_ = it.cursor_;
177  return *this;
178  }
180 
182  public:
183  value_type& operator* () noexcept {
184  if (cursor_ == init)
185  ++*this;
186  return value_;
187  }
188  value_type* operator->() noexcept {
189  if (cursor_ == init)
190  ++*this;
191  return &value_;
192  }
193  iterator_t& operator++ () noexcept {
194  _get(value_);
195  return *this;
196  }
197  iterator_t operator++ (int) noexcept {
198  iterator_t r = *this;
199  _get(value_);
200  return r;
201  }
202 
204  const cont_t* owner () const noexcept { return owner_; }
206  const value_type& value () const noexcept { return value_; }
208  const Cursor cursor () const noexcept { return cursor_; }
210 
212  private:
213  void _get(value_type& v) {
214  owner_->get(v);
215  cursor_ = (v) ? valid : eos;
216  }
218  };
219 
228  template<typename _C1, typename _D1, typename _C2, typename _D2>
229  inline bool operator== (const istreamdev_it<_C1, _D1>& lhs,
230  const istreamdev_it<_C2, _D2>& rhs) noexcept {
231  return ((lhs.owner() == rhs.owner()) &&
232  (lhs.value() == rhs.value()) &&
233  (lhs.cursor() == rhs.cursor()));
234  }
235  template<typename _C1, typename _D1, typename _C2, typename _D2>
236  inline bool operator!= (const istreamdev_it<_C1, _D1>& lhs,
237  const istreamdev_it<_C2, _D2>& rhs) noexcept {
238  return !operator==(lhs, rhs);
239  }
240 
249  template<typename cont_t, typename iter_t, index_t _beg =0, index_t _end =static_cast<index_t>(-1)>
250  class outdev_it {
253  public:
254  using type = iterator_t;
255  public:
265  enum Cursor {
266  beg = _beg,
267  eod = _end,
268  };
269  private:
270  cont_t* owner_ {nullptr};
277 
280  public:
283  explicit outdev_it() noexcept :
284  owner_ {nullptr},
285  cursor_{eod} { }
287  explicit outdev_it (cont_t* owner, index_t cursor =eod) noexcept :
288  owner_ {owner},
289  cursor_{cursor} { }
291  explicit outdev_it (const iterator_t& it) noexcept :
292  owner_ {const_cast<cont_t*>(it.owner_)},
293  cursor_{it.cursor_} { }
295  iterator_t& operator= (const iterator_t& it) noexcept {
296  owner_ = const_cast<cont_t*>(it.owner_);
297  cursor_ = it.cursor_;
298  }
301 // template<typename _It>
302 // outdev_it (const outdev_it<
303 // use_if_same_t <_It, typename container_t::pointer_type, container_t>,
304 // _It,
305 // streamsize
306 // >& it) noexcept
307 // : owner_ {const_cast<container_t*>(it.owner())},
308 // cursor_ {it.cursor()} { }
310 
311 
313  public:
314  iterator_t& operator* () noexcept { return *this; }
322  // end() and default constructible iterators are not dereferenceable
323  if (cursor_ != eod)
324  owner_->put (value, cursor_);
325  return *this;
326  }
327 
329  iterator_t& operator++ () noexcept {
330  ++cursor_;
331  return *this;
332  }
333  iterator_t operator++ (int) noexcept {
334  iterator_t ret = *this;
335  ++cursor_;
336  return ret;
337  }
339 
341  const cont_t* owner () const noexcept { return owner_; }
343  const index_t cursor () const noexcept { return cursor_; }
345  };
346 
355 
364  template<typename _Cont1, typename _It1, index_t _beg1, index_t _end1,
365  typename _Cont2, typename _It2, index_t _beg2, index_t _end2>
367  const outdev_it<_Cont2, _It2, _beg2, _end2>& rhs) noexcept {
368  return ((lhs.cursor() == rhs.cursor()) &&
369  (lhs.owner() == rhs.owner()));
370  }
371 
380  template<typename _Cont1, typename _It1, index_t _beg1, index_t _end1,
381  typename _Cont2, typename _It2, index_t _beg2, index_t _end2>
383  const outdev_it<_Cont2, _It2, _beg2, _end2>& rhs) noexcept {
384  return !(lhs == rhs);
385  }
387 
391  #if defined _utl_have_concepts
393  template <typename T>
394  concept bool Outdev_it = requires (T t) {
395  // STL compatibility
396  typename T::value_type;
397  typename T::difference_type;
398  typename T::pointer;
399  typename T::reference;
400  requires same_<
401  typename T::iterator_category,
402  std::output_iterator_tag
403  >::value;
404  {*t} -> auto&&; // is dereferencable, and return non-void
405  {++t} -> T&; // is incrementable
406  {t++} -> T;
407  // Extras
408  {t.owner()} ->auto&&;
409  {t.cursor()} -> size_t;
410  };
411  #else
412  namespace outdev_it_details {
413  using std::declval;
414 
416  template <typename _Tp, typename =void>
418 
420  template <typename _Tp>
421  struct is_outdev_it_ <
422  _Tp,
423  meta::void_t <
424  typename _Tp::value_type,
425  typename _Tp::difference_type,
426  typename _Tp::pointer,
427  typename _Tp::reference,
428 // meta::use_if_same_t <
429 // typename _Tp::iterator_category,
430 // std::output_iterator_tag
431 // >
432  void
433  >
434  > : meta::true_ {};
435  }
441 // template <typename _Tp>
442 // constexpr bool Outdev_it = outdev_it_details::is_outdev_it_<_Tp>::value;
443  #endif
444 
446 
447  /*
448  * ================ Input device Iterator =================
449  */
450 
460  template<typename cont_t, typename iter_t, index_t _beg =0, size_t _size = static_cast<size_t>(-1)-_beg>
461  class indev_it {
464  public:
465  using type = iterator_t;
466  public:
475 
477  enum Cursor {
478  beg = _beg,
479  eod = _beg + _size,
480  };
481 
482  private:
483  cont_t* owner_{nullptr};
490 
497  public:
500  indev_it () noexcept :
501  owner_ {nullptr},
502  cursor_{eod},
503  value_ {} { }
505  explicit indev_it (cont_t* own, size_t cur =eod) noexcept :
506  owner_ {own},
507  cursor_{cur},
508  value_ {} { }
510  explicit indev_it (const iterator_t& it) noexcept :
511  owner_ {const_cast<cont_t*>(it.owner_)},
512  cursor_{it.cursor_},
513  value_ {it.value_} { }
515  iterator_t& operator= (const iterator_t& it) noexcept {
516  owner_ = const_cast<cont_t*>(it.owner_);
517  cursor_ = it.cursor_;
518  value_ = it.value_;
519  }
522 // template<typename _It>
523 // indev_it (const indev_it<
524 // use_if_same_t <_It, typename container_t::pointer_type, container_t>,
525 // _It,
526 // streamsize
527 // >& it) noexcept
528 // : owner_ {const_cast<container_t*>(it.owner())},
529 // cursor_{it.cursor()},
530 // value_ {it.value()} { }
531 
533 
535  public:
538  owner_->get (value_, cursor_);
539  return value_;
540  }
543  owner_->get (value_, cursor_);
544  return &value_;
545  }
546 
549  ++cursor_;
550  return *this;
551  }
554  iterator_t ret(*this);
555  ++cursor_;
556  return *this;
557  }
558 
561  --cursor_;
562  return *this;
563  }
566  iterator_t ret(*this);
567  --cursor_;
568  return *this;
569  }
572  owner_->get (value_, cursor_ += n);
573  return value_;
574  }
575 
577  cursor_ += n;
578  return *this;
579  }
581  return iterator_t (owner_, cursor_ + n);
582  }
584  cursor_ -= n;
585  return *this;
586  }
588  return iterator_t (owner_, cursor_ - n);
589  }
591  const cont_t* owner () const noexcept { return owner_; }
593  const index_t cursor () const noexcept { return cursor_; }
595  //const reference value () const noexcept { return value_; }
597  };
598 
604  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
607  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
609  const indev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
610  return (x.owner() == y.owner() &&
611  (x.cursor() == y.cursor()));
612  }
614  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
615  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
616  inline bool operator< (const indev_it<_Cont1, _It1, _beg1, _size1>& x,
617  const indev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
618  return (x.cursor() < y.cursor());
619  }
620 
621  // relative ops
622  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
623  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
625  const indev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
626  return !(x == y);
627  }
628  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
629  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
630  inline bool operator<= (const indev_it<_Cont1, _It1, _beg1, _size1>& x,
631  const indev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
632  return !(y < x);
633  }
634  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
635  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
637  const indev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
638  return (y < x);
639  }
640  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
641  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
643  const indev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
644  return !(x < y);
645  }
647 
649  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
650  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
653  -> decltype (x.cursor() - y.cursor()) {
654  return (x.cursor() - y.cursor());
655  }
656 
657  template<typename _Cont, typename _It, index_t _beg, size_t _size>
658  inline indev_it<_Cont, _It, _beg, _size>
659  operator+ (typename _Cont::difference_type n,
660  indev_it<_Cont, _It, _beg, _size>& it) noexcept {
661  return indev_it<_Cont, _It, _beg, _size>(it.owner(), it.cursor() + n);
662  }
664 
668  #if defined _utl_have_concepts
670  template <typename T>
671  concept bool Indev_it = requires (T t, const T ct) {
672  // STL compatibility
673  typename T::value_type;
674  typename T::difference_type;
675  typename T::pointer;
676  typename T::reference;
677  requires same_ <
678  typename T::iterator_category,
679  std::input_iterator_tag
680  >::value;
681  {*t} -> typename T::value_type; // is dereferencable
682  {++t} -> T&; // is incrementable
683  {t++} -> T;
684  // Extras
685  {ct.owner()} ->auto&&;
686  {ct.cursor()} -> const size_t;
687  {ct.value()} -> auto&&;
688  };
689  #else
690  namespace indev_it_details {
691  using std::declval;
692 
694  template <typename _Tp, typename =void>
696 
698  template <typename _Tp>
699  struct is_indev_it_ <
700  _Tp,
701  meta::void_t <
702  typename _Tp::value_type,
703  typename _Tp::difference_type,
704  typename _Tp::pointer,
705  typename _Tp::reference,
706 // meta::use_if_same_t <
707 // typename _Tp::iterator_category,
708 // std::input_iterator_tag
709 // >
710  void
711  >
712  > : meta::true_ {};
713  }
719 // template <typename _Tp>
720 // constexpr bool Indev_it = indev_it_details::is_indev_it_<_Tp>::value;
721  #endif
722 
724  /*
725  * ================= Indexed device Iterator =================
726  */
727 
739  template<typename cont_t, typename iter_t, index_t _beg =0, size_t _size = static_cast<size_t>(-1)-_beg>
740  class iodev_it {
743  public:
744  using type = iterator_t;
745  public:
754 
756  enum Cursor {
757  beg = _beg,
758  eod = _beg+_size,
759  };
760 
761  private:
762  cont_t* owner_{nullptr};
768 
773  struct value_type_t {
776  v_{v} { }
777  operator value_type() { return v_; }
778  operator reference() { return v_; }
781  owner_->put (v_ =v, cursor_);
782  }
783  } value_ {};
787  public:
790  iodev_it () noexcept :
791  owner_ {nullptr},
792  cursor_{eod},
793  value_ {} { }
795  explicit iodev_it (cont_t* owner, size_t cursor =eod) noexcept :
796  owner_ {owner},
797  cursor_{cursor},
798  value_ {} { }
800  explicit iodev_it (const iterator_t& it) noexcept :
801  owner_ {const_cast<cont_t*>(it.owner_)},
802  cursor_{it.cursor_},
803  value_ {it.value_} { }
805  iterator_t& operator= (const iterator_t& it) noexcept {
806  owner_ = const_cast<cont_t*>(it.owner_);
807  cursor_ = it.cursor_;
808  value_ = it.value_;
809  }
811 
813  public:
819  reference operator* () noexcept {
820  owner_->get (value_.v_, cursor_);
821  return value_;
822  }
824  pointer operator-> () noexcept {
825  owner_->get (value_.v_, cursor_);
826  return &value_;
827  }
828 
830  iterator_t& operator++ () noexcept {
831  ++cursor_;
832  return *this;
833  }
835  iterator_t operator++ (int) noexcept {
836  iterator_t ret = *this;
837  ++cursor_;
838  return *this;
839  }
841  iterator_t& operator-- () noexcept {
842  --cursor_;
843  return *this;
844  }
846  iterator_t operator-- (int) noexcept {
847  iterator_t ret = *this;
848  --cursor_;
849  return *this;
850  }
853  owner_->get (value_.v_, cursor_ = n);
854  return value_;
855  }
858  cursor_ += n;
859  return *this;
860  }
863  return iterator_t (owner_, cursor_ + n);
864  }
867  cursor_ -= n;
868  return *this;
869  }
872  return iterator_t (owner_, cursor_ - n);
873  }
874 
876  const cont_t* owner () const noexcept { return owner_; }
878  const index_t& cursor () const noexcept { return cursor_; }
880  //const value_type_t& value () const noexcept { return value_; }
882  };
883 
889  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
892  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
894  const iodev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
895  return (x.owner() == y.owner() &&
896  (x.cursor() == y.cursor()));
897  }
899  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
900  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
901  inline bool operator< (const iodev_it<_Cont1, _It1, _beg1, _size1>& x,
902  const iodev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
903  return (x.cursor() < y.cursor());
904  }
905 
906  // relative ops
907  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
908  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
910  const iodev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
911  return !(x == y);
912  }
913  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
914  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
915  inline bool operator<= (const iodev_it<_Cont1, _It1, _beg1, _size1>& x,
916  const iodev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
917  return !(y < x);
918  }
919  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
920  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
922  const iodev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
923  return (y < x);
924  }
925  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
926  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
928  const iodev_it<_Cont2, _It2, _beg2, _size2>& y) noexcept {
929  return !(x < y);
930  }
932 
934  template<typename _Cont1, typename _It1, index_t _beg1, size_t _size1,
935  typename _Cont2, typename _It2, index_t _beg2, size_t _size2>
938  -> decltype (x.cursor() - y.cursor()) {
939  return (x.cursor() - y.cursor());
940  }
941 
942  template<typename _Cont, typename _It, index_t _beg, size_t _size>
943  inline iodev_it<_Cont, _It, _beg, _size>
944  operator+ (typename _Cont::difference_type n,
945  iodev_it<_Cont, _It, _beg, _size>& it) noexcept {
946  return iodev_it<_Cont, _It, _beg, _size>(it.owner(), it.cursor() + n);
947  }
949 
953  #if defined _utl_have_concepts
955  template <typename T>
956  concept bool Idxdev_it = requires (T t, const T ct) {
957  // STL compatibility
958  typename T::value_type;
959  typename T::difference_type;
960  typename T::pointer;
961  typename T::reference;
962  requires same_<
963  typename T::iterator_category,
964  std::input_iterator_tag
965  >::value;
966  {*t} -> typename T::value_type; // is dereferencable
967  {++t} -> T&; // is incrementable
968  {t++} -> T;
969  // Extras
970  {ct.owner()} ->auto&&;
971  {ct.cursor()} -> const size_t;
972  {ct.value()} -> auto&&;
973  };
974  #else
975  namespace idxdev_it_details {
976  using std::declval;
977 
979  template <typename _Tp, typename =void>
981 
983  template <typename _Tp>
984  struct is_idxdev_it_ <
985  _Tp,
986  meta::void_t <
987  typename _Tp::value_type,
988  typename _Tp::difference_type,
989  typename _Tp::pointer,
990  typename _Tp::reference,
991 // meta::use_if_same_t <
992 // typename _Tp::iterator_category,
993 // std::input_iterator_tag
994 // >
995  void
996  >
997  > : meta::true_ {};
998  }
1004 // template <typename _Tp>
1005 // constexpr bool Idxdev_it = idxdev_it_details::is_idxdev_it_<_Tp>::value;
1006  #endif
1007 
1009 }
1011 #endif /* __utl_dev_dev_iterators_h__ */
iterator_t & operator++() noexcept
value_type value_
The current value, used as cache.
indev_it< cont_t, iter_t, _beg, _size > iterator_t
< iterator type local name
value_type v_
Current value buffer to access via get.
reference operator[](difference_type n)
[] operator. Is a combination of input method and dereference
bool operator==(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
Definition: array.h:181
iterator_t & operator++() noexcept
Pre increment.
reference operator[](difference_type n) noexcept
Random access through iterator.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::pointer pointer
Include all meta library.
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::iterator_category iterator_category
void _get(value_type &v)
Cursor
#define-like enumerator for Cursor
Points one place after last item.
istreamdev_it< cont_t, data_t > iterator_t
Iterator tags [std.iterator.tags] Extension: contiguous_iterator_tag for denoting contiguous iterator...
Definition: dev_iterators.h:55
void void_t
void_t type alias
Definition: detection.h:55
outdev_it() noexcept
Default constructor results to end()
iterator_t & operator-=(difference_type n) noexcept
Random cursor decrement.
Indexed device iterator type. We "future call" interface methods from owner class to provide iterator...
Primary template to catch any non SPI interface types.
ostreamdev_it(const iterator_t &it) noexcept
Basic copy constructor.
Definition: dev_iterators.h:99
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::reference reference
Cursor
#define-like enumerator for Cursor
iterator_t & operator=(const iterator_t &it) noexcept
Basic copy assignment operator.
bool_< true > true_
The type used as a compile-time boolean with true value.
Definition: integral.h:68
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::pointer pointer
Definition: dev_iterators.h:79
index_t cursor_
virtual cursor for comparison operators
iterator_t & operator+=(difference_type n)
const index_t cursor() const noexcept
Export cursor for comparison.
Primary template to catch any non SPI interface types.
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::value_type value_type
Definition: dev_iterators.h:77
indev_it(cont_t *own, size_t cur=eod) noexcept
Basic constructor.
indev_it< _Cont, _It, _beg, _size > operator+(typename _Cont::difference_type n, indev_it< _Cont, _It, _beg, _size > &it) noexcept
iodev_it(const iterator_t &it) noexcept
Basic copy constructor.
iterator_t & operator=(const iterator_t &it) noexcept
Basic copy assignment operator.
iterator_t & operator--()
Pre decrement.
iterator_t operator-(difference_type n) const noexcept
Subtraction operation.
value_type * operator->() noexcept
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::value_type value_type
value_type & operator=(const value_type &v)
Cursor
#define-like enumerator for Cursor
reference operator*() noexcept
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::iterator_category iterator_category
Device iterator collection.
Definition: dev_iterators.h:43
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::value_type value_type
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::difference_type difference_type
Definition: dev_iterators.h:78
iterator_t & operator--() noexcept
Pre decrement.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::value_type value_type
iterator_t operator-(difference_type n)
outdev_it(cont_t *owner, index_t cursor=eod) noexcept
Basic constructor.
auto operator-(indev_it< _Cont1, _It1, _beg1, _size1 > &x, indev_it< _Cont1, _It1, _beg1, _size1 > &y) noexcept -> decltype(x.cursor() - y.cursor())
Output device iterator type. We "future call" interface methods from owner class to provide iterator ...
Points the first item.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::iterator_category iterator_category
iterator_t & operator*() noexcept
const cont_t * owner() const noexcept
Export container for comparison.
iterator_t & operator-=(difference_type n)
cont_t * owner_
bool_< false > false_
The type used as a compile-time boolean with false value.
Definition: integral.h:69
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::pointer pointer
bool operator>=(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
Definition: array.h:207
struct utl::iodev_it::value_type_t value_
iterator_t & operator=(const iterator_t &it) noexcept
Basic copy assignment operator.
istreamdev_it(cont_t *owner=nullptr, Cursor cursor=eos) noexcept
Basic constructor.
ostreamdev_it< cont_t, data_t > iterator_t
Definition: dev_iterators.h:70
index_t cursor_
virtual cursor for comparison operators
std::size_t size_t
Definition: types.h:37
iterator_t & operator++() noexcept
Primary template to catch any non SPI interface types.
STL&#39;s core language concepts.
Definition: _1wire.h:30
iodev_it(cont_t *owner, size_t cursor=eod) noexcept
Basic constructor.
pointer operator->() noexcept
Arrow operator. This is where the input method is invoked.
iterator_t & operator++() noexcept
Points the first item (relative address)
Input device iterator type. We "future call" interface methods from owner class to provide iterator f...
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::difference_type difference_type
iodev_it< cont_t, iter_t, _beg, _size > iterator_t
< iterator type local name
reference operator*()
De-reference operator. No end() place dereference check is made.
value_type_t(value_type v=value_type{})
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::reference reference
index_t cursor_
virtual cursor for comparison operators
bool operator>(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
Definition: array.h:196
iterator_t & operator+=(difference_type n) noexcept
Random cursor increment.
pointer operator->()
Arrow operator. No end() place dereference check is made.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::reference reference
const cont_t * owner() const noexcept
Export container for comparison.
ostreamdev_it(cont_t *owner=nullptr) noexcept
Basic constructor.
Definition: dev_iterators.h:96
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::reference reference
Definition: dev_iterators.h:80
iterator_t & operator=(const iterator_t &it) noexcept
Basic copy assignment operator.
iodev_it() noexcept
Default constructor.
iterator_t operator+(difference_type n)
size_t index_t
index_t and size_t mend to be interchangeable
Definition: types.h:38
Points one place after last item.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::difference_type difference_type
const index_t & cursor() const noexcept
Export cursor for comparison.
indev_it(const iterator_t &it) noexcept
Basic copy constructor.
bool operator!=(const array< _Tp, _Nm > &lhs, const array< _Tp, _Nm > &rhs)
Definition: array.h:186
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::difference_type difference_type
iterator_t & operator*() noexcept
value_type & operator*() noexcept
iterator_t & operator=(const iterator_t &it) noexcept
Basic copy assignment operator.
const Cursor cursor() const noexcept
Export cursor for comparison.
outdev_it< cont_t, iter_t, _beg, _end > iterator_t
iterator type local name
const value_type & value() const noexcept
Export value for comparison.
cont_t * owner_
const index_t cursor() const noexcept
Export cursor for comparison.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::pointer pointer
const cont_t * owner() const noexcept
Export container for comparison.
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::iterator_category iterator_category
Definition: dev_iterators.h:76
Cursor
#define-like enumerator for Cursor-like behavior
indev_it() noexcept
Default constructor.
iterator_t operator+(difference_type n) const noexcept
Addition operation.
Points one place after last item (relative address)
typename dev_iterator_traits< std::output_iterator_tag, data_t, void >::difference_type difference_type
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::iterator_category iterator_category
iterator_t & operator++()
Pre increment.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::pointer pointer
Implementation detail main forward header.
outdev_it(const iterator_t &it) noexcept
Basic copy constructor.
const cont_t * owner() const noexcept
Export container for comparison.
Points the first item.
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::reference reference
typename dev_iterator_traits< std::output_iterator_tag, iter_t >::value_type value_type
istreamdev_it(const iterator_t &it) noexcept
Basic copy constructor.