1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Template function to specify if the data of a type are contiguous.
30 The default function specifies that data are not contiguous.
31 This is specialised for the types (eg, primitives) with contiguous data.
33 \*---------------------------------------------------------------------------*/
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 // Forward declaration of friend functions and operators
46 template<class T, unsigned Size> class FixedList;
47 template<class T> class Pair;
50 //- Assume the data associated with type T are not contiguous
52 inline bool contiguous() {return false;}
55 // Data associated with primitive types (and simple fixed size containers
56 // - only size 2 defined here) are contiguous
59 inline bool contiguous<bool>() {return true;}
61 inline bool contiguous<FixedList<bool, 2> >() {return true;}
63 inline bool contiguous<Pair<bool> >() {return true;}
66 inline bool contiguous<char>() {return true;}
68 inline bool contiguous<FixedList<char, 2> >() {return true;}
70 inline bool contiguous<Pair<char> >() {return true;}
73 inline bool contiguous<unsigned char>() {return true;}
75 inline bool contiguous<FixedList<unsigned char, 2> >() {return true;}
77 inline bool contiguous<Pair<unsigned char> >() {return true;}
80 inline bool contiguous<short>() {return true;}
82 inline bool contiguous<FixedList<short, 2> >() {return true;}
84 inline bool contiguous<Pair<short> >() {return true;}
87 inline bool contiguous<unsigned short>() {return true;}
89 inline bool contiguous<FixedList<unsigned short, 2> >() {return true;}
91 inline bool contiguous<Pair<unsigned short> >() {return true;}
94 inline bool contiguous<int>() {return true;}
96 inline bool contiguous<FixedList<int, 2> >() {return true;}
98 inline bool contiguous<Pair<int> >() {return true;}
101 inline bool contiguous<unsigned int>() {return true;}
103 inline bool contiguous<FixedList<unsigned int, 2> >() {return true;}
105 inline bool contiguous<Pair<unsigned int> >() {return true;}
108 inline bool contiguous<long>() {return true;}
110 inline bool contiguous<FixedList<long, 2> >() {return true;}
112 inline bool contiguous<Pair<long> >() {return true;}
115 inline bool contiguous<unsigned long>() {return true;}
117 inline bool contiguous<FixedList<unsigned long, 2> >() {return true;}
119 inline bool contiguous<Pair<unsigned long> >() {return true;}
122 inline bool contiguous<long long>() {return true;}
124 inline bool contiguous<FixedList<long long, 2> >() {return true;}
126 inline bool contiguous<Pair<long long> >() {return true;}
129 inline bool contiguous<unsigned long long>() {return true;}
131 inline bool contiguous<FixedList<unsigned long long, 2> >() {return true;}
133 inline bool contiguous<Pair<unsigned long long> >() {return true;}
136 inline bool contiguous<float>() {return true;}
138 inline bool contiguous<FixedList<float, 2> >() {return true;}
140 inline bool contiguous<Pair<float> >() {return true;}
143 inline bool contiguous<double>() {return true;}
145 inline bool contiguous<FixedList<double, 2> >() {return true;}
147 inline bool contiguous<Pair<double> >() {return true;}
150 inline bool contiguous<long double>() {return true;}
152 inline bool contiguous<FixedList<long double, 2> >() {return true;}
154 inline bool contiguous<Pair<long double> >() {return true;}
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace Foam
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 // ************************************************************************* //