Loading...
Searching...
No Matches
ILList.H
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-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::ILList
29
30Description
31 Template class for intrusive linked lists.
32
33SourceFiles
34 ILList.C
35 ILListIO.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_ILList_H
40#define Foam_ILList_H
41
42#include "UILList.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
48
49// Forward Declarations
50template<class LListBase, class T> class ILList;
51
52template<class LListBase, class T> Istream& operator>>
53(
54 Istream& is,
56);
57
58
59/*---------------------------------------------------------------------------*\
60 Class ILList Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class LListBase, class T>
64class ILList
65:
66 public UILList<LListBase, T>
67{
68 // Private Member Functions
69
70 //- Read from Istream using given Istream constructor class
71 template<class INew>
72 void readIstream(Istream& is, const INew& inew);
73
74
75public:
76
77 // Constructors
78
79 //- Default construct
80 ILList() = default;
81
82 //- Construct and add initial item pointer
83 explicit ILList(T* item)
84 :
85 UILList<LListBase, T>(item)
86 {}
87
88 //- Construct from Istream
89 explicit ILList(Istream& is);
90
91 //- Copy construct using the 'clone()' method for each element
93
94 //- Move construct
96
97 //- Copy constructor with additional argument for clone 'clone()'
98 template<class CloneArg>
99 ILList(const ILList<LListBase, T>& lst, const CloneArg& cloneArg);
100
101 //- Construct from Istream using given Istream constructor class
102 template<class INew>
103 ILList(Istream& is, const INew& inew);
104
105
106 //- Destructor. Calls clear()
107 ~ILList();
109
110 // Member Functions
111
112 //- Clear the contents of the list
113 void clear();
115 //- Remove first element(s) from the list (deletes pointers)
116 void pop_front(label n = 1);
117
118 //- Remove the specified element from the list and delete it
119 bool erase(T* item);
121 //- Transfer the contents of the argument into this List
122 //- and annul the argument list.
124
125
126 // Member Operators
127
128 //- Copy assignment using the 'clone()' method for each element
129 void operator=(const ILList<LListBase, T>& lst);
130
131 //- Move assignment
134
135 // Istream Operator
136
137 //- Read from Istream, discarding existing contents.
138 friend Istream& operator>> <LListBase, T>
139 (
140 Istream& is,
142 );
143};
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148} // End namespace Foam
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152#ifdef NoRepository
153 #include "ILList.C"
154 #include "ILListIO.C"
155#endif
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159#endif
160
161// ************************************************************************* //
label n
Template class for intrusive linked lists.
Definition ILList.H:62
ILList(Istream &is, const INew &inew)
void transfer(ILList< DLListBase, T > &lst)
ILList(const ILList< DLListBase, T > &lst, const CloneArg &cloneArg)
ILList(ILList< DLListBase, T > &&lst)
ILList()=default
Default construct.
ILList(const ILList< DLListBase, T > &lst)
void operator=(ILList< DLListBase, T > &&lst)
void operator=(const ILList< DLListBase, T > &lst)
A helper class when constructing from an Istream or dictionary.
Definition INew.H:47
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Template class for intrusive linked lists.
Definition UILList.H:65
UILList()=default
Default construct.
Namespace for OpenFOAM.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)