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