All Classes Namespaces Functions Pages
halSegmentIterator.h
/*
* Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
*
* Released under the MIT license, see LICENSE.txt
*/
#ifndef _HALSEGMENTITERATOR_H
#define _HALSEGMENTITERATOR_H
#include "halDefs.h"
#include "halSlicedSegment.h"
namespace hal {
class SegmentIterator : public virtual SlicedSegment
{
public:
virtual void toLeft(hal_index_t leftCutoff = NULL_INDEX) const = 0;
virtual void toRight(hal_index_t rightCutoff = NULL_INDEX) const = 0;
virtual void toSite(hal_index_t position, bool slice = true) const = 0;
protected:
friend class counted_ptr<SegmentIterator>;
friend class counted_ptr<const SegmentIterator>;
virtual ~SegmentIterator() = 0;
};
inline SegmentIterator::~SegmentIterator() {}
inline bool operator<(SegmentIteratorConstPtr segmentIt,
hal_index_t genomePos)
{
return segmentIt->leftOf(genomePos);
}
inline bool operator>(SegmentIteratorConstPtr segmentIt,
hal_index_t genomePos)
{
return segmentIt->rightOf(genomePos);
}
}
#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