yat  0.21pre
BamPairBuffer.h
1 #ifndef _theplu_yat_omic_bam_pair_buffer_
2 #define _theplu_yat_omic_bam_pair_buffer_
3 
4 // $Id: BamPairBuffer.h 4057 2021-03-31 05:46:00Z peter $
5 
6 /*
7  Copyright (C) 2021 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include "BamRead.h"
26 
27 #include <yat/utility/SortedBuffer.h>
28 #include <yat/utility/yat_assert.h>
29 
30 namespace theplu {
31 namespace yat {
32 namespace omic {
33 
45  template<typename OutputIterator>
47  {
48  public:
54  BamPairBuffer(OutputIterator out)
55  : buffer_(out) {}
56 
64  void push(const BamRead& first, const BamRead& second)
65  {
66  // first <= second within each pair
67  YAT_ASSERT(BamLessPos()(second, first) == false);
68  // read pairs come sorted wrt first, i.e., all future ::first
69  // are greater (or equal) than current first, and thus all
70  // future reads are greater (or equal) than first.
71  buffer_.flush(first);
72  buffer_.push(first);
73  buffer_.push(second);
74  }
75  private:
77  };
78 
79 }}}
80 #endif
BamPairBuffer(OutputIterator out)
Constructor.
Definition: BamPairBuffer.h:54
Definition: SortedBuffer.h:45
The Department of Theoretical Physics namespace as we define it.
Definition: BamPairBuffer.h:46
Class holding a bam query.
Definition: BamRead.h:51
void push(const BamRead &first, const BamRead &second)
Definition: BamPairBuffer.h:64
Definition: BamRead.h:501

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14