IndexList.hpp

00001 /*------------------------------------------------------------------------*/
00002 /*      phdMesh : Parallel Heterogneous Dynamic unstructured Mesh         */
00003 /*                Copyright (2007) Sandia Corporation                     */
00004 /*                                                                        */
00005 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00006 /*  license for use of this work by or on behalf of the U.S. Government.  */
00007 /*                                                                        */
00008 /*  This library is free software; you can redistribute it and/or modify  */
00009 /*  it under the terms of the GNU Lesser General Public License as        */
00010 /*  published by the Free Software Foundation; either version 2.1 of the  */
00011 /*  License, or (at your option) any later version.                       */
00012 /*                                                                        */
00013 /*  This library is distributed in the hope that it will be useful,       */
00014 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of        */
00015 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     */
00016 /*  Lesser General Public License for more details.                       */
00017 /*                                                                        */
00018 /*  You should have received a copy of the GNU Lesser General Public      */
00019 /*  License along with this library; if not, write to the Free Software   */
00020 /*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307   */
00021 /*  USA                                                                   */
00022 /*------------------------------------------------------------------------*/
00027 #ifndef util_IndexList_h
00028 #define util_IndexList_h
00029 
00030 #include <util/Basics.hpp>
00031 
00032 namespace phdmesh {
00033 
00037 template< unsigned  I0 = 0 , unsigned  I1 = 0 ,
00038           unsigned  I2 = 0 , unsigned  I3 = 0 ,
00039           unsigned  I4 = 0 , unsigned  I5 = 0 ,
00040           unsigned  I6 = 0 , unsigned  I7 = 0 ,
00041           unsigned  I8 = 0 , unsigned  I9 = 0 ,
00042           unsigned I10 = 0 , unsigned I11 = 0 ,
00043           unsigned I12 = 0 , unsigned I13 = 0 ,
00044           unsigned I14 = 0 , unsigned I15 = 0 ,
00045           unsigned I16 = 0 , unsigned I17 = 0 ,
00046           unsigned I18 = 0 , unsigned I19 = 0 ,
00047           unsigned I20 = 0 , unsigned I21 = 0 ,
00048           unsigned I22 = 0 , unsigned I23 = 0 ,
00049           unsigned I24 = 0 , unsigned I25 = 0 ,
00050           unsigned I26 = 0 , unsigned I27 = 0 ,
00051           unsigned I28 = 0 , unsigned I29 = 0 ,
00052           unsigned I30 = 0 , unsigned I31 = 0 >
00053 struct IndexList {};
00054 
00059 template< class List , unsigned J > struct IndexListAt {};
00060 
00061 #define INDEX_LIST_AT_SPECIALIZATION( J , K ) \
00062   template< unsigned  I0 , unsigned  I1 , \
00063             unsigned  I2 , unsigned  I3 , \
00064             unsigned  I4 , unsigned  I5 , \
00065             unsigned  I6 , unsigned  I7 , \
00066             unsigned  I8 , unsigned  I9 , \
00067             unsigned I10 , unsigned I11 , \
00068             unsigned I12 , unsigned I13 , \
00069             unsigned I14 , unsigned I15 , \
00070             unsigned I16 , unsigned I17 , \
00071             unsigned I18 , unsigned I19 , \
00072             unsigned I20 , unsigned I21 , \
00073             unsigned I22 , unsigned I23 , \
00074             unsigned I24 , unsigned I25 , \
00075             unsigned I26 , unsigned I27 , \
00076             unsigned I28 , unsigned I29 , \
00077             unsigned I30 , unsigned I31 > \
00078 struct IndexListAt< \
00079   IndexList< I0 ,  I1 ,  I2 ,  I3 ,  I4 ,  I5 ,  I6 ,  I7 , \
00080              I8 ,  I9 , I10 , I11 , I12 , I13 , I14 , I15 , \
00081             I16 , I17 , I18 , I19 , I20 , I21 , I22 , I23 , \
00082             I24 , I25 , I26 , I27 , I28 , I29 , I30 , I31 > , J > \
00083 { enum { value = K }; };
00084 
00085 INDEX_LIST_AT_SPECIALIZATION(  0 ,  I0 )
00086 INDEX_LIST_AT_SPECIALIZATION(  1 ,  I1 )
00087 INDEX_LIST_AT_SPECIALIZATION(  2 ,  I2 )
00088 INDEX_LIST_AT_SPECIALIZATION(  3 ,  I3 )
00089 INDEX_LIST_AT_SPECIALIZATION(  4 ,  I4 )
00090 INDEX_LIST_AT_SPECIALIZATION(  5 ,  I5 )
00091 INDEX_LIST_AT_SPECIALIZATION(  6 ,  I6 )
00092 INDEX_LIST_AT_SPECIALIZATION(  7 ,  I7 )
00093 INDEX_LIST_AT_SPECIALIZATION(  8 ,  I8 )
00094 INDEX_LIST_AT_SPECIALIZATION(  9 ,  I9 )
00095 INDEX_LIST_AT_SPECIALIZATION( 10 , I10 )
00096 INDEX_LIST_AT_SPECIALIZATION( 11 , I11 )
00097 INDEX_LIST_AT_SPECIALIZATION( 12 , I12 )
00098 INDEX_LIST_AT_SPECIALIZATION( 13 , I13 )
00099 INDEX_LIST_AT_SPECIALIZATION( 14 , I14 )
00100 INDEX_LIST_AT_SPECIALIZATION( 15 , I15 )
00101 INDEX_LIST_AT_SPECIALIZATION( 16 , I16 )
00102 INDEX_LIST_AT_SPECIALIZATION( 17 , I17 )
00103 INDEX_LIST_AT_SPECIALIZATION( 18 , I18 )
00104 INDEX_LIST_AT_SPECIALIZATION( 19 , I19 )
00105 INDEX_LIST_AT_SPECIALIZATION( 20 , I20 )
00106 INDEX_LIST_AT_SPECIALIZATION( 21 , I21 )
00107 INDEX_LIST_AT_SPECIALIZATION( 22 , I22 )
00108 INDEX_LIST_AT_SPECIALIZATION( 23 , I23 )
00109 INDEX_LIST_AT_SPECIALIZATION( 24 , I24 )
00110 INDEX_LIST_AT_SPECIALIZATION( 25 , I25 )
00111 INDEX_LIST_AT_SPECIALIZATION( 26 , I26 )
00112 INDEX_LIST_AT_SPECIALIZATION( 27 , I27 )
00113 INDEX_LIST_AT_SPECIALIZATION( 28 , I28 )
00114 INDEX_LIST_AT_SPECIALIZATION( 29 , I29 )
00115 INDEX_LIST_AT_SPECIALIZATION( 30 , I30 )
00116 INDEX_LIST_AT_SPECIALIZATION( 31 , I31 )
00117 
00118 #undef INDEX_LIST_AT_SPECIALIZATION
00119 
00120 } // namespace phdmesh
00121 
00122 #endif
00123 

Generated on Tue Jul 13 09:22:43 2010 for phdMesh by  doxygen 1.4.7