source: trunk/yat/omic/BamPair.cc @ 3176

Last change on this file since 3176 was 3176, checked in by Peter, 9 years ago

closes #784. New class BamPairProxy? to finalize implementation of BamPairIterator?.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1// $Id: BamPair.cc 3176 2014-03-15 09:10:37Z peter $
2
3/*
4  Copyright (C) 2014 Peter Johansson
5
6  This file is part of the yat library, http://dev.thep.lu.se/yat
7
8  The yat library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 3 of the
11  License, or (at your option) any later version.
12
13  The yat library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include <config.h>
23
24#include "BamPair.h"
25
26#include <cassert>
27
28namespace theplu {
29namespace yat {
30namespace omic {
31
32  BamPair::BamPair(void)
33  {
34  }
35
36
37  BamPair::BamPair(const BamRead& first, const BamRead& second)
38    : first_(first), second_(second) {}
39
40
41  BamRead& BamPair::first(void)
42  {
43    return first_;
44  }
45
46
47  const BamRead& BamPair::first(void) const
48  {
49    return first_;
50  }
51
52
53  BamRead& BamPair::second(void)
54  {
55    return second_;
56  }
57
58
59  const BamRead& BamPair::second(void) const
60  {
61    return second_;
62  }
63
64  ///////////// BamPairProxy ////////////////////
65
66  BamPairProxy::BamPairProxy(void)
67    : first_(NULL), second_(NULL) {}
68
69  BamPairProxy::BamPairProxy(const BamRead* first, const BamRead* second)
70    : first_(first), second_(second) {}
71
72  const BamRead& BamPairProxy::first(void) const
73  {
74    assert(first_);
75    return *first_;
76  }
77
78
79  const BamRead& BamPairProxy::second(void) const
80  {
81    assert(second_);
82    return *second_;
83  }
84
85
86  BamPairProxy::operator BamPair() const
87  {
88    return BamPair(*first_, *second_);
89  }
90
91}}}
Note: See TracBrowser for help on using the repository browser.