Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
7da7907e
Commit
7da7907e
authored
Jan 30, 2020
by
Andrew Heather
Browse files
Merge branch 'comp-generated-methods' into 'develop'
Generated methods See merge request
!335
parents
c83cc8cb
4ecc6ccf
Changes
101
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Bits/PackedList/PackedList.H
View file @
7da7907e
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-20
19
OpenCFD Ltd.
Copyright (C) 2017-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -105,7 +105,7 @@ SourceFiles
namespace
Foam
{
// Forward
d
eclarations
// Forward
D
eclarations
template
<
unsigned
Width
>
class
PackedList
;
class
labelRange
;
...
...
@@ -230,7 +230,7 @@ public:
// Constructors
//-
N
ul
l
construct
or
//-
Defa
ul
t
construct
, zero-sized and no allocation
inline
constexpr
PackedList
()
noexcept
;
//- Construct for given number of elements, initializes values to 0
...
...
@@ -451,6 +451,7 @@ public:
class
reference
{
protected:
friend
class
PackedList
;
// Access for parent
void
operator
&
()
=
delete
;
// Refuse to provide its address
...
...
@@ -472,10 +473,16 @@ public:
public:
//- Copy construct
reference
(
const
reference
&
)
=
default
;
//- Move construct
reference
(
reference
&&
)
=
default
;
//- Value assignment
inline
void
operator
=
(
const
reference
&
other
);
//- Value assignment
.
//- Value assignment
inline
void
operator
=
(
const
unsigned
int
val
);
//- Conversion operator.
...
...
src/OpenFOAM/containers/Bits/bitSet/bitSet.H
View file @
7da7907e
...
...
@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-20
19
OpenCFD Ltd.
Copyright (C) 2018-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -54,7 +54,7 @@ See also
namespace
Foam
{
// Forward
d
eclarations
// Forward
D
eclarations
class
bitSet
;
class
labelRange
;
...
...
@@ -131,13 +131,14 @@ public:
class
const_iterator
;
typedef
unsigned
int
const_reference
;
//- Define class name and debug
//- Declare type-name (with debug switch)
ClassName
(
"bitSet"
);
// Constructors
//-
C
onstruct an empty, zero-sized set
//-
Default c
onstruct an empty, zero-sized set
inline
bitSet
()
noexcept
;
//- Construct from Istream
...
...
@@ -438,6 +439,7 @@ public:
public
PackedList
<
1
>::
reference
{
protected:
friend
class
bitSet
;
// Access for parent
void
operator
&
()
=
delete
;
// Refuse to provide its address
...
...
@@ -447,6 +449,12 @@ public:
public:
//- Copy construct
reference
(
const
reference
&
)
=
default
;
//- Move construct
reference
(
reference
&&
)
=
default
;
//- Flip the bit at the position, no range-checking
inline
void
flip
();
...
...
@@ -474,7 +482,7 @@ public:
//- Global position of the current \a on bit
label
pos_
;
//-
C
onstruct
null
- an end iterator
//-
Default c
onstruct - an end iterator
inline
const_iterator
()
noexcept
;
//- Construct begin iterator
...
...
src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
View file @
7da7907e
...
...
@@ -206,7 +206,7 @@ public:
// Constructors
//-
C
onstruct
null
with default (128) table capacity
//-
Default c
onstruct with default (128) table capacity
HashTable
();
//- Construct given initial table capacity
...
...
@@ -550,6 +550,7 @@ protected:
class
Iterator
{
public:
// Typedefs
using
iterator_category
=
std
::
forward_iterator_tag
;
using
difference_type
=
this_type
::
difference_type
;
...
...
@@ -671,6 +672,7 @@ public:
public
Iterator
<
false
>
{
public:
// Typedefs
using
iterator_category
=
std
::
forward_iterator_tag
;
using
difference_type
=
this_type
::
difference_type
;
...
...
@@ -684,8 +686,8 @@ public:
// Constructors
//-
C
onstruct
null
(end iterator)
inline
iterator
()
=
default
;
//-
Default c
onstruct (end iterator)
iterator
()
=
default
;
//- Copy construct from similar access type
inline
explicit
iterator
(
const
Iterator
<
false
>&
iter
)
...
...
@@ -729,6 +731,7 @@ public:
public
Iterator
<
true
>
{
public:
// Typedefs
using
iterator_category
=
std
::
forward_iterator_tag
;
using
difference_type
=
this_type
::
difference_type
;
...
...
@@ -741,8 +744,11 @@ public:
// Constructors
//- Construct null (end iterator)
inline
const_iterator
()
=
default
;
//- Default construct (end iterator)
const_iterator
()
=
default
;
//- Copy construct
const_iterator
(
const
const_iterator
&
)
=
default
;
//- Copy construct from similar access type
inline
explicit
const_iterator
(
const
Iterator
<
true
>&
iter
)
...
...
@@ -781,8 +787,10 @@ public:
inline
const_iterator
&
operator
++
();
inline
const_iterator
operator
++
(
int
);
// Assignment
//- Copy assignment
const_iterator
&
operator
=
(
const
const_iterator
&
)
=
default
;
// Allow assign from iterator to const_iterator
...
...
@@ -805,6 +813,7 @@ public:
public
Iter
{
public:
using
value_type
=
this_type
::
key_type
;
using
reference
=
const
Key
&
;
...
...
src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H
View file @
7da7907e
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-20
19
OpenCFD Ltd.
Copyright (C) 2017-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -72,7 +72,7 @@ public:
//- Pointer to next entry in list
link
*
next_
=
nullptr
;
//-
N
ul
l
construct
//-
Defa
ul
t
construct
link
()
=
default
;
//- Check if the node is registered with the list
...
...
@@ -85,7 +85,7 @@ public:
private:
// Private
Member
Data
// Private Data
//- Pointer to first element
link
*
first_
=
nullptr
;
...
...
@@ -97,15 +97,6 @@ private:
label
size_
=
0
;
// Private Member Functions
//- No copy construct
DLListBase
(
const
DLListBase
&
)
=
delete
;
//- No copy assignment
void
operator
=
(
const
DLListBase
&
)
=
delete
;
protected:
// Protected Member Functions
...
...
@@ -142,14 +133,19 @@ public:
friend
class
const_iterator
;
//
Constructor
s
//
Generated Method
s
//-
N
ul
l
construct
//-
Defa
ul
t
construct
DLListBase
()
=
default
;
//- No copy construct
DLListBase
(
const
DLListBase
&
)
=
delete
;
//- Destructor
~
DLListBase
()
=
default
;
//- No copy assignment
void
operator
=
(
const
DLListBase
&
)
=
delete
;
//- Destructor
~
DLListBase
()
=
default
;
// Member Functions
...
...
@@ -233,6 +229,9 @@ public:
public:
//- Copy construct
iterator
(
const
iterator
&
)
=
default
;
//- Construct for a node on a list
inline
iterator
(
DLListBase
*
list
,
link
*
item
);
...
...
@@ -280,15 +279,15 @@ public:
public:
//- Copy construct
const_iterator
(
const
const_iterator
&
)
=
default
;
//- Construct for a node on a list
inline
const_iterator
(
const
DLListBase
*
list
,
const
link
*
item
);
//- Copy construct from a non-const iterator
inline
const_iterator
(
const
DLListBase
::
iterator
&
iter
);
//- Copy construct
const_iterator
(
const
const_iterator
&
)
=
default
;
//- The storage node
inline
const
link
*
get_node
()
const
;
...
...
@@ -308,6 +307,7 @@ public:
//- Move forward through list
inline
void
next
();
//- Copy assignment
const_iterator
&
operator
=
(
const
const_iterator
&
)
=
default
;
inline
bool
operator
==
(
const
const_iterator
&
)
const
;
...
...
src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H
View file @
7da7907e
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-20
19
OpenCFD Ltd.
Copyright (C) 2017-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -69,14 +69,14 @@ public:
//- Pointer to next entry in list
link
*
next_
=
nullptr
;
//-
N
ul
l
construct
//-
Defa
ul
t
construct
link
()
=
default
;
};
private:
// Private
Member
Data
// Private Data
//- A pointer to the last element.
// last_->next_ points to first element, i.e. circular storage
...
...
@@ -86,15 +86,6 @@ private:
label
size_
=
0
;
// Private Member Functions
//- No copy construct
SLListBase
(
const
SLListBase
&
)
=
delete
;
//- No copy assignment
void
operator
=
(
const
SLListBase
&
)
=
delete
;
protected:
// Protected Member Functions
...
...
@@ -130,14 +121,19 @@ public:
friend
class
const_iterator
;
//
Constructor
s
//
Generated Method
s
//-
N
ul
l
construct
//-
Defa
ul
t
construct
SLListBase
()
=
default
;
//- No copy construct
SLListBase
(
const
SLListBase
&
)
=
delete
;
//- No copy assignment
void
operator
=
(
const
SLListBase
&
)
=
delete
;
//- Destructor
~
SLListBase
()
=
default
;
//- Destructor
~
SLListBase
()
=
default
;
// Member Functions
...
...
@@ -209,6 +205,9 @@ public:
public:
//- Copy construct
iterator
(
const
iterator
&
)
=
default
;
//- Construct for a node on the list
inline
iterator
(
SLListBase
*
list
,
link
*
item
);
...
...
@@ -231,6 +230,7 @@ public:
//- Move forward through list
inline
void
next
();
//- Copy assignment
inline
void
operator
=
(
const
iterator
&
iter
);
inline
bool
operator
==
(
const
iterator
&
iter
)
const
;
...
...
@@ -254,15 +254,15 @@ public:
public:
//- Copy construct
const_iterator
(
const
const_iterator
&
)
=
default
;
//- Construct for a node on the list
inline
const_iterator
(
const
SLListBase
*
list
,
const
link
*
item
);
//- Construct from a non-const iterator
inline
const_iterator
(
const
SLListBase
::
iterator
&
iter
);
//- Copy construct
const_iterator
(
const
const_iterator
&
)
=
default
;
//- The storage node
inline
const
link
*
get_node
()
const
;
...
...
@@ -282,6 +282,7 @@ public:
//- Move forward through list
inline
void
next
();
//- Copy assignment
const_iterator
&
operator
=
(
const
const_iterator
&
)
=
default
;
inline
bool
operator
==
(
const
const_iterator
&
iter
)
const
;
...
...
@@ -306,7 +307,6 @@ public:
//- No reverse iteration
const
const_iterator
&
crend
()
const
=
delete
;
};
...
...
src/OpenFOAM/containers/Lists/FixedList/FixedList.H
View file @
7da7907e
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-20
19
OpenCFD Ltd.
Copyright (C) 2017-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -135,7 +135,7 @@ public:
typedef
std
::
reverse_iterator
<
const_iterator
>
const_reverse_iterator
;
// Static
Member
Functions
// Static Functions
//- Return a null FixedList
inline
static
const
FixedList
<
T
,
N
>&
null
();
...
...
@@ -143,8 +143,8 @@ public:
// Constructors
//-
N
ul
l
construct
or
inline
FixedList
()
=
default
;
//-
Defa
ul
t
construct
FixedList
()
=
default
;
//- Construct and initialize all entries to given value
inline
explicit
FixedList
(
const
T
&
val
);
...
...
@@ -155,7 +155,7 @@ public:
//- Copy construct from C-array
inline
explicit
FixedList
(
const
T
list
[
N
]);
//- Copy construct
or
//- Copy construct
inline
FixedList
(
const
FixedList
<
T
,
N
>&
list
);
//- Move construct by using move assignment for the individual
...
...
src/OpenFOAM/containers/Lists/SubList/SubList.H
View file @
7da7907e
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-20
19
OpenCFD Ltd.
Copyright (C) 2017-20
20
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -50,7 +50,7 @@ SourceFiles
namespace
Foam
{
// Forward
d
eclarations
// Forward
D
eclarations
template
<
class
T
>
class
SubList
;
// Common list types
...
...
@@ -70,12 +70,18 @@ class SubList
{
public:
// Static
Member
Functions
// Static Functions
//- Return a null SubList
inline
static
const
SubList
<
T
>&
null
();
// Generated Methods
//- Copy construct
SubList
(
const
SubList
&
)
=
default
;
// Constructors
//- Construct from UList, the entire size
...
...
@@ -122,7 +128,7 @@ public:
//- Copy assign entries from given sub-list
inline
void
operator
=
(
const
SubList
<
T
>&
list
);
//- Copy assign entries
to the
given list
//- Copy assign entries
from
given list
inline
void
operator
=
(
const
UList
<
T
>&
list
);
//- Assign all entries to the given value
...
...
src/OpenFOAM/containers/Lists/UList/UList.H
View file @
7da7907e
...
...
@@ -66,7 +66,7 @@ SourceFiles
namespace
Foam
{
// Forward
d
eclarations
// Forward
D
eclarations
class
labelRange
;
template
<
class
T
>
class
List
;
template
<
class
T
>
class
SubList
;
...
...
@@ -87,7 +87,7 @@ typedef UList<label> labelUList; //!< A UList of labels
template
<
class
T
>
class
UList
{
// Private
d
ata
// Private
D
ata
//- Number of elements in UList
label
size_
;
...
...
@@ -167,13 +167,13 @@ public:
friend
class
SubList
<
T
>
;
// Static
Member
Functions
// Static Functions
//- Return a UList reference to a nullObject
inline
static
const
UList
<
T
>&
null
();
// Public
c
lasses
// Public
C
lasses
//- A list compare binary predicate for normal sort
struct
less
...
...
@@ -208,9 +208,15 @@ public:
};
// Generated Methods
//- Copy construct
UList
(
const
UList
<
T
>&
)
=
default
;
// Constructors
//-
N
ul
l
construct
o
r
//-
Defa
ul
t
construct
, zero-sized and nullpt
r
inline
constexpr
UList
()
noexcept
;
//- Construct from components
...
...
@@ -331,7 +337,7 @@ public:
void
deepCopy
(
const
UList
<
T
>&
list
);
// Member
o
perators
// Member
O
perators
//- Return element of UList
inline
T
&
operator
[](
const
label
i
);
...
...
src/OpenFOAM/meshes/polyMesh/syncTools/dummyTransform.H
View file @
7da7907e
...
...
@@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -73,7 +74,7 @@ class pTraits<List<T>>
public:
typedef
label
cmptType
;
pTraits
(
Istream
&
is
)
explicit
pTraits
(
Istream
&
is
)
:
List
<
T
>
(
is
)
{}
...
...
@@ -87,7 +88,7 @@ class pTraits<UList<T>>
public:
typedef
label
cmptType
;
pTraits
(
Istream
&
is
)
explicit
pTraits
(
Istream
&
is
)
:
UList
<
T
>
(
is
)
{}
...
...
@@ -101,7 +102,7 @@ class pTraits<Field<T>>
public:
typedef
label
cmptType
;
pTraits
(
Istream
&
is
)
explicit
pTraits
(
Istream
&
is
)
:
Field
<
T
>
(
is
)
{}
...
...
@@ -115,7 +116,7 @@ class pTraits<face>
public:
typedef
label
cmptType
;
pTraits
(
Istream
&
is
)
explicit
pTraits
(
Istream
&
is
)
:
face
(
is
)
{}
...
...
src/OpenFOAM/primitives/Barycentric/Barycentric.H
View file @
7da7907e
...
...
@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019
-2020
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -58,11 +58,13 @@ class Barycentric
{
public:
//- Equivalent type of labels used for valid component indexing
typedef
Barycentric
<
label
>
labelType
;
// Typedefs
//- Equivalent type of labels used for valid component indexing
typedef
Barycentric
<
label
>
labelType
;
// Member constants
// Member Constants
//- Rank of Barycentric is 1
static
constexpr
direction
rank
=
1
;
...
...
@@ -72,15 +74,18 @@ public:
enum
components
{
A
,
B
,
C
,
D
};
// Constructors
// Generated Methods
//- Default construct
Barycentric
()
=
default
;
//- Construct null