1 // ==========================================================================
2 //                 SeqAn - The Library for Sequence Analysis
3 // ==========================================================================
4 // Copyright (c) 2006-2015, Knut Reinert, FU Berlin
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 //
10 //     * Redistributions of source code must retain the above copyright
11 //       notice, this list of conditions and the following disclaimer.
12 //     * Redistributions in binary form must reproduce the above copyright
13 //       notice, this list of conditions and the following disclaimer in the
14 //       documentation and/or other materials provided with the distribution.
15 //     * Neither the name of Knut Reinert or the FU Berlin nor the names of
16 //       its contributors may be used to endorse or promote products derived
17 //       from this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
23 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
29 // DAMAGE.
30 //
31 // ==========================================================================
32 // Author: Andreas Gogol-Doering <andreas.doering@mdc-berlin.de>
33 // Author: Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>
34 // ==========================================================================
35 
36 #ifndef SEQAN_INCLUDE_SEQAN_ALIGN_GAPPED_VALUE_TYPE_H_
37 #define SEQAN_INCLUDE_SEQAN_ALIGN_GAPPED_VALUE_TYPE_H_
38 
39 namespace seqan {
40 
41 // ============================================================================
42 // Forwards
43 // ============================================================================
44 
45 // ============================================================================
46 // Tags, Classes, Enums
47 // ============================================================================
48 
49 // ============================================================================
50 // Metafunctions
51 // ============================================================================
52 
53 /*!
54  * @mfn GappedValueType
55  * @headerfile <seqan/align.h>
56  * @brief Returns a value type that contains a black value <tt>'-'</tt>.
57  *
58  * @signature GappedValueType<T>::Type
59  *
60  * @tparam T The value type that should be expanded (if needed) by '-'.
61  *
62  * @return Type A type that can store the values of <tt>T</tt> and the value <tt>'-'</tt>.
63  */
64 
65 // TODO(holtgrew): Would it be enough to define it for Nothing instead of having a default implementation.
66 
67 // We need a default implementation since we need it for Nothing.
68 template <typename T>
69 struct GappedValueType
70 {
71     typedef T Type;
72 };
73 
74 template <typename TValue, typename TSpec>
75 struct GappedValueType<SimpleType<TValue, TSpec> >
76 {
77     typedef SimpleType<TValue, TSpec> THost_;
78     typedef ModifiedAlphabet<THost_, ModExpand<'-'> > Type;
79 };
80 
81 // ============================================================================
82 // Functions
83 // ============================================================================
84 
85 }  // namespace seqan
86 
87 #endif  // #ifndef SEQAN_INCLUDE_SEQAN_ALIGN_GAPPED_VALUE_TYPE_H_
88