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