UILList.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2017 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "UILList.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class LListBase, class T>
35 {
36  for (auto iter = lst.cbegin(); iter != lst.cend(); ++iter)
37  {
38  this->append(&(*iter));
39  }
40 }
41 
42 
43 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
44 
45 template<class LListBase, class T>
47 {
49 
50  for (auto iter = lst.cbegin(); iter != lst.cend(); ++iter)
51  {
52  this->append(&(*iter));
53  }
54 }
55 
56 
57 template<class LListBase, class T>
59 (
60  const UILList<LListBase, T>& rhs
61 ) const
62 {
63  if (this->size() != rhs.size())
64  {
65  return false;
66  }
67 
68  auto iter2 = rhs.cbegin();
69 
70  for (auto iter1 = this->cbegin(); iter1 != this->cend(); ++iter1, ++iter2)
71  {
72  if (!(*iter1 == *iter2))
73  {
74  return false;
75  }
76  }
77 
78  return true;
79 }
80 
81 
82 template<class LListBase, class T>
84 (
85  const UILList<LListBase, T>& rhs
86 ) const
87 {
88  return !operator==(rhs);
89 }
90 
91 
92 // ************************************************************************* //
Foam::UILList::operator=
void operator=(const UILList< LListBase, T > &lst)
Copy assignment.
Definition: UILList.C:46
Foam::UILList::UILList
UILList()=default
Default construct.
UILList.H
Foam::UILList::cbegin
const_iterator cbegin() const
Iterator to first item in list with const access.
Definition: UILList.H:383
append
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
Foam::UILList::cend
const const_iterator & cend() const
End of list for forward iterators.
Definition: UILList.H:420
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
stdFoam::cend
constexpr auto cend(const C &c) -> decltype(c.end())
Return const_iterator to the end of the container c.
Definition: stdFoam.H:137
clear
patchWriters clear()
stdFoam::cbegin
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
Definition: stdFoam.H:113
Foam::UILList
Template class for intrusive linked lists.
Definition: UILList.H:52