All Classes Namespaces Functions Pages
halDNAIterator.h
/*
* Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu)
*
* Released under the MIT license, see LICENSE.txt
*/
#ifndef _HALDNAITERATOR_H
#define _HALDNAITERATOR_H
#include "halDefs.h"
namespace hal {
class DNAIterator
{
public:
virtual char getChar() const = 0;
virtual void setChar(char c) = 0;
virtual void toLeft() const = 0;
virtual void toRight() const = 0;
virtual void jumpTo(hal_size_t index) const = 0;
virtual void toReverse() const = 0;
virtual bool getReversed() const = 0;
virtual void setReversed(bool reversed) const = 0;
virtual const Genome* getGenome() const = 0;
virtual Genome* getGenome() = 0;
virtual const Sequence* getSequence() const = 0;
virtual Sequence* getSequence() = 0;
virtual hal_index_t getArrayIndex() const = 0;
virtual bool equals(DNAIteratorConstPtr& other) const = 0;
virtual bool leftOf(DNAIteratorConstPtr& other) const = 0;
protected:
friend class counted_ptr<DNAIterator>;
friend class counted_ptr<const DNAIterator>;
virtual ~DNAIterator() = 0;
};
inline DNAIterator::~DNAIterator() {}
}
#ifndef NDEBUG
#include "halGenome.h"
namespace hal {
inline std::ostream& operator<<(std::ostream& os,
const DNAIterator* dna)
{
const Genome* genome = dna->getGenome();
os << "dna: ";
os << "Genome=" << genome->getName();
os << " Seq=" << dna->getSequence()->getName();
os << " idx=" << dna->getArrayIndex();
if (dna->getArrayIndex() >= 0 &&
dna->getArrayIndex() < (hal_index_t)genome->getSequenceLength())
{
os << " val=" << dna->getChar();
}
return os;
}
}
#endif
#endif
hal::Genome
Definition: halGenome.h:24
hal::DNAIterator
Definition: halDNAIterator.h:17
hal::DNAIterator::jumpTo
virtual void jumpTo(hal_size_t index) const =0
hal::DNAIterator::getGenome
virtual const Genome * getGenome() const =0
hal::DNAIterator::toRight
virtual void toRight() const =0
hal::DNAIterator::toLeft
virtual void toLeft() const =0
hal::DNAIterator::leftOf
virtual bool leftOf(DNAIteratorConstPtr &other) const =0
hal::DNAIterator::getArrayIndex
virtual hal_index_t getArrayIndex() const =0
hal::DNAIterator::getSequence
virtual const Sequence * getSequence() const =0
hal::DNAIterator::toReverse
virtual void toReverse() const =0
hal::DNAIterator::getReversed
virtual bool getReversed() const =0
hal::DNAIterator::setChar
virtual void setChar(char c)=0
hal::DNAIterator::equals
virtual bool equals(DNAIteratorConstPtr &other) const =0
hal::DNAIterator::getChar
virtual char getChar() const =0
hal::DNAIterator::setReversed
virtual void setReversed(bool reversed) const =0
hal::Sequence
Definition: halSequence.h:20