Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Core_Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
BioinformaticDataCompression
BigDataViewer_Core_Extension
Commits
ef93416f
Commit
ef93416f
authored
8 years ago
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
Add a CacheControl aggregator that forwards prepareNextFrame
parent
c10b275c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/bdv/cache/CacheControl.java
+41
-0
41 additions, 0 deletions
src/main/java/bdv/cache/CacheControl.java
with
41 additions
and
0 deletions
src/main/java/bdv/cache/CacheControl.java
+
41
−
0
View file @
ef93416f
...
...
@@ -29,6 +29,8 @@
*/
package
bdv.cache
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
bdv.img.cache.VolatileGlobalCellCache
;
/**
...
...
@@ -54,10 +56,49 @@ public interface CacheControl
*/
public
void
prepareNextFrame
();
/**
* {@link CacheControl} that does nothing.
*/
public
static
class
Dummy
implements
CacheControl
{
@Override
public
void
prepareNextFrame
()
{}
}
/**
* {@link CacheControl} backed by a set of {@link CacheControl}s.
* {@link #prepareNextFrame()} forwards to all of them.
*/
public
static
class
CacheControls
implements
CacheControl
{
private
final
CopyOnWriteArrayList
<
CacheControl
>
cacheControls
=
new
CopyOnWriteArrayList
<>();
public
synchronized
void
addCacheControl
(
final
CacheControl
cacheControl
,
final
int
index
)
{
cacheControls
.
remove
(
cacheControl
);
final
int
s
=
cacheControls
.
size
();
cacheControls
.
add
(
index
<
0
?
0
:
index
>
s
?
s
:
index
,
cacheControl
);
}
public
synchronized
void
addCacheControl
(
final
CacheControl
cacheControl
)
{
if
(
!
cacheControls
.
contains
(
cacheControl
)
)
{
cacheControls
.
add
(
cacheControl
);
}
}
public
synchronized
void
removeCacheControl
(
final
CacheControl
cacheControl
)
{
cacheControls
.
remove
(
cacheControl
);
}
@Override
public
void
prepareNextFrame
()
{
for
(
final
CacheControl
c
:
cacheControls
)
c
.
prepareNextFrame
();
}
}
}
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