STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stream.h
Go to the documentation of this file.
1 /***************************************************************************
2  * include/stxxl/bits/stream/stream.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2003-2005 Roman Dementiev <[email protected]>
7  * Copyright (C) 2009, 2010 Andreas Beckmann <[email protected]>
8  * Copyright (C) 2010 Johannes Singler <[email protected]>
9  *
10  * Distributed under the Boost Software License, Version 1.0.
11  * (See accompanying file LICENSE_1_0.txt or copy at
12  * http://www.boost.org/LICENSE_1_0.txt)
13  **************************************************************************/
14 
15 #ifndef STXXL_STREAM_STREAM_HEADER
16 #define STXXL_STREAM_STREAM_HEADER
17 
18 #include <stxxl/bits/namespace.h>
23 #include <stxxl/vector>
25 
26 #ifndef STXXL_VERBOSE_MATERIALIZE
27 #define STXXL_VERBOSE_MATERIALIZE STXXL_VERBOSE3
28 #endif
29 
31 
32 //! Stream package subnamespace.
33 namespace stream {
34 
35 //! \addtogroup streampack
36 //! \{
37 
38 ////////////////////////////////////////////////////////////////////////
39 // STREAMIFY //
40 ////////////////////////////////////////////////////////////////////////
41 
42 //! A model of stream that retrieves the data from an input iterator.
43 //! For convenience use \c streamify function instead of direct instantiation
44 //! of \c iterator2stream .
45 template <class InputIterator>
47 {
48  InputIterator m_current, m_end;
49 
50 public:
51  //! Standard stream typedef.
52  typedef typename std::iterator_traits<InputIterator>::value_type value_type;
53 
54  iterator2stream(InputIterator begin, InputIterator end)
55  : m_current(begin), m_end(end)
56  { }
57 
59  : m_current(a.m_current), m_end(a.m_end)
60  { }
61 
62  //! Standard stream method.
63  const value_type& operator * () const
64  {
65  return *m_current;
66  }
67 
68  const value_type* operator -> () const
69  {
70  return &(*m_current);
71  }
72 
73  //! Standard stream method.
75  {
76  assert(m_end != m_current);
77  ++m_current;
78  return *this;
79  }
80 
81  //! Standard stream method.
82  bool empty() const
83  {
84  return (m_current == m_end);
85  }
86 };
87 
88 //! Input iterator range to stream converter.
89 //! \param begin iterator, pointing to the first value
90 //! \param end iterator, pointing to the last + 1 position, i.e. beyond the range
91 //! \return an instance of a stream object
92 template <class InputIterator>
93 iterator2stream<InputIterator> streamify(InputIterator begin, InputIterator end)
94 {
95  return iterator2stream<InputIterator>(begin, end);
96 }
97 
98 //! Traits class of \c streamify function.
99 template <class InputIterator>
101 {
102  //! return type (stream type) of \c streamify for \c InputIterator.
104 };
105 
106 //! A model of stream that retrieves data from an external \c stxxl::vector
107 //! iterator. It is more efficient than generic \c iterator2stream thanks to
108 //! use of overlapping For convenience use \c streamify function instead of
109 //! direct instantiation of \c vector_iterator2stream .
110 template <class InputIterator>
112 {
113  InputIterator m_current, m_end;
114  typedef buf_istream<typename InputIterator::block_type,
115  typename InputIterator::bids_container_iterator> buf_istream_type;
116 
119 
121  {
122  in.reset(); // delete object
123  }
124 
125 public:
127 
128  //! Standard stream typedef.
129  typedef typename std::iterator_traits<InputIterator>::value_type value_type;
130 
131  vector_iterator2stream(InputIterator begin, InputIterator end,
132  unsigned_type nbuffers = 0)
133  : m_current(begin), m_end(end),
134  in(static_cast<buf_istream_type*>(NULL))
135  {
136  if (empty())
137  return;
138 
139  begin.flush(); // flush container
140  typename InputIterator::bids_container_iterator end_iter
141  = end.bid() + ((end.block_offset()) ? 1 : 0);
142 
143  if (end_iter - begin.bid() > 0)
144  {
145  in.reset(new buf_istream_type(
146  begin.bid(), end_iter, nbuffers ? nbuffers :
147  (2 * config::get_instance()->disks_number())
148  )
149  );
150 
151  InputIterator cur = begin - begin.block_offset();
152 
153  // skip the beginning of the block
154  for ( ; cur != begin; ++cur)
155  ++(*in);
156  }
157  }
158 
160  : m_current(a.m_current), m_end(a.m_end), in(a.in.release())
161  { }
162 
163  //! Standard stream method.
164  const value_type& operator * () const
165  {
166  return **in;
167  }
168 
169  const value_type* operator -> () const
170  {
171  return &(**in);
172  }
173 
174  //! Standard stream method.
176  {
177  assert(m_end != m_current);
178  ++m_current;
179  ++(*in);
180  if (UNLIKELY(empty()))
181  delete_stream();
182 
183  return *this;
184  }
185 
186  //! Standard stream method.
187  bool empty() const
188  {
189  return (m_current == m_end);
190  }
192  {
193  delete_stream(); // not needed actually
194  }
195 };
196 
197 //! Input external \c stxxl::vector iterator range to stream converter.
198 //! It is more efficient than generic input iterator \c streamify thanks to use of overlapping
199 //! \param begin iterator, pointing to the first value
200 //! \param end iterator, pointing to the last + 1 position, i.e. beyond the range
201 //! \param nbuffers number of blocks used for overlapped reading (0 is default,
202 //! which equals to (2 * number_of_disks)
203 //! \return an instance of a stream object
204 
205 template <typename ValueType, typename AllocStr, typename SizeType,
206  typename DiffType, unsigned BlockSize, typename PagerType,
207  unsigned PageSize>
208 vector_iterator2stream<
209  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
210  DiffType, BlockSize, PagerType, PageSize>
211  >
213  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
214  DiffType, BlockSize, PagerType, PageSize> begin,
215  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
216  DiffType, BlockSize, PagerType, PageSize> end,
217  unsigned_type nbuffers = 0)
218 {
219  STXXL_VERBOSE1("streamify for vector_iterator range is called");
220  return vector_iterator2stream<
221  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
222  DiffType, BlockSize, PagerType, PageSize>
223  >(begin, end, nbuffers);
224 }
225 
226 template <typename ValueType, typename AllocStr, typename SizeType,
227  typename DiffType, unsigned BlockSize, typename PagerType,
228  unsigned PageSize>
230  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
231  DiffType, BlockSize, PagerType, PageSize>
232  >
233 {
234  typedef vector_iterator2stream<
235  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
236  DiffType, BlockSize, PagerType, PageSize>
238 };
239 
240 //! Input external \c stxxl::vector const iterator range to stream converter.
241 //! It is more efficient than generic input iterator \c streamify thanks to use of overlapping
242 //! \param begin const iterator, pointing to the first value
243 //! \param end const iterator, pointing to the last + 1 position, i.e. beyond the range
244 //! \param nbuffers number of blocks used for overlapped reading (0 is default,
245 //! which equals to (2 * number_of_disks)
246 //! \return an instance of a stream object
247 
248 template <typename ValueType, typename AllocStr, typename SizeType,
249  typename DiffType, unsigned BlockSize, typename PagerType,
250  unsigned PageSize>
252  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
253  DiffType, BlockSize, PagerType, PageSize>
254  >
256  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
257  DiffType, BlockSize, PagerType, PageSize> begin,
258  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
259  DiffType, BlockSize, PagerType, PageSize> end,
260  unsigned_type nbuffers = 0)
261 {
262  STXXL_VERBOSE1("streamify for const_vector_iterator range is called");
263  return vector_iterator2stream<
264  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
265  DiffType, BlockSize, PagerType, PageSize>
266  >(begin, end, nbuffers);
267 }
268 
269 template <typename ValueType, typename AllocStr, typename SizeType,
270  typename DiffType, unsigned BlockSize, typename PagerType,
271  unsigned PageSize>
273  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
274  DiffType, BlockSize, PagerType, PageSize>
275  >
276 {
277  typedef vector_iterator2stream<
278  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
279  DiffType, BlockSize, PagerType, PageSize>
281 };
282 
283 //! Version of \c iterator2stream. Switches between \c vector_iterator2stream and \c iterator2stream .
284 //!
285 //! small range switches between
286 //! \c vector_iterator2stream and \c iterator2stream .
287 //! iterator2stream is chosen if the input iterator range
288 //! is small ( < B )
289 template <class InputIterator>
291 {
294 
295  typedef typename InputIterator::block_type block_type;
296 
297 public:
299 
300  //! Standard stream typedef.
301  typedef typename std::iterator_traits<InputIterator>::value_type value_type;
302 
303  vector_iterator2stream_sr(InputIterator begin, InputIterator end,
304  unsigned_type nbuffers = 0)
305  {
306  if (end - begin < block_type::size)
307  {
308  STXXL_VERBOSE1("vector_iterator2stream_sr::vector_iterator2stream_sr: Choosing iterator2stream<InputIterator>");
309  it_stream = new iterator2stream<InputIterator>(begin, end);
310  vec_it_stream = NULL;
311  }
312  else
313  {
314  STXXL_VERBOSE1("vector_iterator2stream_sr::vector_iterator2stream_sr: Choosing vector_iterator2stream<InputIterator>");
315  it_stream = NULL;
316  vec_it_stream = new vector_iterator2stream<InputIterator>(begin, end, nbuffers);
317  }
318  }
319 
321  : vec_it_stream(a.vec_it_stream), it_stream(a.it_stream)
322  { }
323 
324  //! Standard stream method.
325  const value_type& operator * () const
326  {
327  if (it_stream)
328  return **it_stream;
329 
330  return **vec_it_stream;
331  }
332 
333  const value_type* operator -> () const
334  {
335  if (it_stream)
336  return &(**it_stream);
337 
338  return &(**vec_it_stream);
339  }
340 
341  //! Standard stream method.
343  {
344  if (it_stream)
345  ++(*it_stream);
346 
347  else
348  ++(*vec_it_stream);
349 
350  return *this;
351  }
352 
353  //! Standard stream method.
354  bool empty() const
355  {
356  if (it_stream)
357  return it_stream->empty();
358 
359  return vec_it_stream->empty();
360  }
362  {
363  if (it_stream)
364  delete it_stream;
365 
366  else
367  delete vec_it_stream;
368  }
369 };
370 
371 //! Version of \c streamify. Switches from \c vector_iterator2stream to \c
372 //! iterator2stream for small ranges.
373 template <typename ValueType, typename AllocStr, typename SizeType,
374  typename DiffType, unsigned BlockSize, typename PagerType,
375  unsigned PageSize>
376 vector_iterator2stream_sr<
377  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
378  DiffType, BlockSize, PagerType, PageSize>
379  >
381  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
382  DiffType, BlockSize, PagerType, PageSize> begin,
383  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
384  DiffType, BlockSize, PagerType, PageSize> end,
385  unsigned_type nbuffers = 0)
386 {
387  STXXL_VERBOSE1("streamify_sr for vector_iterator range is called");
389  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
390  DiffType, BlockSize, PagerType, PageSize>
391  >(begin, end, nbuffers);
392 }
393 
394 //! Version of \c streamify. Switches from \c vector_iterator2stream to \c
395 //! iterator2stream for small ranges.
396 template <typename ValueType, typename AllocStr, typename SizeType,
397  typename DiffType, unsigned BlockSize, typename PagerType,
398  unsigned PageSize>
399 vector_iterator2stream_sr<
400  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
401  DiffType, BlockSize, PagerType, PageSize>
402  >
404  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
405  DiffType, BlockSize, PagerType, PageSize> begin,
406  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
407  DiffType, BlockSize, PagerType, PageSize> end,
408  unsigned_type nbuffers = 0)
409 {
410  STXXL_VERBOSE1("streamify_sr for const_vector_iterator range is called");
412  stxxl::const_vector_iterator<ValueType, AllocStr, SizeType,
413  DiffType, BlockSize, PagerType, PageSize>
414  >(begin, end, nbuffers);
415 }
416 
417 ////////////////////////////////////////////////////////////////////////
418 // MATERIALIZE //
419 ////////////////////////////////////////////////////////////////////////
420 
421 //! Stores consecutively stream content to an output iterator.
422 //! \param in stream to be stored used as source
423 //! \param out output iterator used as destination
424 //! \return value of the output iterator after all increments,
425 //! i.e. points to the first unwritten value
426 //! \pre Output (range) is large enough to hold the all elements in the input stream
427 template <class OutputIterator, class StreamAlgorithm>
428 OutputIterator materialize(StreamAlgorithm& in, OutputIterator out)
429 {
431  while (!in.empty())
432  {
433  *out = *in;
434  ++out;
435  ++in;
436  }
437  return out;
438 }
439 
440 //! Stores consecutively stream content to an output iterator range \b until end of the stream or end of the iterator range is reached.
441 //! \param in stream to be stored used as source
442 //! \param outbegin output iterator used as destination
443 //! \param outend output end iterator, pointing beyond the output range
444 //! \return value of the output iterator after all increments,
445 //! i.e. points to the first unwritten value
446 //! \pre Output range is large enough to hold the all elements in the input stream
447 //!
448 //! This function is useful when you do not know the length of the stream beforehand.
449 template <class OutputIterator, class StreamAlgorithm>
450 OutputIterator materialize(StreamAlgorithm& in,
451  OutputIterator outbegin, OutputIterator outend)
452 {
454  while ((!in.empty()) && outend != outbegin)
455  {
456  *outbegin = *in;
457  ++outbegin;
458  ++in;
459  }
460  return outbegin;
461 }
462 
463 //! Stores consecutively stream content to an output \c stxxl::vector iterator \b until end of the stream or end of the iterator range is reached.
464 //! \param in stream to be stored used as source
465 //! \param outbegin output \c stxxl::vector iterator used as destination
466 //! \param outend output end iterator, pointing beyond the output range
467 //! \param nbuffers number of blocks used for overlapped writing (0 is default,
468 //! which equals to (2 * number_of_disks)
469 //! \return value of the output iterator after all increments,
470 //! i.e. points to the first unwritten value
471 //! \pre Output range is large enough to hold the all elements in the input stream
472 //!
473 //! This function is useful when you do not know the length of the stream beforehand.
474 template <typename ValueType, typename AllocStr, typename SizeType,
475  typename DiffType, unsigned BlockSize, typename PagerType,
476  unsigned PageSize, class StreamAlgorithm>
477 stxxl::vector_iterator<ValueType, AllocStr, SizeType,
478  DiffType, BlockSize, PagerType, PageSize>
479 materialize(StreamAlgorithm& in,
480  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
481  DiffType, BlockSize, PagerType, PageSize> outbegin,
482  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
483  DiffType, BlockSize, PagerType, PageSize> outend,
484  unsigned_type nbuffers = 0)
485 {
490 
491  while (outbegin.block_offset()) // go to the beginning of the block
492  // of the external vector
493  {
494  if (in.empty() || outbegin == outend)
495  return outbegin;
496 
497  *outbegin = *in;
498  ++outbegin;
499  ++in;
500  }
501 
502  if (nbuffers == 0)
503  nbuffers = 2 * config::get_instance()->disks_number();
504 
505  outbegin.flush(); // flush container
506 
507  // create buffered write stream for blocks
508  buf_ostream_type outstream(outbegin.bid(), nbuffers);
509 
510  assert(outbegin.block_offset() == 0);
511 
512  // delay calling block_externally_updated() until the block is
513  // completely filled (and written out) in outstream
514  ConstExtIterator prev_block = outbegin;
515 
516  while (!in.empty() && outend != outbegin)
517  {
518  if (outbegin.block_offset() == 0) {
519  if (prev_block != outbegin) {
520  prev_block.block_externally_updated();
521  prev_block = outbegin;
522  }
523  }
524 
525  *outstream = *in;
526  ++outbegin;
527  ++outstream;
528  ++in;
529  }
530 
531  ConstExtIterator const_out = outbegin;
532 
533  while (const_out.block_offset()) // filling the rest of the block
534  {
535  *outstream = *const_out;
536  ++const_out;
537  ++outstream;
538  }
539 
540  if (prev_block != outbegin)
541  prev_block.block_externally_updated();
542 
543  outbegin.flush();
544 
545  return outbegin;
546 }
547 
548 //! Stores consecutively stream content to an output \c stxxl::vector iterator.
549 //! \param in stream to be stored used as source
550 //! \param out output \c stxxl::vector iterator used as destination
551 //! \param nbuffers number of blocks used for overlapped writing (0 is default,
552 //! which equals to (2 * number_of_disks)
553 //! \return value of the output iterator after all increments,
554 //! i.e. points to the first unwritten value
555 //! \pre Output (range) is large enough to hold the all elements in the input stream
556 template <typename ValueType, typename AllocStr, typename SizeType,
557  typename DiffType, unsigned BlockSize, typename PagerType,
558  unsigned PageSize, class StreamAlgorithm>
559 stxxl::vector_iterator<ValueType, AllocStr, SizeType,
560  DiffType, BlockSize, PagerType, PageSize>
561 materialize(StreamAlgorithm& in,
562  stxxl::vector_iterator<ValueType, AllocStr, SizeType,
563  DiffType, BlockSize, PagerType, PageSize> out,
564  unsigned_type nbuffers = 0)
565 {
570 
571  // on the I/O complexity of "materialize":
572  // crossing block boundary causes O(1) I/Os
573  // if you stay in a block, then materialize function accesses only the cache of the
574  // vector (only one block indeed), amortized complexity should apply here
575 
576  while (out.block_offset()) // go to the beginning of the block
577  // of the external vector
578  {
579  if (in.empty())
580  return out;
581 
582  *out = *in;
583  ++out;
584  ++in;
585  }
586 
587  if (nbuffers == 0)
588  nbuffers = 2 * config::get_instance()->disks_number();
589 
590  out.flush(); // flush container
591 
592  // create buffered write stream for blocks
593  buf_ostream_type outstream(out.bid(), nbuffers);
594 
595  assert(out.block_offset() == 0);
596 
597  // delay calling block_externally_updated() until the block is
598  // completely filled (and written out) in outstream
599  ConstExtIterator prev_block = out;
600 
601  while (!in.empty())
602  {
603  if (out.block_offset() == 0) {
604  if (prev_block != out) {
605  prev_block.block_externally_updated();
606  prev_block = out;
607  }
608  }
609 
610  // tells the vector that the block was modified
611  *outstream = *in;
612  ++out;
613  ++outstream;
614  ++in;
615  }
616 
617  ConstExtIterator const_out = out;
618 
619  // copy over items remaining in block from vector.
620  while (const_out.block_offset())
621  {
622  *outstream = *const_out; // might cause I/Os for loading the page that
623  ++const_out; // contains data beyond out
624  ++outstream;
625  }
626 
627  if (prev_block != out)
628  prev_block.block_externally_updated();
629 
630  out.flush();
631 
632  return out;
633 }
634 
635 //! Reads stream content and discards it.
636 //! Useful where you do not need the processed stream anymore,
637 //! but are just interested in side effects, or just for debugging.
638 //! \param in input stream
639 template <class StreamAlgorithm>
640 void discard(StreamAlgorithm& in)
641 {
642  while (!in.empty())
643  {
644  *in;
645  ++in;
646  }
647 }
648 
649 ////////////////////////////////////////////////////////////////////////
650 // GENERATE //
651 ////////////////////////////////////////////////////////////////////////
652 
653 //! A model of stream that outputs data from an adaptable generator functor.
654 //! For convenience use \c streamify function instead of direct instantiation
655 //! of \c generator2stream .
656 template <class Generator, typename T = typename Generator::value_type>
658 {
659 public:
660  //! Standard stream typedef.
661  typedef T value_type;
662 
663 private:
664  Generator gen_;
666 
667 public:
668  generator2stream(Generator g)
669  : gen_(g), m_current(gen_())
670  { }
671 
672  generator2stream(const generator2stream& a) : gen_(a.gen_), m_current(a.m_current) { }
673 
674  //! Standard stream method.
675  const value_type& operator * () const
676  {
677  return m_current;
678  }
679 
680  const value_type* operator -> () const
681  {
682  return &m_current;
683  }
684 
685  //! Standard stream method.
687  {
688  m_current = gen_();
689  return *this;
690  }
691 
692  //! Standard stream method.
693  bool empty() const
694  {
695  return false;
696  }
697 };
698 
699 //! Adaptable generator to stream converter.
700 //! \param gen_ generator object
701 //! \return an instance of a stream object
702 template <class Generator>
704 {
705  return generator2stream<Generator>(gen_);
706 }
707 
708 ////////////////////////////////////////////////////////////////////////
709 // TRANSFORM //
710 ////////////////////////////////////////////////////////////////////////
711 
712 struct Stopper { };
713 
714 //! Processes (up to) 6 input streams using given operation functor.
715 //!
716 //! \tparam Operation type of the operation (type of an
717 //! adaptable functor that takes 6 parameters)
718 //! \tparam Input1 type of the 1st input
719 //! \tparam Input2 type of the 2nd input
720 //! \tparam Input3 type of the 3rd input
721 //! \tparam Input4 type of the 4th input
722 //! \tparam Input5 type of the 5th input
723 //! \tparam Input6 type of the 6th input
724 template <class Operation,
725  class Input1,
726  class Input2 = Stopper,
727  class Input3 = Stopper,
728  class Input4 = Stopper,
729  class Input5 = Stopper,
730  class Input6 = Stopper
731  >
733 {
734  Operation& op;
735  Input1& i1;
736  Input2& i2;
737  Input3& i3;
738  Input4& i4;
739  Input5& i5;
740  Input6& i6;
741 
742 public:
743  //! Standard stream typedef.
744  typedef typename Operation::value_type value_type;
745 
746 private:
748 
749 public:
750  //! Construction.
751  transform(Operation& o, Input1& i1_, Input2& i2_, Input3& i3_, Input4& i4_,
752  Input5& i5_, Input5& i6_)
753  : op(o), i1(i1_), i2(i2_), i3(i3_), i4(i4_), i5(i5_), i6(i6_)
754  {
755  if (!empty())
756  current = op(*i1, *i2, *i3, *i4, *i5, *i6);
757  }
758 
759  //! Standard stream method.
760  const value_type& operator * () const
761  {
762  return current;
763  }
764 
765  const value_type* operator -> () const
766  {
767  return &current;
768  }
769 
770  //! Standard stream method.
772  {
773  ++i1;
774  ++i2;
775  ++i3;
776  ++i4;
777  ++i5;
778  ++i6;
779  if (!empty())
780  current = op(*i1, *i2, *i3, *i4, *i5, *i6);
781 
782  return *this;
783  }
784 
785  //! Standard stream method.
786  bool empty() const
787  {
788  return i1.empty() || i2.empty() || i3.empty() ||
789  i4.empty() || i5.empty() || i6.empty();
790  }
791 };
792 
793 // Specializations
794 
795 ////////////////////////////////////////////////////////////////////////
796 // TRANSFORM (1 input stream) //
797 ////////////////////////////////////////////////////////////////////////
798 
799 //! Processes an input stream using given operation functor.
800 //!
801 //! \tparam Operation type of the operation (type of an
802 //! adaptable functor that takes 1 parameter)
803 //! \tparam Input1 type of the input
804 //! \remark This is a specialization of \c transform .
805 template <class Operation,
806  class Input1
807  >
808 class transform<Operation, Input1, Stopper, Stopper, Stopper, Stopper, Stopper>
809 {
810  Operation& op;
811  Input1& i1;
812 
813 public:
814  //! Standard stream typedef.
815  typedef typename Operation::value_type value_type;
816 
817 private:
819 
820 public:
821  //! Construction.
822  transform(Operation& o, Input1& i1_) : op(o), i1(i1_)
823  {
824  if (!empty())
825  current = op(*i1);
826  }
827 
828  //! Standard stream method.
829  const value_type& operator * () const
830  {
831  return current;
832  }
833 
834  const value_type* operator -> () const
835  {
836  return &current;
837  }
838 
839  //! Standard stream method.
841  {
842  ++i1;
843  if (!empty())
844  current = op(*i1);
845 
846  return *this;
847  }
848 
849  //! Standard stream method.
850  bool empty() const
851  {
852  return i1.empty();
853  }
854 };
855 
856 ////////////////////////////////////////////////////////////////////////
857 // TRANSFORM (2 input streams) //
858 ////////////////////////////////////////////////////////////////////////
859 
860 //! Processes 2 input streams using given operation functor.
861 //!
862 //! \tparam Operation type of the operation (type of an
863 //! adaptable functor that takes 2 parameters)
864 //! \tparam Input1 type of the 1st input
865 //! \tparam Input2 type of the 2nd input
866 //! \remark This is a specialization of \c transform .
867 template <class Operation,
868  class Input1,
869  class Input2
870  >
871 class transform<Operation, Input1, Input2, Stopper, Stopper, Stopper, Stopper>
872 {
873  Operation& op;
874  Input1& i1;
875  Input2& i2;
876 
877 public:
878  //! Standard stream typedef.
879  typedef typename Operation::value_type value_type;
880 
881 private:
883 
884 public:
885  //! Construction.
886  transform(Operation& o, Input1& i1_, Input2& i2_) : op(o), i1(i1_), i2(i2_)
887  {
888  if (!empty())
889  current = op(*i1, *i2);
890  }
891 
892  //! Standard stream method.
893  const value_type& operator * () const
894  {
895  return current;
896  }
897 
898  const value_type* operator -> () const
899  {
900  return &current;
901  }
902 
903  //! Standard stream method.
905  {
906  ++i1;
907  ++i2;
908  if (!empty())
909  current = op(*i1, *i2);
910 
911  return *this;
912  }
913 
914  //! Standard stream method.
915  bool empty() const
916  {
917  return i1.empty() || i2.empty();
918  }
919 };
920 
921 ////////////////////////////////////////////////////////////////////////
922 // TRANSFORM (3 input streams) //
923 ////////////////////////////////////////////////////////////////////////
924 
925 //! Processes 3 input streams using given operation functor.
926 //!
927 //! \tparam Operation type of the operation (type of an
928 //! adaptable functor that takes 3 parameters)
929 //! \tparam Input1 type of the 1st input
930 //! \tparam Input2 type of the 2nd input
931 //! \tparam Input3 type of the 3rd input
932 //! \remark This is a specialization of \c transform .
933 template <class Operation,
934  class Input1,
935  class Input2,
936  class Input3
937  >
938 class transform<Operation, Input1, Input2, Input3, Stopper, Stopper, Stopper>
939 {
940  Operation& op;
941  Input1& i1;
942  Input2& i2;
943  Input3& i3;
944 
945 public:
946  //! Standard stream typedef.
947  typedef typename Operation::value_type value_type;
948 
949 private:
951 
952 public:
953  //! Construction.
954  transform(Operation& o, Input1& i1_, Input2& i2_, Input3& i3_)
955  : op(o), i1(i1_), i2(i2_), i3(i3_)
956  {
957  if (!empty())
958  current = op(*i1, *i2, *i3);
959  }
960 
961  //! Standard stream method.
962  const value_type& operator * () const
963  {
964  return current;
965  }
966 
967  const value_type* operator -> () const
968  {
969  return &current;
970  }
971 
972  //! Standard stream method.
974  {
975  ++i1;
976  ++i2;
977  ++i3;
978  if (!empty())
979  current = op(*i1, *i2, *i3);
980 
981  return *this;
982  }
983 
984  //! Standard stream method.
985  bool empty() const
986  {
987  return i1.empty() || i2.empty() || i3.empty();
988  }
989 };
990 
991 ////////////////////////////////////////////////////////////////////////
992 // TRANSFORM (4 input streams) //
993 ////////////////////////////////////////////////////////////////////////
994 
995 //! Processes 4 input streams using given operation functor.
996 //!
997 //! \tparam Operation type of the operation (type of an
998 //! adaptable functor that takes 4 parameters)
999 //! \tparam Input1 type of the 1st input
1000 //! \tparam Input2 type of the 2nd input
1001 //! \tparam Input3 type of the 3rd input
1002 //! \tparam Input4 type of the 4th input
1003 //! \remark This is a specialization of \c transform .
1004 template <class Operation,
1005  class Input1,
1006  class Input2,
1007  class Input3,
1008  class Input4
1009  >
1010 class transform<Operation, Input1, Input2, Input3, Input4, Stopper, Stopper>
1011 {
1012  Operation& op;
1013  Input1& i1;
1014  Input2& i2;
1015  Input3& i3;
1016  Input4& i4;
1017 
1018 public:
1019  //! Standard stream typedef.
1020  typedef typename Operation::value_type value_type;
1021 
1022 private:
1024 
1025 public:
1026  //! Construction.
1027  transform(Operation& o, Input1& i1_, Input2& i2_, Input3& i3_, Input4& i4_)
1028  : op(o), i1(i1_), i2(i2_), i3(i3_), i4(i4_)
1029  {
1030  if (!empty())
1031  current = op(*i1, *i2, *i3, *i4);
1032  }
1033 
1034  //! Standard stream method.
1035  const value_type& operator * () const
1036  {
1037  return current;
1038  }
1039 
1040  const value_type* operator -> () const
1041  {
1042  return &current;
1043  }
1044 
1045  //! Standard stream method.
1047  {
1048  ++i1;
1049  ++i2;
1050  ++i3;
1051  ++i4;
1052  if (!empty())
1053  current = op(*i1, *i2, *i3, *i4);
1054 
1055  return *this;
1056  }
1057 
1058  //! Standard stream method.
1059  bool empty() const
1060  {
1061  return i1.empty() || i2.empty() || i3.empty() || i4.empty();
1062  }
1063 };
1064 
1065 ////////////////////////////////////////////////////////////////////////
1066 // TRANSFORM (5 input streams) //
1067 ////////////////////////////////////////////////////////////////////////
1068 
1069 //! Processes 5 input streams using given operation functor.
1070 //!
1071 //! \tparam Operation type of the operation (type of an
1072 //! adaptable functor that takes 5 parameters)
1073 //! \tparam Input1 type of the 1st input
1074 //! \tparam Input2 type of the 2nd input
1075 //! \tparam Input3 type of the 3rd input
1076 //! \tparam Input4 type of the 4th input
1077 //! \tparam Input5 type of the 5th input
1078 //! \remark This is a specialization of \c transform .
1079 template <class Operation,
1080  class Input1,
1081  class Input2,
1082  class Input3,
1083  class Input4,
1084  class Input5
1085  >
1086 class transform<Operation, Input1, Input2, Input3, Input4, Input5, Stopper>
1087 {
1088  Operation& op;
1089  Input1& i1;
1090  Input2& i2;
1091  Input3& i3;
1092  Input4& i4;
1093  Input5& i5;
1094 
1095 public:
1096  //! Standard stream typedef.
1097  typedef typename Operation::value_type value_type;
1098 
1099 private:
1101 
1102 public:
1103  //! Construction.
1104  transform(Operation& o, Input1& i1_, Input2& i2_, Input3& i3_,
1105  Input4& i4_, Input5& i5_)
1106  : op(o), i1(i1_), i2(i2_), i3(i3_), i4(i4_), i5(i5_)
1107  {
1108  if (!empty())
1109  current = op(*i1, *i2, *i3, *i4, *i5);
1110  }
1111 
1112  //! Standard stream method.
1113  const value_type& operator * () const
1114  {
1115  return current;
1116  }
1117 
1118  const value_type* operator -> () const
1119  {
1120  return &current;
1121  }
1122 
1123  //! Standard stream method.
1125  {
1126  ++i1;
1127  ++i2;
1128  ++i3;
1129  ++i4;
1130  ++i5;
1131  if (!empty())
1132  current = op(*i1, *i2, *i3, *i4, *i5);
1133 
1134  return *this;
1135  }
1136 
1137  //! Standard stream method.
1138  bool empty() const
1139  {
1140  return i1.empty() || i2.empty() || i3.empty() || i4.empty() || i5.empty();
1141  }
1142 };
1143 
1144 ////////////////////////////////////////////////////////////////////////
1145 // MAKE TUPLE //
1146 ////////////////////////////////////////////////////////////////////////
1147 
1148 //! Creates stream of 6-tuples from 6 input streams.
1149 //!
1150 //! \tparam Input1 type of the 1st input
1151 //! \tparam Input2 type of the 2nd input
1152 //! \tparam Input3 type of the 3rd input
1153 //! \tparam Input4 type of the 4th input
1154 //! \tparam Input5 type of the 5th input
1155 //! \tparam Input6 type of the 6th input
1156 template <class Input1,
1157  class Input2,
1158  class Input3 = Stopper,
1159  class Input4 = Stopper,
1160  class Input5 = Stopper,
1161  class Input6 = Stopper
1162  >
1164 {
1165  Input1& i1;
1166  Input2& i2;
1167  Input3& i3;
1168  Input4& i4;
1169  Input5& i5;
1170  Input6& i6;
1171 
1172 public:
1173  //! Standard stream typedef.
1174  typedef typename stxxl::tuple<
1175  typename Input1::value_type,
1176  typename Input2::value_type,
1177  typename Input3::value_type,
1178  typename Input4::value_type,
1179  typename Input5::value_type,
1180  typename Input6::value_type
1182 
1183 private:
1185 
1186 public:
1187  //! Construction.
1188  make_tuple(Input1& i1_,
1189  Input2& i2_,
1190  Input3& i3_,
1191  Input4& i4_,
1192  Input5& i5_,
1193  Input6& i6_)
1194  : i1(i1_), i2(i2_), i3(i3_), i4(i4_), i5(i5_), i6(i6_)
1195  {
1196  if (!empty())
1197  current = value_type(*i1, *i2, *i3, *i4, *i5, *i6);
1198  }
1199 
1200  //! Standard stream method.
1201  const value_type& operator * () const
1202  {
1203  return current;
1204  }
1205 
1206  const value_type* operator -> () const
1207  {
1208  return &current;
1209  }
1210 
1211  //! Standard stream method.
1213  {
1214  ++i1;
1215  ++i2;
1216  ++i3;
1217  ++i4;
1218  ++i5;
1219  ++i6;
1220 
1221  if (!empty())
1222  current = value_type(*i1, *i2, *i3, *i4, *i5, *i6);
1223 
1224  return *this;
1225  }
1226 
1227  //! Standard stream method.
1228  bool empty() const
1229  {
1230  return i1.empty() || i2.empty() || i3.empty() ||
1231  i4.empty() || i5.empty() || i6.empty();
1232  }
1233 };
1234 
1235 //! Creates stream of 2-tuples (pairs) from 2 input streams.
1236 //!
1237 //! \tparam Input1 type of the 1st input
1238 //! \tparam Input2 type of the 2nd input
1239 //! \remark A specialization of \c make_tuple .
1240 template <class Input1,
1241  class Input2
1242  >
1243 class make_tuple<Input1, Input2, Stopper, Stopper, Stopper, Stopper>
1244 {
1245  Input1& i1;
1246  Input2& i2;
1247 
1248 public:
1249  //! Standard stream typedef.
1250  typedef typename stxxl::tuple<
1251  typename Input1::value_type,
1252  typename Input2::value_type
1254 
1255 private:
1257 
1258 public:
1259  //! Construction.
1260  make_tuple(Input1& i1_,
1261  Input2& i2_)
1262  : i1(i1_), i2(i2_)
1263  {
1264  if (!empty())
1265  current = value_type(*i1, *i2);
1266  }
1267 
1268  //! Standard stream method.
1269  const value_type& operator * () const
1270  {
1271  return current;
1272  }
1273 
1274  const value_type* operator -> () const
1275  {
1276  return &current;
1277  }
1278 
1279  //! Standard stream method.
1281  {
1282  ++i1;
1283  ++i2;
1284 
1285  if (!empty())
1286  current = value_type(*i1, *i2);
1287 
1288  return *this;
1289  }
1290 
1291  //! Standard stream method.
1292  bool empty() const
1293  {
1294  return i1.empty() || i2.empty();
1295  }
1296 };
1297 
1298 //! Creates stream of 3-tuples from 3 input streams.
1299 //!
1300 //! \tparam Input1 type of the 1st input
1301 //! \tparam Input2 type of the 2nd input
1302 //! \tparam Input3 type of the 3rd input
1303 //! \remark A specialization of \c make_tuple .
1304 template <class Input1,
1305  class Input2,
1306  class Input3
1307  >
1308 class make_tuple<Input1, Input2, Input3, Stopper, Stopper, Stopper>
1309 {
1310  Input1& i1;
1311  Input2& i2;
1312  Input3& i3;
1313 
1314 public:
1315  //! Standard stream typedef.
1316  typedef typename stxxl::tuple<
1317  typename Input1::value_type,
1318  typename Input2::value_type,
1319  typename Input3::value_type
1321 
1322 private:
1324 
1325 public:
1326  //! Construction.
1327  make_tuple(Input1& i1_,
1328  Input2& i2_,
1329  Input3& i3_)
1330  : i1(i1_), i2(i2_), i3(i3_)
1331  {
1332  if (!empty())
1333  current = value_type(*i1, *i2, *i3);
1334  }
1335 
1336  //! Standard stream method.
1337  const value_type& operator * () const
1338  {
1339  return current;
1340  }
1341 
1342  const value_type* operator -> () const
1343  {
1344  return &current;
1345  }
1346 
1347  //! Standard stream method.
1349  {
1350  ++i1;
1351  ++i2;
1352  ++i3;
1353 
1354  if (!empty())
1355  current = value_type(*i1, *i2, *i3);
1356 
1357  return *this;
1358  }
1359 
1360  //! Standard stream method.
1361  bool empty() const
1362  {
1363  return i1.empty() || i2.empty() || i3.empty();
1364  }
1365 };
1366 
1367 //! Creates stream of 4-tuples from 4 input streams.
1368 //!
1369 //! \tparam Input1 type of the 1st input
1370 //! \tparam Input2 type of the 2nd input
1371 //! \tparam Input3 type of the 3rd input
1372 //! \tparam Input4 type of the 4th input
1373 //! \remark A specialization of \c make_tuple .
1374 template <class Input1,
1375  class Input2,
1376  class Input3,
1377  class Input4
1378  >
1379 class make_tuple<Input1, Input2, Input3, Input4, Stopper, Stopper>
1380 {
1381  Input1& i1;
1382  Input2& i2;
1383  Input3& i3;
1384  Input4& i4;
1385 
1386 public:
1387  //! Standard stream typedef.
1388  typedef typename stxxl::tuple<
1389  typename Input1::value_type,
1390  typename Input2::value_type,
1391  typename Input3::value_type,
1392  typename Input4::value_type
1394 
1395 private:
1397 
1398 public:
1399  //! Construction.
1400  make_tuple(Input1& i1_,
1401  Input2& i2_,
1402  Input3& i3_,
1403  Input4& i4_)
1404  : i1(i1_), i2(i2_), i3(i3_), i4(i4_)
1405  {
1406  if (!empty())
1407  current = value_type(*i1, *i2, *i3, *i4);
1408  }
1409 
1410  //! Standard stream method.
1411  const value_type& operator * () const
1412  {
1413  return current;
1414  }
1415 
1416  const value_type* operator -> () const
1417  {
1418  return &current;
1419  }
1420 
1421  //! Standard stream method.
1423  {
1424  ++i1;
1425  ++i2;
1426  ++i3;
1427  ++i4;
1428 
1429  if (!empty())
1430  current = value_type(*i1, *i2, *i3, *i4);
1431 
1432  return *this;
1433  }
1434 
1435  //! Standard stream method.
1436  bool empty() const
1437  {
1438  return i1.empty() || i2.empty() || i3.empty() ||
1439  i4.empty();
1440  }
1441 };
1442 
1443 //! Creates stream of 5-tuples from 5 input streams.
1444 //!
1445 //! \tparam Input1 type of the 1st input
1446 //! \tparam Input2 type of the 2nd input
1447 //! \tparam Input3 type of the 3rd input
1448 //! \tparam Input4 type of the 4th input
1449 //! \tparam Input5 type of the 5th input
1450 //! \remark A specialization of \c make_tuple .
1451 template <
1452  class Input1,
1453  class Input2,
1454  class Input3,
1455  class Input4,
1456  class Input5
1457  >
1458 class make_tuple<Input1, Input2, Input3, Input4, Input5, Stopper>
1459 {
1460  Input1& i1;
1461  Input2& i2;
1462  Input3& i3;
1463  Input4& i4;
1464  Input5& i5;
1465 
1466 public:
1467  //! Standard stream typedef.
1468  typedef typename stxxl::tuple<
1469  typename Input1::value_type,
1470  typename Input2::value_type,
1471  typename Input3::value_type,
1472  typename Input4::value_type,
1473  typename Input5::value_type
1475 
1476 private:
1478 
1479 public:
1480  //! Construction.
1481  make_tuple(Input1& i1_,
1482  Input2& i2_,
1483  Input3& i3_,
1484  Input4& i4_,
1485  Input5& i5_)
1486  : i1(i1_), i2(i2_), i3(i3_), i4(i4_), i5(i5_)
1487  {
1488  if (!empty())
1489  current = value_type(*i1, *i2, *i3, *i4, *i5);
1490  }
1491 
1492  //! Standard stream method.
1493  const value_type& operator * () const
1494  {
1495  return current;
1496  }
1497 
1498  const value_type* operator -> () const
1499  {
1500  return &current;
1501  }
1502 
1503  //! Standard stream method.
1505  {
1506  ++i1;
1507  ++i2;
1508  ++i3;
1509  ++i4;
1510  ++i5;
1511 
1512  if (!empty())
1513  current = value_type(*i1, *i2, *i3, *i4, *i5);
1514 
1515  return *this;
1516  }
1517 
1518  //! Standard stream method.
1519  bool empty() const
1520  {
1521  return i1.empty() || i2.empty() || i3.empty() ||
1522  i4.empty() || i5.empty();
1523  }
1524 };
1525 
1526 //! \}
1527 
1528 } // namespace stream
1529 
1531 
1532 #include <stxxl/bits/stream/choose.h>
1533 #include <stxxl/bits/stream/unique.h>
1534 
1535 #endif // !STXXL_STREAM_STREAM_HEADER
1536 // vim: et:ts=4:sw=4
iterator2stream< InputIterator > streamify(InputIterator begin, InputIterator end)
Input iterator range to stream converter.
Definition: stream.h:93
Const external vector iterator, model of ext_random_access_iterator concept.
Definition: vector.h:259
iterator2stream< InputIterator > * it_stream
Definition: stream.h:293
value_type current
Definition: stream.h:747
std::iterator_traits< InputIterator >::value_type value_type
Standard stream typedef.
Definition: stream.h:301
vector_iterator2stream< InputIterator > * vec_it_stream
Definition: stream.h:292
stxxl::tuple< typename Input1::value_type, typename Input2::value_type, typename Input3::value_type, typename Input4::value_type > value_type
Standard stream typedef.
Definition: stream.h:1393
vector_iterator2stream< stxxl::const_vector_iterator< ValueType, AllocStr, SizeType, DiffType, BlockSize, PagerType, PageSize > > stream_type
Definition: stream.h:280
bool empty() const
Standard stream method.
Definition: stream.h:786
make_tuple(Input1 &i1_, Input2 &i2_, Input3 &i3_, Input4 &i4_)
Construction.
Definition: stream.h:1400
transform(Operation &o, Input1 &i1_, Input2 &i2_, Input3 &i3_)
Construction.
Definition: stream.h:954
#define STXXL_VERBOSE_MATERIALIZE
Definition: stream.h:27
A model of stream that retrieves the data from an input iterator. For convenience use streamify funct...
Definition: stream.h:46
Traits class of streamify function.
Definition: stream.h:100
transform(Operation &o, Input1 &i1_, Input2 &i2_, Input3 &i3_, Input4 &i4_, Input5 &i5_)
Construction.
Definition: stream.h:1104
std::iterator_traits< InputIterator >::value_type value_type
Standard stream typedef.
Definition: stream.h:52
transform(Operation &o, Input1 &i1_, Input2 &i2_)
Construction.
Definition: stream.h:886
bool empty() const
Standard stream method.
Definition: stream.h:354
vector_iterator2stream(const self_type &a)
Definition: stream.h:159
iterator2stream(InputIterator begin, InputIterator end)
Definition: stream.h:54
Version of iterator2stream. Switches between vector_iterator2stream and iterator2stream ...
Definition: stream.h:290
Buffered output stream.
Definition: buf_ostream.h:29
Operation::value_type value_type
Standard stream typedef.
Definition: stream.h:744
self_type & flush()
Force flush of current block, for finishing writing within a block.
Definition: buf_ostream.h:109
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
Definition: uint_types.h:163
vector_iterator2stream_sr(const self_type &a)
Definition: stream.h:320
bool empty() const
Standard stream method.
Definition: stream.h:1228
vector_iterator2stream_sr< InputIterator > self_type
Definition: stream.h:298
std::auto_ptr< Type > result
Definition: unique_ptr.h:29
vector_iterator2stream_sr(InputIterator begin, InputIterator end, unsigned_type nbuffers=0)
Definition: stream.h:303
stxxl::tuple< typename Input1::value_type, typename Input2::value_type, typename Input3::value_type > value_type
Standard stream typedef.
Definition: stream.h:1320
A model of stream that retrieves data from an external stxxl::vector iterator. It is more efficient t...
Definition: stream.h:111
Creates stream of 6-tuples from 6 input streams.
Definition: stream.h:1163
A model of stream that outputs data from an adaptable generator functor. For convenience use streamif...
Definition: stream.h:657
Processes (up to) 6 input streams using given operation functor.
Definition: stream.h:732
buf_istream_unique_ptr_type in
Definition: stream.h:118
#define UNLIKELY(c)
Definition: utils.h:225
iterator2stream(const iterator2stream &a)
Definition: stream.h:58
T value_type
Standard stream typedef.
Definition: stream.h:661
bool empty() const
Standard stream method.
Definition: stream.h:82
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
Buffered input stream.
Definition: buf_istream.h:34
#define STXXL_VERBOSE1(x)
Definition: verbose.h:99
iterator2stream< InputIterator > stream_type
return type (stream type) of streamify for InputIterator.
Definition: stream.h:103
bool empty() const
Standard stream method.
Definition: stream.h:187
External vector iterator, model of ext_random_access_iterator concept.
Definition: vector.h:275
bool empty() const
Standard stream method.
Definition: stream.h:693
OutputIterator materialize(StreamAlgorithm &in, OutputIterator out)
Stores consecutively stream content to an output iterator.
Definition: stream.h:428
generator2stream(Generator g)
Definition: stream.h:668
generator2stream(const generator2stream &a)
Definition: stream.h:672
make_tuple(Input1 &i1_, Input2 &i2_, Input3 &i3_, Input4 &i4_, Input5 &i5_)
Construction.
Definition: stream.h:1481
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
Definition: types.h:64
vector_iterator2stream_sr< stxxl::vector_iterator< ValueType, AllocStr, SizeType, DiffType, BlockSize, PagerType, PageSize > > streamify_sr(stxxl::vector_iterator< ValueType, AllocStr, SizeType, DiffType, BlockSize, PagerType, PageSize > begin, stxxl::vector_iterator< ValueType, AllocStr, SizeType, DiffType, BlockSize, PagerType, PageSize > end, unsigned_type nbuffers=0)
Version of streamify. Switches from vector_iterator2stream to iterator2stream for small ranges...
Definition: stream.h:380
stxxl::tuple< typename Input1::value_type, typename Input2::value_type, typename Input3::value_type, typename Input4::value_type, typename Input5::value_type > value_type
Standard stream typedef.
Definition: stream.h:1474
vector_iterator2stream(InputIterator begin, InputIterator end, unsigned_type nbuffers=0)
Definition: stream.h:131
void discard(StreamAlgorithm &in)
Reads stream content and discards it. Useful where you do not need the processed stream anymore...
Definition: stream.h:640
transform(Operation &o, Input1 &i1_, Input2 &i2_, Input3 &i3_, Input4 &i4_)
Construction.
Definition: stream.h:1027
make_tuple(Input1 &i1_, Input2 &i2_, Input3 &i3_)
Construction.
Definition: stream.h:1327
transform(Operation &o, Input1 &i1_, Input2 &i2_, Input3 &i3_, Input4 &i4_, Input5 &i5_, Input5 &i6_)
Construction.
Definition: stream.h:751
make_tuple(Input1 &i1_, Input2 &i2_, Input3 &i3_, Input4 &i4_, Input5 &i5_, Input6 &i6_)
Construction.
Definition: stream.h:1188
vector_iterator2stream< stxxl::vector_iterator< ValueType, AllocStr, SizeType, DiffType, BlockSize, PagerType, PageSize > > stream_type
Definition: stream.h:237
#define STXXL_PRETTY_FUNCTION_NAME
std::iterator_traits< InputIterator >::value_type value_type
Standard stream typedef.
Definition: stream.h:129
k-Tuple data type
Definition: tuple.h:67
buf_istream< typename InputIterator::block_type, typename InputIterator::bids_container_iterator > buf_istream_type
Definition: stream.h:115
stxxl::compat_unique_ptr< buf_istream_type >::result buf_istream_unique_ptr_type
Definition: stream.h:117
stxxl::tuple< typename Input1::value_type, typename Input2::value_type, typename Input3::value_type, typename Input4::value_type, typename Input5::value_type, typename Input6::value_type > value_type
Standard stream typedef.
Definition: stream.h:1181
#define STXXL_END_NAMESPACE
Definition: namespace.h:17
stxxl::tuple< typename Input1::value_type, typename Input2::value_type > value_type
Standard stream typedef.
Definition: stream.h:1253
InputIterator::block_type block_type
Definition: stream.h:295
vector_iterator2stream< InputIterator > self_type
Definition: stream.h:126