phdMesh  Version of the Day
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
IndexList.hpp
1 /*------------------------------------------------------------------------*/
2 /* phdMesh : Parallel Heterogneous Dynamic unstructured Mesh */
3 /* Copyright (2007) Sandia Corporation */
4 /* */
5 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
6 /* license for use of this work by or on behalf of the U.S. Government. */
7 /* */
8 /* This library is free software; you can redistribute it and/or modify */
9 /* it under the terms of the GNU Lesser General Public License as */
10 /* published by the Free Software Foundation; either version 2.1 of the */
11 /* License, or (at your option) any later version. */
12 /* */
13 /* This library is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
16 /* Lesser General Public License for more details. */
17 /* */
18 /* You should have received a copy of the GNU Lesser General Public */
19 /* License along with this library; if not, write to the Free Software */
20 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 */
21 /* USA */
22 /*------------------------------------------------------------------------*/
27 #ifndef util_IndexList_h
28 #define util_IndexList_h
29 
30 #include <util/Basics.hpp>
31 
32 namespace phdmesh {
33 
37 template< unsigned I0 = 0 , unsigned I1 = 0 ,
38  unsigned I2 = 0 , unsigned I3 = 0 ,
39  unsigned I4 = 0 , unsigned I5 = 0 ,
40  unsigned I6 = 0 , unsigned I7 = 0 ,
41  unsigned I8 = 0 , unsigned I9 = 0 ,
42  unsigned I10 = 0 , unsigned I11 = 0 ,
43  unsigned I12 = 0 , unsigned I13 = 0 ,
44  unsigned I14 = 0 , unsigned I15 = 0 ,
45  unsigned I16 = 0 , unsigned I17 = 0 ,
46  unsigned I18 = 0 , unsigned I19 = 0 ,
47  unsigned I20 = 0 , unsigned I21 = 0 ,
48  unsigned I22 = 0 , unsigned I23 = 0 ,
49  unsigned I24 = 0 , unsigned I25 = 0 ,
50  unsigned I26 = 0 , unsigned I27 = 0 ,
51  unsigned I28 = 0 , unsigned I29 = 0 ,
52  unsigned I30 = 0 , unsigned I31 = 0 >
53 struct IndexList {};
54 
59 template< class List , unsigned J > struct IndexListAt {};
60 
61 #define INDEX_LIST_AT_SPECIALIZATION( J , K ) \
62  template< unsigned I0 , unsigned I1 , \
63  unsigned I2 , unsigned I3 , \
64  unsigned I4 , unsigned I5 , \
65  unsigned I6 , unsigned I7 , \
66  unsigned I8 , unsigned I9 , \
67  unsigned I10 , unsigned I11 , \
68  unsigned I12 , unsigned I13 , \
69  unsigned I14 , unsigned I15 , \
70  unsigned I16 , unsigned I17 , \
71  unsigned I18 , unsigned I19 , \
72  unsigned I20 , unsigned I21 , \
73  unsigned I22 , unsigned I23 , \
74  unsigned I24 , unsigned I25 , \
75  unsigned I26 , unsigned I27 , \
76  unsigned I28 , unsigned I29 , \
77  unsigned I30 , unsigned I31 > \
78 struct IndexListAt< \
79  IndexList< I0 , I1 , I2 , I3 , I4 , I5 , I6 , I7 , \
80  I8 , I9 , I10 , I11 , I12 , I13 , I14 , I15 , \
81  I16 , I17 , I18 , I19 , I20 , I21 , I22 , I23 , \
82  I24 , I25 , I26 , I27 , I28 , I29 , I30 , I31 > , J > \
83 { enum { value = K }; };
84 
85 INDEX_LIST_AT_SPECIALIZATION( 0 , I0 )
86 INDEX_LIST_AT_SPECIALIZATION( 1 , I1 )
87 INDEX_LIST_AT_SPECIALIZATION( 2 , I2 )
88 INDEX_LIST_AT_SPECIALIZATION( 3 , I3 )
89 INDEX_LIST_AT_SPECIALIZATION( 4 , I4 )
90 INDEX_LIST_AT_SPECIALIZATION( 5 , I5 )
91 INDEX_LIST_AT_SPECIALIZATION( 6 , I6 )
92 INDEX_LIST_AT_SPECIALIZATION( 7 , I7 )
93 INDEX_LIST_AT_SPECIALIZATION( 8 , I8 )
94 INDEX_LIST_AT_SPECIALIZATION( 9 , I9 )
95 INDEX_LIST_AT_SPECIALIZATION( 10 , I10 )
96 INDEX_LIST_AT_SPECIALIZATION( 11 , I11 )
97 INDEX_LIST_AT_SPECIALIZATION( 12 , I12 )
98 INDEX_LIST_AT_SPECIALIZATION( 13 , I13 )
99 INDEX_LIST_AT_SPECIALIZATION( 14 , I14 )
100 INDEX_LIST_AT_SPECIALIZATION( 15 , I15 )
101 INDEX_LIST_AT_SPECIALIZATION( 16 , I16 )
102 INDEX_LIST_AT_SPECIALIZATION( 17 , I17 )
103 INDEX_LIST_AT_SPECIALIZATION( 18 , I18 )
104 INDEX_LIST_AT_SPECIALIZATION( 19 , I19 )
105 INDEX_LIST_AT_SPECIALIZATION( 20 , I20 )
106 INDEX_LIST_AT_SPECIALIZATION( 21 , I21 )
107 INDEX_LIST_AT_SPECIALIZATION( 22 , I22 )
108 INDEX_LIST_AT_SPECIALIZATION( 23 , I23 )
109 INDEX_LIST_AT_SPECIALIZATION( 24 , I24 )
110 INDEX_LIST_AT_SPECIALIZATION( 25 , I25 )
111 INDEX_LIST_AT_SPECIALIZATION( 26 , I26 )
112 INDEX_LIST_AT_SPECIALIZATION( 27 , I27 )
113 INDEX_LIST_AT_SPECIALIZATION( 28 , I28 )
114 INDEX_LIST_AT_SPECIALIZATION( 29 , I29 )
115 INDEX_LIST_AT_SPECIALIZATION( 30 , I30 )
116 INDEX_LIST_AT_SPECIALIZATION( 31 , I31 )
117 
118 #undef INDEX_LIST_AT_SPECIALIZATION
119 
120 } // namespace phdmesh
121 
122 #endif
123 
Access member of compile-time list of indices. Defines enum { value = index_at_J }; ...
Definition: IndexList.hpp:59
Compile-time list of indices.
Definition: IndexList.hpp:53