1 // ==========================================================================
2 //                 SeqAn - The Library for Sequence Analysis
3 // ==========================================================================
4 // Copyright (c) 2006-2018, Knut Reinert, FU Berlin
5 // Copyright (c) 2013 NVIDIA Corporation
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are met:
10 //
11 //     * Redistributions of source code must retain the above copyright
12 //       notice, this list of conditions and the following disclaimer.
13 //     * Redistributions in binary form must reproduce the above copyright
14 //       notice, this list of conditions and the following disclaimer in the
15 //       documentation and/or other materials provided with the distribution.
16 //     * Neither the name of Knut Reinert or the FU Berlin nor the names of
17 //       its contributors may be used to endorse or promote products derived
18 //       from this software without specific prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
24 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
30 // DAMAGE.
31 //
32 // ==========================================================================
33 // Author: Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>
34 // ==========================================================================
35 // Manual forwards for the sequence module.
36 // ==========================================================================
37 
38 #ifndef SEQAN_HEADER_SEQUENCE_FORWARDS_H
39 #define SEQAN_HEADER_SEQUENCE_FORWARDS_H
40 
41 #if !defined(_MSC_VER)
42 
43 //SEQAN_NO_GENERATED_FORWARDS: no forwards are generated for this file
44 
45 //////////////////////////////////////////////////////////////////////////////
46 
47 namespace seqan
48 {
49 
50 // ==========================================================================
51 // Adaption Forwards
52 // ==========================================================================
53 
54 // TODO(holtgrew): I wonder whether everything below will still be necessary after auto-sequence feature removal? See note below.
55 
56 // NOTE(holtgrew): My guess / understanding why we need forwards here.
57 //
58 // The problem with needing forwards here appears to be that we have default
59 // implementations of metafunctions Reference<>, Length<> etc.
60 //
61 // Consider the setup for a template function A() using getValue(): A tries to
62 // use getValue().  If there was no default implementation of Reference<> then
63 // the function getValue() would not be instantiated at this point.  Since
64 // there is such a default implementation, however, getValue() gets instantiated,
65 // returns a Reference<std::string> == (std::string &) and this is where the
66 // compiler balks.
67 //
68 // I think that instantiation would get deferred in the case of Reference<> not
69 // being defined, but I am not sure.  I need to do more research about this.
70 
71 // --------------------------------------------------------------------------
72 // Forwards from sequence_interface.h.
73 // --------------------------------------------------------------------------
74 
75 template <typename T> struct AllowsFastRandomAccess;
76 template <typename T> struct DefaultOverflowExplicit;
77 template <typename T> struct DefaultOverflowImplicit;
78 // template <typename T, class Enable = void> struct IsContiguous;
79 template <typename T> struct IsSequence;
80 struct TagExact_;
81 struct TagGenerous_;
82 struct TagInsist_;
83 struct TagLimit_;
84 typedef Tag<TagExact_> Exact;
85 typedef Tag<TagGenerous_> Generous;
86 typedef Tag<TagInsist_> Insist;
87 typedef Tag<TagLimit_> Limit;
88 typedef Tag<TagInsist_> Tight;
89 template <typename T> inline typename Iterator<T, Standard>::Type _beginDefault(T & me, Standard);
90 template <typename T> inline typename Iterator<T const, Standard>::Type _beginDefault(T const & me, Standard);
91 template <typename T> inline typename Iterator<T, Rooted>::Type _beginDefault(T & me, Rooted);
92 template <typename T> inline typename Iterator<T const, Rooted>::Type _beginDefault(T const & me, Rooted);
93 template <typename T, typename TSize> inline TSize _computeSizeForCapacity(T const & , TSize capacity);
94 template <typename T> inline typename Iterator<T, Standard>::Type _endDefault(T & me, Standard);
95 template <typename T> inline typename Iterator<T const, Standard>::Type _endDefault(T const & me, Standard);
96 template <typename T> inline typename Iterator<T, Rooted>::Type _endDefault(T & me, Rooted);
97 template <typename T> inline typename Iterator<T const, Rooted>::Type _endDefault(T const & me, Rooted);
98 template <typename TContainer> inline SEQAN_FUNC_ENABLE_IF(Is<StlContainerConcept<typename RemoveReference<TContainer>::Type> >, void) assign(TContainer && me, typename RemoveReference<TContainer>::Type source);
99 template <typename TContainer, typename TSource> inline SEQAN_FUNC_ENABLE_IF(And<Not<IsSameType<typename RemoveReference<TContainer>::Type, TSource> >, Is<StlContainerConcept<typename RemoveReference<TContainer>::Type> > >, void) assign(TContainer && me, TSource const & source);
100 template <typename TContainer, typename TSource> inline SEQAN_FUNC_ENABLE_IF(Is<StlContainerConcept<typename RemoveReference<TContainer>::Type> >, void) assign(TContainer && me, TSource const & source, typename Size<TSource>::Type limit);
101 template<typename TTarget, typename TSource> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<TTarget>::Type> >, void) assign(TTarget && target, TSource && source, typename Size<TTarget>::Type const limit);
102 template <typename T> inline typename Iterator<T, typename DefaultGetIteratorSpec<T>::Type>::Type begin(T & me);
103 template <typename T> inline typename Iterator<T const, typename DefaultGetIteratorSpec<T>::Type>::Type begin(T const & me);
104 template <typename T, typename TSpec> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<T>::Type> >, typename Iterator<T, Tag<TSpec> const>::Type) begin(T & me, Tag<TSpec> const tag_);
105 template <typename T, typename TSpec> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<T>::Type> >, typename Iterator<T const, Tag<TSpec> const>::Type) begin(T const & me, Tag<TSpec> const tag_);
106 template <typename T> inline typename Position<T>::Type beginPosition(T &);
107 template <typename T> inline typename Position<T>::Type beginPosition(T const &);
108 template <typename T, typename TSize> inline TSize computeGenerousCapacity(T const & , TSize capacity);
109 template <typename T> inline typename Iterator<T, typename DefaultGetIteratorSpec<T>::Type>::Type end(T & me);
110 template <typename T> inline typename Iterator<T const, typename DefaultGetIteratorSpec<T>::Type>::Type end(T const & me);
111 template <typename T, typename TSpec> inline typename Iterator<T, Tag<TSpec> const>::Type end(T & me, Tag<TSpec> const tag_);
112 template <typename T, typename TSpec> inline typename Iterator<T const, Tag<TSpec> const>::Type end(T const & me, Tag<TSpec> const tag_);
113 template <typename T> inline typename Position<T>::Type endPosition(T & me);
114 template <typename T> inline typename Position<T>::Type endPosition(T const & me);
115 template <typename T> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<T>::Type> >, void const *) getObjectId(T const & me);
116 template <typename TContainer> inline SEQAN_FUNC_ENABLE_IF(Is<StlContainerConcept<typename RemoveReference<TContainer>::Type> >, void const *) getObjectId(TContainer && me);
117 template <typename T, typename TPos> inline typename Iterator<T, typename DefaultGetIteratorSpec<T>::Type>::Type iter(T & me, TPos const pos);
118 template <typename T, typename TPos> inline typename Iterator<T const, typename DefaultGetIteratorSpec<T>::Type>::Type iter(T const & me, TPos const pos);
119 template <typename T, typename TPos, typename TTag> inline typename Iterator<T, Tag<TTag> const>::Type iter(T & me, TPos const pos, Tag<TTag> const &);
120 template <typename T, typename TPos, typename TTag> inline typename Iterator<T const, Tag<TTag> const>::Type iter(T const & me, TPos const pos, Tag<TTag> const &);
121 template <typename T> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<T>::Type> >, typename Size<T>::Type) length(T const & /*me*/);
122 template <typename TChar, typename TAlloc> inline typename Size<std::forward_list<TChar, TAlloc> >::Type length(std::forward_list<TChar, TAlloc> const & me);
123 template <typename T, typename TValue, typename TPos> inline void moveValue(T & me, TPos pos, TValue const & _value);
124 template <typename T, typename TValue, typename TPos> inline void moveValue(T const & me, TPos pos, TValue const & _value);
125 template <typename TContainer> inline SEQAN_FUNC_ENABLE_IF(Is<StlContainerConcept<TContainer> >, typename Size<TContainer>::Type) length(TContainer const & me);
126 template <typename T, typename TSize, typename TBeginPosition, typename TEndPosition> inline TSize resizeSpace(T & me, TSize size, TBeginPosition pos_begin, TEndPosition pos_end);
127 template <typename T, typename TSize, typename TBeginPosition, typename TEndPosition, typename TLimit> inline TSize resizeSpace(T & me, TSize size, TBeginPosition pos_begin, TEndPosition pos_end, TLimit limit);
128 template <typename T1, typename T2> inline bool shareResources(T1 const & obj1, T2 const & obj2);
129 template <typename T> inline void shrinkToFit(T & me);
130 template <typename T, typename TPos> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<T>::Type> >, typename Reference<T>::Type) value(T & me, TPos /*pos*/);
131 template <typename T, typename TPos> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<T>::Type> >, typename Reference<T const>::Type) value(T const & me, TPos /*pos*/);
132 template <typename TContainer, typename TPos> inline SEQAN_FUNC_ENABLE_IF(And<Is<StlContainerConcept<TContainer> >, HasSubscriptOperator<TContainer> >, typename Reference<TContainer>::Type) value(TContainer & me, TPos const pos);
133 template <typename TContainer, typename TPos> inline SEQAN_FUNC_ENABLE_IF(And<Is<StlContainerConcept<TContainer> >, HasSubscriptOperator<TContainer> >, typename Reference<TContainer const>::Type) value(TContainer const & me, TPos const pos);
134 template <typename TContainer, typename TPos> inline SEQAN_FUNC_ENABLE_IF(And<Is<StlContainerConcept<TContainer> >, HasSubscriptOperator<TContainer> >, typename Value<TContainer>::Type) value(TContainer && me, TPos const pos);
135 template <typename TContainer, typename TPos> inline SEQAN_FUNC_ENABLE_IF(And<Is<StlContainerConcept<TContainer> >, Not<HasSubscriptOperator<TContainer> > >, typename Reference<TContainer>::Type) value(TContainer & me, TPos const pos);
136 template <typename TContainer, typename TPos> inline SEQAN_FUNC_ENABLE_IF(And<Is<StlContainerConcept<TContainer> >, Not<HasSubscriptOperator<TContainer> > >, typename Reference<TContainer const>::Type) value(TContainer const & me, TPos const pos);
137 template <typename TContainer, typename TPos> inline SEQAN_FUNC_ENABLE_IF(And<Is<StlContainerConcept<TContainer> >, Not<HasSubscriptOperator<TContainer> > >, typename Value<TContainer>::Type) value(TContainer && me, TPos const pos);
138 
139 #if !(defined(STDLIB_VS) || __cplusplus > 201402L)
140 template <typename TContainer> inline SEQAN_FUNC_ENABLE_IF(Is<StlContainerConcept<TContainer> >, bool) empty(TContainer const & me);
141 template <typename T> inline SEQAN_FUNC_DISABLE_IF(Is<StlContainerConcept<typename RemoveReference<T>::Type> >, bool) empty(T const & me);
142 #endif
143 
144 // --------------------------------------------------------------------------
145 // Forwards For arrays and pointers.
146 // --------------------------------------------------------------------------
147 
148 template <typename TValue> struct DefaultOverflowExplicit;
149 template <typename TValue> struct DefaultOverflowImplicit;
150 template <typename TValue, typename TExpand> inline size_t _clearSpace(TValue * me, size_t size, Tag<TExpand>);
151 template <typename TValue, typename TExpand> inline size_t _clearSpace(TValue * me, size_t size, size_t limit, Tag<TExpand>);
152 template <typename TValue, typename TPosition, typename TExpand> inline size_t _clearSpace(TValue * me, size_t size, TPosition pos_begin, TPosition pos_end, Tag<TExpand>);
153 template <typename TValue, typename TPosition, typename TExpand> inline size_t _clearSpace(TValue * me, size_t size, TPosition pos_begin, TPosition pos_end, size_t limit, Tag<TExpand>);
154 template <typename TValue> inline void _setLength(TValue * me, size_t new_length);
155 template <typename TTargetValue, typename TSource, typename TExpand> inline void append(TTargetValue * target, TSource const & source, Tag<TExpand>);
156 template <typename TTargetValue, typename TSource, typename TExpand> inline void append(TTargetValue * target, TSource const & source, size_t limit, Tag<TExpand>);
157 template <typename TTargetValue, typename TSourceValue, typename TExpand> inline void append(TTargetValue * target, TSourceValue const * source, Tag<TExpand>);
158 template <typename TTargetValue, typename TSourceValue, typename TExpand> inline void append(TTargetValue * target, TSourceValue const * source, size_t limit, Tag<TExpand>);
159 template <typename TTargetValue, typename TSource> inline typename EnableIf<IsCharType<TTargetValue> >::Type assign(TTargetValue * target, TSource & source);
160 template <typename TTargetValue, typename TSource> inline typename EnableIf<IsCharType<TTargetValue> >::Type assign(TTargetValue * target, TSource const & source);
161 template <typename TTargetValue, typename TSource, typename TExpand> inline void assign(TTargetValue * target, TSource const & source, Tag<TExpand>);
162 template <typename TTargetValue, typename TSource, typename TExpand> inline void assign(TTargetValue * target, TSource const & source, size_t limit, Tag<TExpand>);
163 template <typename TTargetValue, typename TSourceValue, typename TExpand> inline void assign(TTargetValue * target, TSourceValue const * source, Tag<TExpand>);
164 template <typename TTargetValue, typename TSourceValue, typename TExpand> inline void assign(TTargetValue * target, TSourceValue const * source, size_t limit, Tag<TExpand>);
165 template <typename TValue, typename TPos> inline void assignValue(TValue * me, TPos pos, TValue const & _value);
166 template <typename TValue> inline bool atEnd(TValue * pos);
167 template <typename TValue> inline bool atEnd(TValue const * pos, TValue const * );
168 template <typename T> inline typename Iterator<T *, typename DefaultGetIteratorSpec<T>::Type>::Type begin(T * me);
169 template <typename TValue> inline typename Iterator<TValue *, Standard>::Type begin(TValue * me, Standard);
170 template <typename TValue> inline typename Iterator<TValue const *, Standard>::Type begin(TValue const * me, Standard);
171 template <typename TValue, typename TSpec> inline typename Iterator<TValue *, Tag<TSpec> const>::Type begin(TValue * me, Tag<TSpec> const);
172 template <typename TValue, typename TSpec> inline typename Iterator<TValue const *, Tag<TSpec> const>::Type begin(TValue const * me, Tag<TSpec> const);
173 template <typename TValue> inline void clear(TValue * me);
174 template <typename TValue> inline bool empty(TValue * me);
175 template <typename TValue> inline typename Iterator<TValue *, Standard>::Type end(TValue * me, Standard);
176 template <typename TValue> inline typename Iterator<TValue const *, Standard>::Type end(TValue const * me, Standard);
177 template <typename TValue, typename TSpec> inline typename Iterator<TValue *, Tag<TSpec> const>::Type end(TValue * me, Tag<TSpec> const tag_);
178 template <typename TValue, typename TSpec> inline typename Iterator<TValue const *, Tag<TSpec> const>::Type end(TValue const * me, Tag<TSpec> const tag_);
179 template <typename TLeftValue, typename TRight > inline bool isEqual(TLeftValue * left, TRight const & right);
180 template <typename TLeftValue, typename TRight> inline bool isGreater(TLeftValue * left, TRight const & right);
181 template <typename TLeftValue, typename TRight> inline bool isGreaterOrEqual(TLeftValue * left, TRight const & right);
182 template <typename TLeftValue, typename TRight> inline bool isLess(TLeftValue * left, TRight const & right);
183 template <typename TLeftValue, typename TRight> inline bool isLessOrEqual(TLeftValue * left, TRight const & right);
184 template <typename TLeftValue, typename TRight > inline bool isNotEqual(TLeftValue * left, TRight const & right);
185 template <typename TValue> inline size_t length(TValue * me);
186 template <typename TValue> inline size_t length(TValue const * me);
187 inline size_t length(char * me);
188 inline size_t length(char const * me);
189 template <typename TTargetValue, typename TSource> inline void move(TTargetValue * & target, TSource & source);
190 template <typename TTargetValue, typename TSource> inline void move(TTargetValue * & target, TSource const & source);
191 template <typename TValue, typename TPos> inline void moveValue(TValue * me, TPos pos, TValue const & _value);
192 template <typename TValue, typename TSize, typename TExpand> inline size_t resize( TValue * me, TSize new_length, Tag<TExpand>);
193 template <typename TValue, typename TSize, typename TExpand> inline size_t resize( TValue * me, TSize new_length, TValue const & val, Tag<TExpand>);
194 template <typename TValue, typename TPos> inline TValue & value(TValue * me, TPos pos);
195 template <typename TValue, typename TPos> inline TValue const & value(TValue const * me, TPos pos);
196 
197 }  // namespace seqan
198 
199 #endif  // #if !defined(_MSC_VER)
200 
201 #endif
202 
203