Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Timo Koch
dune-common
Commits
344335ed
Commit
344335ed
authored
17 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
use array instead of FixedArray
[[Imported from SVN: r4926]]
parent
2409f5b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/arraylist.hh
+5
-5
5 additions, 5 deletions
common/arraylist.hh
with
5 additions
and
5 deletions
common/arraylist.hh
+
5
−
5
View file @
344335ed
...
...
@@ -39,7 +39,7 @@ namespace Dune
*
* Internally the data is organized in a list of arrays of fixed size.
* Whenever the capacity of the array list is not sufficient a new
* Dune::
FixedA
rray is allocated. In contrast to
* Dune::
a
rray is allocated. In contrast to
* std::vector this approach prevents data copying. On the outside
* we provide the same interface as the stl random access containers.
*/
...
...
@@ -188,7 +188,7 @@ namespace Dune
/**
* @brief The allocators for the fixed array.
*/
typedef
typename
A
::
template
rebind
<
SmartPointer
<
FixedA
rray
<
MemberType
,
chunkSize_
>
>
>::
other
typedef
typename
A
::
template
rebind
<
SmartPointer
<
a
rray
<
MemberType
,
chunkSize_
>
>
>::
other
SmartPointerAllocator
;
/**
...
...
@@ -198,7 +198,7 @@ namespace Dune
friend
class
ConstArrayListIterator
<
T
,
N
,
A
>
;
/** @brief the data chunks of our list. */
std
::
vector
<
SmartPointer
<
FixedA
rray
<
MemberType
,
chunkSize_
>
>
,
std
::
vector
<
SmartPointer
<
a
rray
<
MemberType
,
chunkSize_
>
>
,
SmartPointerAllocator
>
chunks_
;
/** @brief The current data capacity. */
size_type
capacity_
;
...
...
@@ -473,7 +473,7 @@ namespace Dune
size_t
index
=
start_
+
size_
;
if
(
index
==
capacity_
)
{
chunks_
.
push_back
(
SmartPointer
<
FixedA
rray
<
MemberType
,
chunkSize_
>
>
());
chunks_
.
push_back
(
SmartPointer
<
a
rray
<
MemberType
,
chunkSize_
>
>
());
capacity_
+=
chunkSize_
;
}
elementAt
(
index
)
=
entry
;
...
...
@@ -539,7 +539,7 @@ namespace Dune
// Number of chunks with entries in it;
size_t
chunks
=
((
start_
%
chunkSize_
+
size_
)
/
chunkSize_
);
typedef
typename
std
::
vector
<
SmartPointer
<
FixedA
rray
<
MemberType
,
typedef
typename
std
::
vector
<
SmartPointer
<
a
rray
<
MemberType
,
chunkSize_
>
>
>::
iterator
iterator
;
// Copy chunks to the left.
...
...
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