1 // ========================================================================== 2 // SeqAn - The Library for Sequence Analysis 3 // ========================================================================== 4 // Copyright (c) 2006-2018, 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: Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de> 33 // ========================================================================== 34 35 #ifndef SEQAN_INCLUDE_SEQAN_BASIC_AGGREGATE_CONCEPT_H_ 36 #define SEQAN_INCLUDE_SEQAN_BASIC_AGGREGATE_CONCEPT_H_ 37 38 namespace seqan { 39 40 // ============================================================================ 41 // Forwards 42 // ============================================================================ 43 44 // ============================================================================ 45 // Tags, Classes, Enums 46 // ============================================================================ 47 48 /*! 49 * @concept AggregateConcept 50 * 51 * @brief Aggregate types contain a fixed number of fixed-size values (pairs, triples, tuples). 52 * 53 * Stream output operators are not shown in the function list below, but required. 54 * 55 * Comparison operators are not shown in the function list below, but required. 56 */ 57 58 /*! 59 * @fn AggregateConcept#operator<< 60 * @brief Stream output operator. 61 * 62 * @signature TStream AggregateConcept::operator<<(stream, aggregate); 63 * 64 * @param[in,out] stream The <tt>std::ostream</tt> to write to. 65 * @param[in] aggregate The aggregate type to write to the stream. 66 * 67 * @return TStream Reference to <tt>stream</tt> after writing <tt>aggregate</tt> to it. 68 */ 69 70 /*! 71 * @defgroup AggregateTags Aggregate Tags 72 * @brief Tags to use in aggregate (e.g. Pair, Triple, and Tuple) types. 73 */ 74 75 /*! 76 * @tag AggregateTags#Pack 77 * @headerfile <seqan/basic.h> 78 * @brief Tag to mark a packed specialization that disables address alignment for members. 79 * 80 * @signature typedef Tag<Pack_> Pack; 81 */ 82 83 struct Pack_; 84 typedef Tag<Pack_> Pack; 85 86 // TODO(holtgrew): We need @tparam for tag in the Dox system. 87 88 /*! 89 * @tag AggregateTags#BitPacked 90 * @headerfile <seqan/basic.h> 91 * @brief Tag to mark a bit-packed specialization that avoids to waste bits. 92 * 93 * @signature template <[unsinged BITSIZE1[, unsigned BITSIZE2]]> 94 * struct BitPacked; 95 * 96 * BITSIZE1 The number of bits for the first entry. 97 * 98 * BITSIZE2 The number of bits for the second entry. 99 */ 100 101 template <unsigned BITSIZE1 = 16, unsigned BITSIZE2 = 16> 102 struct BitPacked; 103 104 // ============================================================================ 105 // Metafunctions 106 // ============================================================================ 107 108 /*! 109 * @mfn MakePacked 110 * @headerfile <seqan/basic.h> 111 * @brief Return the corresponding packed type for a type. 112 * 113 * @signature MakePacked<TAggregate>::Type; 114 * 115 * @tparam TAggregate The aggregate type to transform. 116 * 117 * @return Type The resulting packed type. 118 */ 119 120 template <typename T> 121 struct MakePacked 122 { 123 typedef T Type; 124 }; 125 126 // ============================================================================ 127 // Functions 128 // ============================================================================ 129 130 } // namespace seqan 131 132 #endif // #ifndef SEQAN_INCLUDE_SEQAN_BASIC_AGGREGATE_CONCEPT_H_ 133