1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 inline Foam::SubList<T>::SubList
35 UList<T>(list.v_, subSize)
38 list.checkSize(subSize);
44 inline Foam::SubList<T>::SubList
48 const label startIndex
51 UList<T>(&(list.v_[startIndex]), subSize)
55 // Artificially allow the start of a zero-sized subList to be
56 // one past the end of the original list.
59 list.checkStart(startIndex);
60 list.checkSize(startIndex + subSize);
64 // Start index needs to fall between 0 and size. One position
65 // behind the last element is allowed
66 list.checkSize(startIndex);
72 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 inline const Foam::SubList<T>& Foam::SubList<T>::null()
77 return *reinterpret_cast< SubList<T>* >(0);
81 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
84 inline Foam::SubList<T>::operator const Foam::List<T>&() const
86 return *reinterpret_cast< const List<T>* >(this);
91 inline void Foam::SubList<T>::operator=(const T& t)
93 UList<T>::operator=(t);
97 // ************************************************************************* //