halapi hierarchichalalignmentformatapi

- Main Page
- Namespaces
- Classes
- Files

- File List

All Classes Namespaces Functions Pages
halSequenceIterator.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 _HALSEQUENCEITERATOR_H
8 #define _HALSEQUENCEITERATOR_H
9
10 #include "halDefs.h"
11 #include "halSequence.h"
12
13 namespace hal {
14
18 class SequenceIterator
19 {
20 public:
23 virtual SequenceIteratorPtr copy() = 0;
24
27 virtual SequenceIteratorConstPtr copy() const = 0;
28
30 virtual void toNext() const = 0;
31
33 virtual void toPrev() const = 0;
34
36 virtual Sequence* getSequence() = 0;
37
39 virtual const Sequence* getSequence() const = 0;
40
42 virtual bool equals(SequenceIteratorConstPtr p2) const = 0;
43
44 protected:
45 friend class counted_ptr<SequenceIterator>;
46 friend class counted_ptr<const SequenceIterator>;
47 virtual ~SequenceIterator() = 0;
48 };
49
50 inline SequenceIterator::~SequenceIterator() {}
51
52 inline bool operator==(SequenceIteratorConstPtr p1,
53 SequenceIteratorConstPtr p2)
54 {
55 if (p1.get() == NULL || p2.get() == NULL)
56 {
57 return p1.get() == NULL && p2.get() == NULL;
58 }
59 return p1->equals(p2);
60 }
61
62 inline bool operator!=(SequenceIteratorConstPtr p1,
63 SequenceIteratorConstPtr p2)
64 {
65 return !(p1 == p2);
66 }
67
68 }
69 #endif
hal::SequenceIterator::getSequence
virtual Sequence * getSequence()=0
hal::SequenceIterator::toNext
virtual void toNext() const =0
hal::SequenceIterator::copy
virtual SequenceIteratorPtr copy()=0
hal::SequenceIterator
Definition: halSequenceIterator.h:18
hal::SequenceIterator::toPrev
virtual void toPrev() const =0
hal::SequenceIterator::equals
virtual bool equals(SequenceIteratorConstPtr p2) const =0
hal::Sequence
Definition: halSequence.h:20