1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Template class for intrusive linked lists.
35 \*---------------------------------------------------------------------------*/
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of friend functions and operators
52 template<class LListBase, class T> class ILList;
54 template<class LListBase, class T> Istream& operator>>
61 /*---------------------------------------------------------------------------*\
62 Class ILList Declaration
63 \*---------------------------------------------------------------------------*/
65 template<class LListBase, class T>
68 public UILList<LListBase, T>
70 // Private member functions
72 //- Read from Istream using given Istream constructor class
74 void read(Istream&, const INew&);
85 //- Construct given initial T
88 UILList<LListBase, T>(a)
91 //- Construct from Istream
95 ILList(const ILList<LListBase, T>&);
97 //- Copy constructor with additional argument for clone
98 template<class CloneArg>
99 ILList(const ILList<LListBase, T>& lst, const CloneArg& cloneArg)
100 #ifdef __INTEL_COMPILER
102 UILList<LListBase, T>()
106 typename UILList<LListBase, T>::const_iterator iter =
112 append(iter().clone(cloneArg).ptr());
119 //- Construct from Istream using given Istream constructor class
121 ILList(Istream&, const INew&);
133 //- Remove the head element specified from the list and delete it
136 //- Remove the specified element from the list and delete it
139 //- Clear the contents of the list
142 //- Transfer the contents of the argument into this List
143 // and annull the argument list.
144 void transfer(ILList<LListBase, T>&);
149 void operator=(const ILList<LListBase, T>&);
154 //- Read List from Istream, discarding contents of existing List.
155 friend Istream& operator>> <LListBase, T>
158 ILList<LListBase, T>&
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 // ************************************************************************* //