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

Last change on this file since 4025 was 4025, checked in by Peter, 9 months ago

add move constructor for BamPair?

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1// $Id: BamPair.cc 4025 2021-01-14 02:59:03Z peter $
2
3/*
4  Copyright (C) 2014, 2018 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 yat. 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  BamPair::BamPair(BamRead&& first, BamRead&& second)
42    : first_(std::move(first)), second_(std::move(second)) {}
43
44
45  BamRead& BamPair::first(void)
46  {
47    return first_;
48  }
49
50
51  const BamRead& BamPair::first(void) const
52  {
53    return first_;
54  }
55
56
57  BamRead& BamPair::second(void)
58  {
59    return second_;
60  }
61
62
63  const BamRead& BamPair::second(void) const
64  {
65    return second_;
66  }
67
68  ///////////// BamPairProxy ////////////////////
69
70  BamPairProxy::BamPairProxy(void)
71    : first_(NULL), second_(NULL) {}
72
73  BamPairProxy::BamPairProxy(const BamRead* first, const BamRead* second)
74    : first_(first), second_(second) {}
75
76  const BamRead& BamPairProxy::first(void) const
77  {
78    assert(first_);
79    return *first_;
80  }
81
82
83  const BamRead& BamPairProxy::second(void) const
84  {
85    assert(second_);
86    return *second_;
87  }
88
89
90  BamPairProxy::operator BamPair() const
91  {
92    return BamPair(*first_, *second_);
93  }
94
95}}}
Note: See TracBrowser for help on using the repository browser.