3774 |
26 Oct 18 |
peter |
1 |
#ifndef theplu_yat_omic_vcf_iterator |
3774 |
26 Oct 18 |
peter |
2 |
#define theplu_yat_omic_vcf_iterator |
3774 |
26 Oct 18 |
peter |
3 |
|
3774 |
26 Oct 18 |
peter |
// $Id$ |
3774 |
26 Oct 18 |
peter |
5 |
|
3774 |
26 Oct 18 |
peter |
6 |
/* |
3774 |
26 Oct 18 |
peter |
Copyright (C) 2018 Peter Johansson |
3774 |
26 Oct 18 |
peter |
8 |
|
3774 |
26 Oct 18 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
3774 |
26 Oct 18 |
peter |
10 |
|
3774 |
26 Oct 18 |
peter |
The yat library is free software; you can redistribute it and/or |
3774 |
26 Oct 18 |
peter |
modify it under the terms of the GNU General Public License as |
3774 |
26 Oct 18 |
peter |
published by the Free Software Foundation; either version 3 of the |
3774 |
26 Oct 18 |
peter |
License, or (at your option) any later version. |
3774 |
26 Oct 18 |
peter |
15 |
|
3774 |
26 Oct 18 |
peter |
The yat library is distributed in the hope that it will be useful, |
3774 |
26 Oct 18 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3774 |
26 Oct 18 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3774 |
26 Oct 18 |
peter |
General Public License for more details. |
3774 |
26 Oct 18 |
peter |
20 |
|
3774 |
26 Oct 18 |
peter |
You should have received a copy of the GNU General Public License |
3774 |
26 Oct 18 |
peter |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
3774 |
26 Oct 18 |
peter |
23 |
*/ |
3774 |
26 Oct 18 |
peter |
24 |
|
3774 |
26 Oct 18 |
peter |
25 |
#include "VCF.h" |
3774 |
26 Oct 18 |
peter |
26 |
|
3774 |
26 Oct 18 |
peter |
27 |
#include <iterator> |
3774 |
26 Oct 18 |
peter |
28 |
|
3774 |
26 Oct 18 |
peter |
29 |
namespace theplu { |
3774 |
26 Oct 18 |
peter |
30 |
namespace yat { |
3774 |
26 Oct 18 |
peter |
31 |
namespace omic { |
3774 |
26 Oct 18 |
peter |
32 |
|
3774 |
26 Oct 18 |
peter |
33 |
class VcfFile; |
3774 |
26 Oct 18 |
peter |
34 |
|
3774 |
26 Oct 18 |
peter |
35 |
/** |
3774 |
26 Oct 18 |
peter |
This class is an input iterator, similar to |
3774 |
26 Oct 18 |
peter |
std::istream_iterator, associated with an VcfFile such that it |
3774 |
26 Oct 18 |
peter |
extracts a VCF from the VcfFile whenever \c operator++ is called. |
3774 |
26 Oct 18 |
peter |
39 |
|
3774 |
26 Oct 18 |
peter |
\since new in yat 0.16 |
3774 |
26 Oct 18 |
peter |
41 |
*/ |
3774 |
26 Oct 18 |
peter |
42 |
class VcfIterator : public std::istream_iterator<VCF> |
3774 |
26 Oct 18 |
peter |
43 |
{ |
3774 |
26 Oct 18 |
peter |
44 |
public: |
3774 |
26 Oct 18 |
peter |
45 |
/** |
3774 |
26 Oct 18 |
peter |
Default constructor. |
3774 |
26 Oct 18 |
peter |
47 |
|
3774 |
26 Oct 18 |
peter |
Creates an end-of-file iterator |
3774 |
26 Oct 18 |
peter |
49 |
*/ |
3774 |
26 Oct 18 |
peter |
50 |
VcfIterator(void); |
3774 |
26 Oct 18 |
peter |
51 |
|
3774 |
26 Oct 18 |
peter |
52 |
/** |
3774 |
26 Oct 18 |
peter |
Construct an iterator that is associated with file \a file. The |
3774 |
26 Oct 18 |
peter |
object does not copy \a file but only stores a reference, so if |
3774 |
26 Oct 18 |
peter |
file goes out of scope the behaviour is undefined. |
3774 |
26 Oct 18 |
peter |
56 |
*/ |
3774 |
26 Oct 18 |
peter |
57 |
VcfIterator(VcfFile& file); |
3774 |
26 Oct 18 |
peter |
58 |
|
3774 |
26 Oct 18 |
peter |
59 |
private: |
3774 |
26 Oct 18 |
peter |
// using compiler generated copy |
3774 |
26 Oct 18 |
peter |
// VcfIterator(const VcfIterator&); |
3774 |
26 Oct 18 |
peter |
// VcfIterator& operator=(const VcfIterator&); |
3774 |
26 Oct 18 |
peter |
// using compiler generated move |
3774 |
26 Oct 18 |
peter |
// VcfIterator(VcfIterator&&); |
3774 |
26 Oct 18 |
peter |
// VcfIterator& operator=(VcfIterator&&); |
3774 |
26 Oct 18 |
peter |
66 |
}; |
3774 |
26 Oct 18 |
peter |
67 |
|
3774 |
26 Oct 18 |
peter |
68 |
}}} |
3774 |
26 Oct 18 |
peter |
69 |
#endif |