IndirectListAddressing.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) 2017-2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::IndirectListAddressing
28 
29 Description
30  A class for storing list addressing (labels, slices etc), which are
31  normally to used by IndirectList.
32  Private inheritance is often used by any inheriting classes.
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef IndirectListAddressing_H
37 #define IndirectListAddressing_H
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class IndirectListAddressing Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 template<class Addr>
50 {
51  // Private Data
52 
53  //- Storage for addressing
54  Addr storedAddr_;
55 
56 
57 public:
58 
59  // Constructors
60 
61  //- Copy construct from addressing information
62  IndirectListAddressing(const Addr& addr)
63  :
64  storedAddr_(addr)
65  {}
66 
67  //- Move construct from addressing information
68  IndirectListAddressing(Addr&& addr)
69  :
70  storedAddr_(std::move(addr))
71  {}
72 
73 
74  // Member Functions
75 
76  //- Const access to the addressing
77  const Addr& addressing() const noexcept
78  {
79  return storedAddr_;
80  }
81 
82  //- Non-const access to the addressing
83  Addr& addressing() noexcept
84  {
85  return storedAddr_;
86  }
87 };
88 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 } // End namespace Foam
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 #endif
97 
98 // ************************************************************************* //
Foam::IndirectListAddressing::addressing
const Addr & addressing() const noexcept
Const access to the addressing.
Definition: IndirectListAddressing.H:76
Foam::IndirectListAddressing
A class for storing list addressing (labels, slices etc), which are normally to used by IndirectList....
Definition: IndirectListAddressing.H:48
Foam::IndirectListAddressing::IndirectListAddressing
IndirectListAddressing(Addr &&addr)
Move construct from addressing information.
Definition: IndirectListAddressing.H:67
Foam::IndirectListAddressing::addressing
Addr & addressing() noexcept
Non-const access to the addressing.
Definition: IndirectListAddressing.H:82
Foam::IndirectListAddressing::IndirectListAddressing
IndirectListAddressing(const Addr &addr)
Copy construct from addressing information.
Definition: IndirectListAddressing.H:61
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33