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 INCLUDE_SEQAN_BASIC_PROPERTY_MAP_CONCEPT_H_ 36 #define INCLUDE_SEQAN_BASIC_PROPERTY_MAP_CONCEPT_H_ 37 38 namespace seqan { 39 40 // ============================================================================ 41 // Forwards 42 // ============================================================================ 43 44 // ============================================================================ 45 // Tags, Classes, Enums 46 // ============================================================================ 47 48 // ---------------------------------------------------------------------------- 49 // Concept PropertyMapConcept 50 // ---------------------------------------------------------------------------- 51 52 /*! 53 * @concept PropertyMapConcept 54 * @headerfile <seqan/graph_types.h> 55 * @brief Concept for maps from contained elements (such as graph vertices or index nodes) to values. 56 * 57 * @signature concept PropertyMapConcept; 58 */ 59 60 /*! 61 * @mfn PropertyMapConcept#Value 62 * @brief Returns the value type of the property map. 63 * 64 * @signature Value<TPropertyMap>::Type 65 * 66 * @tparam TPropertyMap The property map to query. 67 * 68 * @return Type The element type of the container. 69 * 70 * @see PropertyMapConcept#Value 71 */ 72 73 /*! 74 * @mfn PropertyMapConcept#GetValue 75 * @brief Returns the get-value type of the property map. 76 * 77 * @signature GetValue<TPropertyMap>::Type 78 * 79 * @tparam TPropertyMap The property map to query. 80 * 81 * @return Type The get-value type of the container. 82 * 83 * @see PropertyMapConcept#GetValue 84 */ 85 86 /*! 87 * @mfn PropertyMapConcept#Reference 88 * @brief Returns the reference type of the property map. 89 * 90 * @signature Reference<TPropertyMap>::Type 91 * 92 * @tparam TPropertyMap The property map to query. 93 * 94 * @see PropertyMapConcept#Reference 95 */ 96 97 /*! 98 * @fn PropertyMapConcept#assignProperty 99 * @brief Assigns a property to an item in the property map. 100 * 101 * @signature void assignProperty(pm, d, val); 102 * 103 * @param[in,out] pm The property map 104 * @param[in] d A vertex or edge descriptor that identifies the item in the property map. 105 * @param[in] val The new value, where the type of the new value must match the value type of the property map. 106 */ 107 108 /*! 109 * @fn PropertyMapConcept#property 110 * @brief Accesses the property of an item in the property map. 111 * 112 * @signature TReference property(pm, d); 113 * 114 * @param[in,out] pm The property map. 115 * @param[in] d A vertex or edge descriptor that identifies the item in the property map. 116 * 117 * @return TReference Reference to the item in the property map of type @link Reference @endlink. 118 */ 119 120 /*! 121 * @fn PropertyMapConcept#getProperty 122 * @brief Get method for an item's property. 123 * 124 * @signature TGetValue getProperty(pm, d); 125 * 126 * @param[in,out] pm The property map. 127 * @param[in] d A vertex or edge descriptor that identifies the item in the property map. 128 * 129 * @return TGetValue Get-value to the item in the property map of type @link PropertyMapConcept#GetValue 130 * GetValue @endlink. 131 */ 132 133 /*! 134 * @fn PropertyMapConcept#resize 135 * @brief Resize a sequence. 136 * 137 * @signature void resize(pm, len[, val]); 138 * 139 * @param[in,out] seq Sequence to resize. 140 * @param[in] len Length to resize <tt>seq</tt> to. 141 * @param[in] val When increasing the size, <tt>val</tt> is used to fill new entries. When omitted, 142 * <tt>TValue()</tt> is used where <tt>TValue</tt> is the @link ContainerConcept#Value @endlink 143 * type of the sequence. 144 * 145 * @see StringConcept#resize 146 */ 147 148 SEQAN_CONCEPT(PropertyMapConcept, (TPropertyMap)) 149 { 150 public: 151 typedef typename Value<TPropertyMap>::Type TValue; 152 typedef typename GetValue<TPropertyMap>::Type TGetValue; 153 typedef typename Reference<TPropertyMap>::Type TReference; 154 SEQAN_CONCEPT_USAGE(PropertyMapConcept)155 SEQAN_CONCEPT_USAGE(PropertyMapConcept) 156 {} 157 }; 158 159 // ============================================================================ 160 // Metafunctions 161 // ============================================================================ 162 163 // ============================================================================ 164 // Functions 165 // ============================================================================ 166 167 } // namespace seqan 168 169 #endif // #ifndef INCLUDE_SEQAN_BASIC_PROPERTY_MAP_CONCEPT_H_ 170