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
9991ac08
Commit
9991ac08
authored
12 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: PtrList: append function
parent
d97a966a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/containers/Lists/PtrList/PtrList.H
+6
-1
6 additions, 1 deletion
src/OpenFOAM/containers/Lists/PtrList/PtrList.H
src/OpenFOAM/containers/Lists/PtrList/PtrListI.H
+26
-0
26 additions, 0 deletions
src/OpenFOAM/containers/Lists/PtrList/PtrListI.H
with
32 additions
and
1 deletion
src/OpenFOAM/containers/Lists/PtrList/PtrList.H
+
6
−
1
View file @
9991ac08
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -189,6 +189,11 @@ public:
// allocated entries.
void
clear
();
//- Append an element at the end of the list
inline
void
append
(
const
T
*
);
inline
void
append
(
const
autoPtr
<
T
>&
);
inline
void
append
(
const
tmp
<
T
>&
);
//- Transfer the contents of the argument PtrList into this PtrList
// and annul the argument list.
void
transfer
(
PtrList
<
T
>&
);
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/containers/Lists/PtrList/PtrListI.H
+
26
−
0
View file @
9991ac08
...
...
@@ -79,6 +79,32 @@ inline void Foam::PtrList<T>::resize(const label newSize)
}
template
<
class
T
>
inline
void
Foam
::
PtrList
<
T
>::
append
(
const
T
*
ptr
)
{
label
sz
=
size
();
this
->
setSize
(
sz
+
1
);
ptrs_
[
sz
]
=
ptr
;
}
template
<
class
T
>
inline
void
Foam
::
PtrList
<
T
>::
append
(
const
autoPtr
<
T
>&
aptr
)
{
return
append
(
const_cast
<
autoPtr
<
T
>&>
(
aptr
).
ptr
());
}
template
<
class
T
>
inline
void
Foam
::
PtrList
<
T
>::
append
(
const
tmp
<
T
>&
t
)
{
return
append
(
const_cast
<
tmp
<
T
>&>
(
t
).
ptr
());
}
template
<
class
T
>
inline
bool
Foam
::
PtrList
<
T
>::
set
(
const
label
i
)
const
{
...
...
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