UILList.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "UILList.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class LListBase, class T>
32 {
33  for (const_iterator iter = lst.begin(); iter != lst.end(); ++iter)
34  {
35  this->append(&iter());
36  }
37 }
38 
39 
40 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
41 
42 template<class LListBase, class T>
44 {
46 
47  for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
48  {
49  this->append(&iter());
50  }
51 }
52 
53 
54 template<class LListBase, class T>
56 (
57  const UILList<LListBase, T>& rhs
58 ) const
59 {
60  if (this->size() != rhs.size())
61  {
62  return false;
63  }
64 
65  bool equal = true;
66 
67  const_iterator iter1 = this->begin();
68  const_iterator iter2 = rhs.begin();
69 
70  for (; iter1 != this->end(); ++iter1, ++iter2)
71  {
72  equal = equal && iter1() == iter2();
73  }
74 
75  return equal;
76 }
77 
78 
79 template<class LListBase, class T>
81 (
82  const UILList<LListBase, T>& rhs
83 ) const
84 {
85  return !operator==(rhs);
86 }
87 
88 
89 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
90 
91 #include "UILListIO.C"
92 
93 
94 // ************************************************************************* //
Template class for intrusive linked lists.
Definition: UILList.H:51
tUEqn clear()
An STL-conforming const_iterator.
Definition: UILList.H:227
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
const iterator & end()
Definition: UILList.H:216
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
bool equal(const T &s1, const T &s2)
Definition: doubleFloat.H:62
UILList()
Null construct.
Definition: UILList.H:88
iterator begin()
Definition: UILList.H:211
void operator=(const UILList< LListBase, T > &)
Definition: UILList.C:43