halapi hierarchichalalignmentformatapi

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Pages
halSegmentIterator.h
1 /*
2 * Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
3 *
4 * Released under the MIT license, see LICENSE.txt
5 */
6
7 #ifndef _HALSEGMENTITERATOR_H
8 #define _HALSEGMENTITERATOR_H
9
10 #include "halDefs.h"
11 #include "halSlicedSegment.h"
12
13 namespace hal {
14
20 class SegmentIterator : public virtual SlicedSegment
21 {
22 public:
23
29 virtual void toLeft(hal_index_t leftCutoff = NULL_INDEX) const = 0;
30
36 virtual void toRight(hal_index_t rightCutoff = NULL_INDEX) const = 0;
37
45 virtual void toSite(hal_index_t position, bool slice = true) const = 0;
46
47
48 protected:
49 friend class counted_ptr<SegmentIterator>;
50 friend class counted_ptr<const SegmentIterator>;
51 virtual ~SegmentIterator() = 0;
52 };
53
54 inline SegmentIterator::~SegmentIterator() {}
55
56 inline bool operator<(SegmentIteratorConstPtr segmentIt,
57 hal_index_t genomePos)
58 {
59 return segmentIt->leftOf(genomePos);
60 }
61
62 inline bool operator>(SegmentIteratorConstPtr segmentIt,
63 hal_index_t genomePos)
64 {
65 return segmentIt->rightOf(genomePos);
66 }
67
68 }
69 #endif
hal::SegmentIterator::toSite
virtual void toSite(hal_index_t position, bool slice=true) const =0
hal::SegmentIterator
Definition: halSegmentIterator.h:20
hal::SegmentIterator::toRight
virtual void toRight(hal_index_t rightCutoff=NULL_INDEX) const =0
hal::SegmentIterator::toLeft
virtual void toLeft(hal_index_t leftCutoff=NULL_INDEX) const =0
hal::SlicedSegment
Definition: halSlicedSegment.h:22
hal::SlicedSegment::slice
virtual void slice(hal_offset_t startOffset=0, hal_offset_t endOffset=0) const =0