Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
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
ChimeraTK Mirror
ApplicationCore
Commits
e1376034
Commit
e1376034
authored
4 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
fixed functionality of MetaDataPropagatingRegisterDecorator which was broken in
19eb02f4
parent
94ac18d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/MetaDataPropagatingRegisterDecorator.h
+4
-0
4 additions, 0 deletions
include/MetaDataPropagatingRegisterDecorator.h
src/MetaDataPropagatingRegisterDecorator.cc
+12
-8
12 additions, 8 deletions
src/MetaDataPropagatingRegisterDecorator.cc
with
16 additions
and
8 deletions
include/MetaDataPropagatingRegisterDecorator.h
+
4
−
0
View file @
e1376034
...
...
@@ -30,6 +30,10 @@ namespace ChimeraTK {
/** value of validity flag from last read operation */
DataValidity
lastValidity
{
DataValidity
::
ok
};
using
TransferElement
::
_dataValidity
;
using
NDRegisterAccessorDecorator
<
T
>::
_target
;
using
NDRegisterAccessorDecorator
<
T
>::
buffer_2D
;
};
DECLARE_TEMPLATE_FOR_CHIMERATK_USER_TYPES
(
MetaDataPropagatingRegisterDecorator
);
...
...
This diff is collapsed.
Click to expand it.
src/MetaDataPropagatingRegisterDecorator.cc
+
12
−
8
View file @
e1376034
...
...
@@ -13,26 +13,30 @@ namespace ChimeraTK {
}
// Check if the data validity flag changed. If yes, propagate this information to the owning module.
auto
valid
=
ChimeraTK
::
NDRegisterAccessorDecorator
<
T
>::
dataValidity
();
if
(
valid
!=
lastValidity
)
{
if
(
valid
==
DataValidity
::
faulty
)
if
(
_dataValidity
!=
lastValidity
)
{
if
(
_dataValidity
==
DataValidity
::
faulty
)
_owner
->
incrementDataFaultCounter
();
else
_owner
->
decrementDataFaultCounter
();
lastValidity
=
v
alid
;
lastValidity
=
_dataV
alid
ity
;
}
}
template
<
typename
T
>
void
MetaDataPropagatingRegisterDecorator
<
T
>::
doPreWrite
(
TransferType
type
,
VersionNumber
versionNumber
)
{
if
(
TransferElement
::
_dataValidity
==
DataValidity
::
faulty
)
{
// the application has manualy set the validity to faulty
ChimeraTK
::
NDRegisterAccessorDecorator
<
T
>::
setDataValidity
(
DataValidity
::
faulty
);
// We cannot use NDRegisterAccessorDecorator<T> here because we need a different implementation of setting the target data validity.
// So we have a complete implemetation here.
if
(
_dataValidity
==
DataValidity
::
faulty
)
{
// the application has manualy set the validity to faulty
_target
->
setDataValidity
(
DataValidity
::
faulty
);
}
else
{
// automatic propagation of the owner validity
ChimeraTK
::
NDRegisterAccessorDecorator
<
T
>::
setDataValidity
(
_owner
->
getDataValidity
());
_target
->
setDataValidity
(
_owner
->
getDataValidity
());
}
NDRegisterAccessorDecorator
<
T
,
T
>::
doPreWrite
(
type
,
versionNumber
);
for
(
unsigned
int
i
=
0
;
i
<
_target
->
getNumberOfChannels
();
++
i
)
{
buffer_2D
[
i
].
swap
(
_target
->
accessChannel
(
i
));
}
_target
->
preWrite
(
type
,
versionNumber
);
}
}
// namespace ChimeraTK
...
...
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