array-traits.hpp
Go to the documentation of this file.00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 00002 /* 00003 * Main authors: 00004 * Christian Schulte <schulte@gecode.org> 00005 * 00006 * Copyright: 00007 * Christian Schulte, 2005 00008 * 00009 * Last modified: 00010 * $Date: 2010-05-15 16:19:43 +0200 (Sat, 15 May 2010) $ by $Author: schulte $ 00011 * $Revision: 10954 $ 00012 * 00013 * This file is part of Gecode, the generic constraint 00014 * development environment: 00015 * http://www.gecode.org 00016 * 00017 * Permission is hereby granted, free of charge, to any person obtaining 00018 * a copy of this software and associated documentation files (the 00019 * "Software"), to deal in the Software without restriction, including 00020 * without limitation the rights to use, copy, modify, merge, publish, 00021 * distribute, sublicense, and/or sell copies of the Software, and to 00022 * permit persons to whom the Software is furnished to do so, subject to 00023 * the following conditions: 00024 * 00025 * The above copyright notice and this permission notice shall be 00026 * included in all copies or substantial portions of the Software. 00027 * 00028 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00029 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00030 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00031 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 00032 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 00033 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00034 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00035 * 00036 */ 00037 00038 namespace Gecode { 00039 00040 class IntVarArgs; 00041 class IntVarArray; 00042 class BoolVarArgs; 00043 class BoolVarArray; 00044 class IntArgs; 00045 00047 template<> 00048 class ArrayTraits<VarArgArray<IntVar> > { 00049 public: 00050 typedef IntVarArgs StorageType; 00051 typedef IntVar ValueType; 00052 typedef IntVarArgs ArgsType; 00053 }; 00054 00056 template<> 00057 class ArrayTraits<VarArray<IntVar> > { 00058 public: 00059 typedef IntVarArray StorageType; 00060 typedef IntVar ValueType; 00061 typedef IntVarArgs ArgsType; 00062 }; 00063 00065 template<> 00066 class ArrayTraits<VarArgArray<BoolVar> > { 00067 public: 00068 typedef BoolVarArgs StorageType; 00069 typedef BoolVar ValueType; 00070 typedef BoolVarArgs ArgsType; 00071 }; 00072 00074 template<> 00075 class ArrayTraits<VarArray<BoolVar> > { 00076 public: 00077 typedef BoolVarArray StorageType; 00078 typedef BoolVar ValueType; 00079 typedef BoolVarArgs ArgsType; 00080 }; 00081 00083 template<> 00084 class ArrayTraits<PrimArgArray<int> > { 00085 public: 00086 typedef IntArgs StorageType; 00087 typedef int ValueType; 00088 typedef IntArgs ArgsType; 00089 }; 00090 00092 template<> 00093 class ArrayTraits<ArgArray<IntSet> > { 00094 public: 00095 typedef IntSetArgs StorageType; 00096 typedef IntSet ValueType; 00097 typedef IntSetArgs ArgsType; 00098 }; 00099 00101 template<> 00102 class ArrayTraits<IntVarArray> { 00103 public: 00104 typedef IntVarArray StorageType; 00105 typedef IntVar ValueType; 00106 typedef IntVarArgs ArgsType; 00107 }; 00108 00110 template<> 00111 class ArrayTraits<IntVarArgs> { 00112 public: 00113 typedef IntVarArgs StorageType; 00114 typedef IntVar ValueType; 00115 typedef IntVarArgs ArgsType; 00116 }; 00117 00119 template<> 00120 class ArrayTraits<IntArgs> { 00121 public: 00122 typedef IntArgs StorageType; 00123 typedef int ValueType; 00124 typedef IntArgs ArgsType; 00125 }; 00126 00128 template<> 00129 class ArrayTraits<BoolVarArray> { 00130 public: 00131 typedef BoolVarArray StorageType; 00132 typedef BoolVar ValueType; 00133 typedef BoolVarArgs ArgsType; 00134 }; 00135 00137 template<> 00138 class ArrayTraits<BoolVarArgs> { 00139 public: 00140 typedef BoolVarArgs StorageType; 00141 typedef BoolVar ValueType; 00142 typedef BoolVarArgs ArgsType; 00143 }; 00144 00145 } 00146 00147 // STATISTICS: int-other