Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
7fe700a8
Commit
7fe700a8
authored
7 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
COMP: HashPtrTableI.H: inlined functions
parent
447ee9e0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableI.H
+113
-0
113 additions, 0 deletions
...enFOAM/containers/HashTables/HashPtrTable/HashPtrTableI.H
with
113 additions
and
0 deletions
src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTableI.H
0 → 100644
+
113
−
0
View file @
7fe700a8
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include
"autoPtr.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
<
class
T
,
class
Key
,
class
Hash
>
inline
Foam
::
HashPtrTable
<
T
,
Key
,
Hash
>::
HashPtrTable
()
:
parent_type
()
{}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
Foam
::
HashPtrTable
<
T
,
Key
,
Hash
>::
HashPtrTable
(
const
label
size
)
:
parent_type
(
size
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
HashPtrTable
<
T
,
Key
,
Hash
>::
insert
(
const
Key
&
key
,
autoPtr
<
T
>&
aptr
)
{
if
(
parent_type
::
insert
(
key
,
aptr
.
get
()))
{
aptr
.
release
();
// Now owned by HashPtrTable
return
true
;
}
return
false
;
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
HashPtrTable
<
T
,
Key
,
Hash
>::
insert
(
const
Key
&
key
,
autoPtr
<
T
>&&
aptr
)
{
if
(
parent_type
::
insert
(
key
,
aptr
.
get
()))
{
aptr
.
release
();
// Now owned by HashPtrTable
return
true
;
}
return
false
;
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
HashPtrTable
<
T
,
Key
,
Hash
>::
set
(
const
Key
&
key
,
T
*
ptr
)
{
return
this
->
parent_type
::
set
(
key
,
ptr
);
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
HashPtrTable
<
T
,
Key
,
Hash
>::
set
(
const
Key
&
key
,
autoPtr
<
T
>&
aptr
)
{
return
this
->
set
(
key
,
aptr
.
release
());
}
template
<
class
T
,
class
Key
,
class
Hash
>
inline
bool
Foam
::
HashPtrTable
<
T
,
Key
,
Hash
>::
set
(
const
Key
&
key
,
autoPtr
<
T
>&&
aptr
)
{
return
this
->
set
(
key
,
aptr
.
release
());
}
// ************************************************************************* //
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment