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 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 reference
67  inline IndirectList(const UList<T>& values, const labelUList& addr);
68 
69  //- Move construct addressing, shallow copy values reference
70  inline IndirectList(const UList<T>& values, labelList&& addr);
71 
72  //- Zero-sized addressing, shallow copy values reference
73  inline IndirectList(const UList<T>& values, const Foam::zero);
74 
75  //- Copy construct addressing, shallow copy values reference
76  inline IndirectList(const IndirectList<T>& list);
77 
78  //- Move construct addressing, shallow copy values reference
79  inline IndirectList(IndirectList<T>&& list);
80 
81  //- Copy construct addressing, shallow copy values reference
82  inline explicit IndirectList(const UIndirectList<T>& list);
83 
84 
85  // Member Functions
86 
87  //- The list addressing
89 
90 
91  // Member Operators
92 
93  //- Assignment operator
95 
96  //- Deep copy values, Fatal if list sizes are not identical
97  void operator=(const IndirectList<T>& rhs)
98  {
99  this->copyList(rhs);
100  }
101 };
102 
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 } // End namespace Foam
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #include "IndirectListI.H"
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 #endif
115 
116 // ************************************************************************* //
Foam::IndirectListAddressing::addressing
const Addr & addressing() const noexcept
Const access to the addressing.
Definition: IndirectListAddressing.H:76
Foam::IndirectList::operator=
void operator=(const IndirectList< T > &rhs)
Deep copy values, Fatal if list sizes are not identical.
Definition: IndirectList.H:96
UIndirectList.H
Foam::IndirectListAddressing
A class for storing list addressing (labels, slices etc), which are normally to used by IndirectList....
Definition: IndirectListAddressing.H:48
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: faMatrix.H:60
Foam::IndirectList::IndirectList
IndirectList(const UList< T > &values, const labelUList &addr)
Copy construct addressing, shallow copy values reference.
Definition: IndirectListI.H:33
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62