Utility class to enable for-each style iteration in the IndexedSamReader class.
More...
#include <indexed_sam_iterator.h>
Utility class to enable for-each style iteration in the IndexedSamReader class.
gamgee::IndexedSamIterator::IndexedSamIterator |
( |
| ) |
|
creates an empty iterator (used for the end() method)
gamgee::IndexedSamIterator::IndexedSamIterator |
( |
const std::shared_ptr< htsFile > & |
sam_file_ptr, |
|
|
const std::shared_ptr< hts_idx_t > & |
sam_index_ptr, |
|
|
const std::shared_ptr< bam_hdr_t > & |
sam_header_ptr, |
|
|
const std::vector< std::string > & |
interval_list |
|
) |
| |
initializes a new iterator based on an input file stream
- Parameters
-
sam_file_ptr | pointer to a bam/cram file opened via the sam_open() macro from htslib |
sam_index_ptr | pointer to a bam/cram file opened via the sam_index_load() macro from htslib |
sam_header_ptr | pointer to a bam/cram file header created with the sam_hdr_read() macro from htslib |
interval_list | vector of intervals compatible with sam_itr_querys, hts_parse_reg, etc. |
iterators and readers can be moved
no copy construction/assignment allowed for iterators and readers
const std::string & gamgee::IndexedSamIterator::current_interval |
( |
| ) |
const |
inequality operator (needed by for-each loop)
- Parameters
-
- Returns
- whether or not the two iterators are the same (e.g. have the same input stream on the same status)
Sam & gamgee::IndexedSamIterator::operator* |
( |
| ) |
|
dereference operator (needed by for-each loop)
- Returns
- a Sam object by reference, valid until the next record is fetched (the iterator re-uses memory at each iteration)
Sam & gamgee::IndexedSamIterator::operator++ |
( |
| ) |
|
pre-fetches the next record and tests for end of file
- Returns
- a reference to the object (it can be const& because this return value should only be used by the for-each loop to check for the eof)
The documentation for this class was generated from the following files: