Utility class to enable for-each style iteration in the SamReader class.
More...
#include <sam_iterator.h>
Utility class to enable for-each style iteration in the SamReader class.
gamgee::SamIterator::SamIterator |
( |
| ) |
|
creates an empty iterator (used for the end() method)
gamgee::SamIterator::SamIterator |
( |
const std::shared_ptr< htsFile > & |
sam_file_ptr, |
|
|
const std::shared_ptr< bam_hdr_t > & |
sam_header_ptr |
|
) |
| |
initializes a new iterator based on an input stream (e.g. sam/a file, stdin, ...)
- Parameters
-
sam_file_ptr | pointer to a sam file opened via the sam_open() macro from htslib |
sam_header_ptr | pointer to a sam file header created with the sam_hdr_read() macro from htslib |
gamgee::SamIterator::SamIterator |
( |
const SamIterator & |
| ) |
|
|
delete |
no copy construction/assignment allowed for readers and iterators
a SamIterator move constructor guarantees all objects will have the same state.
bool gamgee::SamIterator::operator!= |
( |
const SamIterator & |
rhs | ) |
|
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::SamIterator::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::SamIterator::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: