OpenFOAM: API Guide
v2006
The open source CFD toolbox
PtrListDetailI.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) 2018 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
\*---------------------------------------------------------------------------*/
27
28
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
29
30
template
<
class
T>
31
inline
constexpr
Foam::Detail::PtrListDetail<T>::PtrListDetail
() noexcept
32
:
33
List
<
T
*>()
34
{}
35
36
37
template
<
class
T>
38
inline
Foam::Detail::PtrListDetail<T>::PtrListDetail
(
const
label len)
39
:
40
List
<
T
*>(len, reinterpret_cast<
T
*>(0))
41
{}
42
43
44
template
<
class
T>
45
inline
Foam::Detail::PtrListDetail<T>::PtrListDetail
46
(
47
const
PtrListDetail<T>
& list
48
)
49
:
50
List<T*>
(list)
51
{}
52
53
54
template
<
class
T>
55
inline
Foam::Detail::PtrListDetail<T>::PtrListDetail
56
(
57
PtrListDetail<T>
&& list
58
)
59
:
60
List<T*>
(std::move(list))
61
{}
62
63
64
template
<
class
T>
65
inline
Foam::Detail::PtrListDetail<T>::PtrListDetail
66
(
67
PtrListDetail<T>
& list,
68
bool
reuse
69
)
70
:
71
List<T*>
(list, reuse)
72
{}
73
74
75
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76
77
template
<
class
T>
78
inline
void
Foam::Detail::PtrListDetail<T>::setAddressableSize
(
const
label
n
)
79
{
80
List<T*>::size
(
n
);
81
}
82
83
84
template
<
class
T>
85
inline
void
Foam::Detail::PtrListDetail<T>::resize
(
const
label newLen)
86
{
87
if
(newLen <= 0)
88
{
89
List<T*>::clear
();
90
}
91
else
if
(newLen !=
List<T*>::size
())
92
{
93
// Truncate or extend. Any new elements are initialized to nullptr.
94
List<T*>::resize
(newLen,
reinterpret_cast<
T
*
>
(0));
95
}
96
}
97
98
99
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
100
101
template
<
class
T>
102
inline
void
Foam::Detail::PtrListDetail<T>::operator
=
103
(
104
const
PtrListDetail<T>
& list
105
)
106
{
107
List<T*>::operator=
(list);
// shallow copy
108
}
109
110
111
template
<
class
T>
112
inline
void
Foam::Detail::PtrListDetail<T>::operator
=
113
(
114
PtrListDetail<T>
&& list
115
)
116
{
117
List<T*>::transfer
(list);
118
}
119
120
121
// ************************************************************************* //
Foam::Detail::PtrListDetail::PtrListDetail
constexpr PtrListDetail() noexcept
Construct null.
Definition:
PtrListDetailI.H:31
Foam::Detail::PtrListDetail::setAddressableSize
void setAddressableSize(const label n)
Override size to be inconsistent with allocated storage.
Definition:
PtrListDetailI.H:78
n
label n
Definition:
TABSMDCalcMethod2.H:31
resize
patchWriters resize(patchIds.size())
T
const volScalarField & T
Definition:
createFieldRefs.H:2
clear
patchWriters clear()
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition:
HashTable.H:102
Foam::Detail::PtrListDetail::resize
void resize(const label newLen)
Reset size of list.
Definition:
PtrListDetailI.H:85
Foam::Detail::PtrListDetail
A rudimentary list of pointers used for PtrList, UPtrList, etc. This class is considered implementati...
Definition:
PtrListDetail.H:61
src
OpenFOAM
containers
PtrLists
PtrListDetail
PtrListDetailI.H
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.