1 /*==========================================================================
2 SeqAn - The Library for Sequence Analysis
4 ============================================================================
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 3 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 ============================================================================
18 $Id: basic_iterator_simple.h,v 1.1 2008/08/25 16:20:01 langmead Exp $
19 ==========================================================================*/
21 #ifndef SEQAN_HEADER_BASIC_ITERATOR_SIMPLE_H
22 #define SEQAN_HEADER_BASIC_ITERATOR_SIMPLE_H
24 namespace SEQAN_NAMESPACE_MAIN
26 //////////////////////////////////////////////////////////////////////////////
28 //////////////////////////////////////////////////////////////////////////////
30 struct SimpleIterator;
35 ..summary:A simple iterator.
36 ..signature:Iter<TContainer, SimpleIterator>
37 ..param.TContainer:Type of the container that can be iterated.
38 ...metafunction:Metafunction.Container
41 template <typename TContainer>
42 class Iter<TContainer, SimpleIterator>
45 typedef typename Value<TContainer>::Type TValue;
51 Iter(Iter const & other_):
52 data_ptr(other_.data_ptr)
55 Iter(TValue * other_data_ptr):
56 data_ptr(other_data_ptr)
59 template <typename TContainer2>
60 Iter(Iter<TContainer2, SimpleIterator> const & other_):
61 data_ptr(other_.data_ptr)
68 operator = (Iter const & other_)
70 this->data_ptr = other_.data_ptr;
74 operator = (TValue * other_data_ptr)
76 data_ptr = other_data_ptr;
79 template <typename TContainer2>
81 operator = (Iter<TContainer2, SimpleIterator> const & other_)
83 this->data_ptr = other_.data_ptr;
93 //////////////////////////////////////////////////////////////////////////////
96 struct Iterator_Default_Imp<T, Standard>
98 typedef typename Value<T>::Type * Type;
99 // typedef Iter<T, SimpleIterator> Type;
102 //////////////////////////////////////////////////////////////////////////////
104 template <typename TContainer, typename TContainer2>
105 inline typename Position<Iter<TContainer, SimpleIterator> const>::Type
106 position(Iter<TContainer, SimpleIterator> const & me,
107 TContainer2 const & cont)
110 return me.data_ptr - begin(cont);
113 //////////////////////////////////////////////////////////////////////////////
115 } //namespace SEQAN_NAMESPACE_MAIN
117 #endif //#ifndef SEQAN_HEADER_...