IndirectList.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-2019 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 Class
28  Foam::IndirectList
29 
30 Description
31  A List with indirect addressing.
32 
33 See also
34  Foam::UIndirectList for a version without any addressing allocation.
35 
36 SourceFiles
37  IndirectListI.H
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef IndirectList_H
42 #define IndirectList_H
43 
44 #include "IndirectListAddressing.H"
45 #include "UIndirectList.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class IndirectList Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class T>
57 class IndirectList
58 :
59  private IndirectListAddressing<labelList>,
60  public UIndirectList<T>
61 {
62 public:
63 
64  // Constructors
65 
66  //- Copy construct addressing, shallow copy values list reference
67  inline IndirectList(const UList<T>& values, const labelUList& addr);
68 
69  //- Move construct addressing, shallow copy values list reference
70  inline IndirectList(const UList<T>& values, labelList&& addr);
71 
72  //- Copy construct addressing, shallow copy values list reference
73  inline IndirectList(const IndirectList<T>& list);
74 
75  //- Move construct addressing, shallow copy values list reference
76  inline IndirectList(IndirectList<T>&& list);
77 
78  //- Copy construct addressing, shallow copy values list reference
79  inline explicit IndirectList(const UIndirectList<T>& list);
80 
81 
82  // Member Functions
83 
84  //- The list addressing
86 
87 
88  // Member Operators
89 
90  //- Assignment operator
92 
93  //- Deep copy values, Fatal if list sizes are not identical
94  void operator=(const IndirectList<T>& rhs)
95  {
96  this->copyList(rhs);
97  }
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 } // End namespace Foam
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #include "IndirectListI.H"
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 #endif
112 
113 // ************************************************************************* //
Foam::IndirectList::operator=
void operator=(const IndirectList< T > &rhs)
Deep copy values, Fatal if list sizes are not identical.
Definition: IndirectList.H:93
Foam::IndirectListAddressing::addressing
const Addr & addressing() const
Const access to the addressing.
Definition: IndirectListAddressing.H:78
UIndirectList.H
Foam::IndirectListAddressing
A class for storing list addressing (labels, slices etc), which are normally to used by IndirectList....
Definition: IndirectListAddressing.H:50
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
IndirectListI.H
Foam::IndirectList
A List with indirect addressing.
Definition: IndirectList.H:56
IndirectListAddressing.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< label >
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::UIndirectList
A List with indirect addressing.
Definition: fvMatrix.H:109
Foam::IndirectList::IndirectList
IndirectList(const UList< T > &values, const labelUList &addr)
Copy construct addressing, shallow copy values list reference.
Definition: IndirectListI.H:33