All Classes Namespaces Functions Pages
halTopSegmentIterator.h
/*
* Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
*
* Released under the MIT license, see LICENSE.txt
*/
#ifndef _HALTOPSEGMENTITERATOR_H
#define _HALTOPSEGMENTITERATOR_H
#include <iostream>
#include "halDefs.h"
#include "halSegmentIterator.h"
#include "halTopSegment.h"
namespace hal {
class TopSegmentIterator : public virtual TopSegment,
public virtual SegmentIterator
{
public:
virtual TopSegmentIteratorPtr copy() = 0;
virtual TopSegmentIteratorConstPtr copy() const = 0;
virtual void copy(TopSegmentIteratorConstPtr ts) const = 0;
virtual void toChild(BottomSegmentIteratorConstPtr bs,
hal_size_t child) const = 0;
virtual void toChildG(BottomSegmentIteratorConstPtr bs,
const Genome* childGenome) const = 0;
virtual void toParseUp(BottomSegmentIteratorConstPtr bs) const = 0;
virtual TopSegment* getTopSegment() = 0;
virtual const TopSegment* getTopSegment() const = 0;
virtual bool equals(TopSegmentIteratorConstPtr other) const = 0;
virtual void toNextParalogy() const = 0;
protected:
friend class counted_ptr<TopSegmentIterator>;
friend class counted_ptr<const TopSegmentIterator>;
virtual ~TopSegmentIterator() = 0;
};
inline TopSegmentIterator::~TopSegmentIterator() {}
inline bool operator==(TopSegmentIteratorConstPtr p1,
TopSegmentIteratorConstPtr p2)
{
if (p1.get() == NULL || p2.get() == NULL)
{
return p1.get() == NULL && p2.get() == NULL;
}
return p1->equals(p2);
}
inline bool operator!=(TopSegmentIteratorConstPtr p1,
TopSegmentIteratorConstPtr p2)
{
return !(p1 == p2);
}
}
#endif
hal::Genome
Definition: halGenome.h:24
hal::TopSegmentIterator::toNextParalogy
virtual void toNextParalogy() const =0
hal::TopSegmentIterator::getTopSegment
virtual TopSegment * getTopSegment()=0
hal::TopSegment
Definition: halTopSegment.h:18
hal::TopSegmentIterator::equals
virtual bool equals(TopSegmentIteratorConstPtr other) const =0
hal::SegmentIterator
Definition: halSegmentIterator.h:20
hal::TopSegmentIterator
Definition: halTopSegmentIterator.h:22
hal::TopSegmentIterator::copy
virtual TopSegmentIteratorPtr copy()=0
hal::TopSegmentIterator::toChild
virtual void toChild(BottomSegmentIteratorConstPtr bs, hal_size_t child) const =0
hal::TopSegmentIterator::toChildG
virtual void toChildG(BottomSegmentIteratorConstPtr bs, const Genome *childGenome) const =0
hal::TopSegmentIterator::toParseUp
virtual void toParseUp(BottomSegmentIteratorConstPtr bs) const =0