SliceList.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) 2019 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::SliceList
28
29Description
30 A List with indirect slice addressing.
31
32SourceFiles
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef SliceList_H
37#define SliceList_H
38
40#include "IndirectListBase.H"
41#include "sliceRange.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class SliceList Declaration
50\*---------------------------------------------------------------------------*/
51
52template<class T>
53class SliceList
54:
55 private IndirectListAddressing<sliceRange>,
56 public IndirectListBase<T, sliceRange>
57{
58public:
59
60 // Constructors
61
62 //- Copy construct from values list and slicing
63 SliceList(const UList<T>& values, const sliceRange& addr)
64 :
67 (
68 values,
70 )
71 {}
72
73
74 // Member Functions
75
76 //- The list addressing
78
79
80 // Member Operators
81
82 //- Use standard assignment operations
83 using IndirectListBase<T, sliceRange>::operator=;
84};
85
86
87// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88
89} // End namespace Foam
90
91// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92
93#endif
94
95// ************************************************************************* //
A class for storing list addressing (labels, slices etc), which are normally to used by IndirectList....
const Addr & addressing() const noexcept
Const access to the addressing.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
const UList< T > & values() const noexcept
The list of values (without addressing)
A List with indirect slice addressing.
Definition: SliceList.H:56
const Addr & addressing() const noexcept
The list addressing.
SliceList(const UList< T > &values, const sliceRange &addr)
Copy construct from values list and slicing.
Definition: SliceList.H:62
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
A set of labels defined by a start, a length and a stride.
Definition: sliceRange.H:59
const volScalarField & T
Namespace for OpenFOAM.