Commit patch to not break on spaces.
[bowtie.git] / SeqAn-1.1 / seqan / basic / basic_alphabet_interface2.h
1  /*==========================================================================
2                 SeqAn - The Library for Sequence Analysis
3                           http://www.seqan.de 
4  ============================================================================
5   Copyright (C) 2007
6
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.
11
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.
16
17  ============================================================================
18   $Id: basic_alphabet_interface2.h,v 1.1 2008/08/25 16:20:01 langmead Exp $
19  ==========================================================================*/
20
21 #ifndef SEQAN_HEADER_BASIC_ALPHABET_INTERFACE2_H
22 #define SEQAN_HEADER_BASIC_ALPHABET_INTERFACE2_H
23
24 #include <new>
25
26 namespace SEQAN_NAMESPACE_MAIN
27 {
28
29 //////////////////////////////////////////////////////////////////////////////
30 // gapValue, gapValueImpl
31 //////////////////////////////////////////////////////////////////////////////
32 /**
33 .Function.gapValueImpl:
34 ..hidefromindex
35 ..cat:Alphabets
36 ..summary:Implements @Function.gapValue@.
37 ..signature:gapValueImpl(value_pointer_tag)
38 ..param.value_pointer_tag:A pointer that is used as a tag to specify the value type.
39 ...remarks:The pointer needs not to point to a valid object, so it is possible to use a null pointer here.
40 ..returns:A gap character.
41 ..remarks.text:This function implements @Function.getValue@. 
42 It is recommended to use @Function.gapValue@ rather than $gapValueImpl$.
43 */
44
45 template <typename T>
46 inline T const &
47 gapValueImpl(T *)
48 {
49 SEQAN_CHECKPOINT
50         static T const _gap = T();
51         return _gap;
52 }
53
54
55 /**
56 .Function.gapValue:
57 ..cat:Alphabets
58 ..cat:Alignments
59 ..summary:Returns reference to a value that is used as gap character.
60 ..signature:gapValue<TValue>()
61 ..param.TValue:Value type.
62 ..returns:A gap character.
63 ..remarks.text:The function is implemented in @Function.gapValueImpl@. 
64 Do not specialize $gapValue$, specialize @Function.gapValueImpl@ instead!
65 ..see:Function.gapValueImpl
66 */
67
68 template <typename T>
69 inline T const &
70 gapValue()
71 {
72 SEQAN_CHECKPOINT
73         T * _tag = 0;
74         return gapValueImpl(_tag);
75 }
76
77
78 //////////////////////////////////////////////////////////////////////////////
79 // supremumValue, supremumValueImpl
80 //////////////////////////////////////////////////////////////////////////////
81
82 /**
83 .Function.supremumValueImpl:
84 ..hidefromindex
85 ..cat:Alphabets
86 ..summary:Implements @Function.supremumValue@.
87 ..signature:supremumValueImpl(value_pointer_tag)
88 ..param.value_pointer_tag:A pointer that is used as a tag to specify the value type.
89 ...remarks:The pointer needs not to point to a valid object, so it is possible to use a null pointer here.
90 ..returns:A value $inf$ that holds: $inf >= i$ for all values $i$.
91 ..remarks.text:This function implements @Function.supremumValue@. 
92 It is recommended to use @Function.supremumValue@ rather than $supremumValueImpl$.
93 */
94
95 /*
96 template <typename T>
97 inline T const &
98 supremumValueImpl(T *)
99 {
100         static T const _value = -1;
101         return _value;
102 }
103 */
104
105 /**
106 .Function.supremumValue:
107 ..cat:Alphabets
108 ..summary:Supremum for a given type.
109 ..signature:supremumValue<T>()
110 ..param.T:An ordered type.
111 ..returns:A value $inf$ that holds: $inf >= i$ for all values $i$ of type $T$.
112 ..remarks.text:The function is implemented in @Function.supremumValueImpl@. 
113 Do not specialize $supremumValue$, specialize @Function.supremumValueImpl@ instead!
114 ..see:Function.supremumValueImpl
115 */
116
117 template <typename T>
118 inline T const &
119 supremumValue()
120 {
121 SEQAN_CHECKPOINT
122         T * _tag = 0;
123         return supremumValueImpl(_tag);
124 }
125
126 //////////////////////////////////////////////////////////////////////////////
127 // infimumValue, infimumValueImpl
128 //////////////////////////////////////////////////////////////////////////////
129
130 /**
131 .Function.infimumValueImpl:
132 ..hidefromindex
133 ..cat:Alphabets
134 ..summary:Implements @Function.infimumValue@.
135 ..signature:infimumValueImpl(value_pointer_tag)
136 ..param.value_pointer_tag:A pointer that is used as a tag to specify the value type.
137 ...remarks:The pointer needs not to point to a valid object, so it is possible to use a null pointer here.
138 ..returns:A value $inf$ that holds: $inf <= i$ for all values $i$.
139 ..remarks.text:This function implements @Function.infimumValue@. 
140 It is recommended to use @Function.infimumValue@ rather than $infimumValueImpl$.
141 */
142
143 /*
144 template <typename T>
145 inline T const &
146 infimumValueImpl(T *)
147 {
148         static T const _value = -1;
149         return _value;
150 }
151 */
152
153 /**
154 .Function.infimumValue:
155 ..cat:Alphabets
156 ..summary:Infimum for a given type.
157 ..signature:infimumValue<T>()
158 ..param.T:An ordered type.
159 ..returns:A value $inf$ that holds: $inf <= i$ for all values $i$ of type $T$.
160 ..remarks.text:The function is implemented in @Function.infimumValueImpl@. 
161 Do not specialize $infimumValue$, specialize @Function.infimumValueImpl@ instead!
162 ..see:Function.infimumValueImpl
163 ..see:Function.supremumValue
164 */
165
166 template <typename T>
167 inline T const &
168 infimumValue()
169 {
170 SEQAN_CHECKPOINT
171         T * _tag = 0;
172         return infimumValueImpl(_tag);
173 }
174
175 //////////////////////////////////////////////////////////////////////////////
176 }// namespace SEQAN_NAMESPACE_MAIN
177
178 #endif //#ifndef SEQAN_HEADER_...