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
8aec50d5
Commit
8aec50d5
authored
5 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
fixed typo left from manual merging
parent
7808212a
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/ExceptionHandlingDecorator.cc
+20
-17
20 additions, 17 deletions
src/ExceptionHandlingDecorator.cc
with
20 additions
and
17 deletions
src/ExceptionHandlingDecorator.cc
+
20
−
17
View file @
8aec50d5
...
...
@@ -11,39 +11,41 @@ namespace ChimeraTK {
ExceptionHandlingDecorator
<
UserType
>::
ExceptionHandlingDecorator
(
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
accessor
,
DeviceModule
&
devMod
,
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
recoveryAccessor
)
:
ChimeraTK
::
NDRegisterAccessorDecorator
<
UserType
>
(
accessor
),
d
m
(
devMod
)
{
:
ChimeraTK
::
NDRegisterAccessorDecorator
<
UserType
>
(
accessor
),
d
eviceModule
(
devMod
)
{
// Register recoveryAccessor at the DeviceModule
if
(
recoveryAccessor
!=
nullptr
)
{
_recoveryAccessor
=
recoveryAccessor
;
d
m
.
addRecoveryAccessor
(
_recoveryAccessor
);
d
eviceModule
.
addRecoveryAccessor
(
_recoveryAccessor
);
}
}
template
<
typename
UserType
>
void
ExceptionHandlingDecorator
<
UserType
>::
setOwnerValidity
(
DataValidity
newValidity
)
{
if
(
newValidity
!=
localValidity
)
{
if
(
newValidity
!=
localValidity
)
{
localValidity
=
newValidity
;
if
(
!
_owner
)
return
;
if
(
newValidity
==
DataValidity
::
faulty
)
{
if
(
!
_owner
)
return
;
if
(
newValidity
==
DataValidity
::
faulty
)
{
_owner
->
incrementDataFaultCounter
();
}
else
{
}
else
{
_owner
->
decrementDataFaultCounter
();
}
}
}
template
<
typename
UserType
>
bool
ExceptionHandlingDecorator
<
UserType
>::
genericTransfer
(
std
::
function
<
bool
(
void
)
>
callable
,
bool
updateOwnerValidityFlag
)
{
std
::
function
<
bool
(
void
)
>
callable
,
bool
updateOwnerValidityFlag
)
{
std
::
function
<
void
(
DataValidity
)
>
setOwnerValidityFunction
{};
if
(
updateOwnerValidityFlag
)
{
setOwnerValidityFunction
=
std
::
bind
(
&
ExceptionHandlingDecorator
<
UserType
>::
setOwnerValidity
,
this
,
std
::
placeholders
::
_1
);
}
setOwnerValidityFunction
=
std
::
bind
(
&
ExceptionHandlingDecorator
<
UserType
>::
setOwnerValidity
,
this
,
std
::
placeholders
::
_1
);
}
else
{
setOwnerValidityFunction
=
[](
DataValidity
)
{};
// do nothing if user does // not want to invalidate data.
setOwnerValidityFunction
=
[](
DataValidity
)
{
};
// do nothing if user does // not want to invalidate data.
}
while
(
true
)
{
try
{
if
(
!
deviceModule
.
device
.
isOpened
())
{
...
...
@@ -90,7 +92,8 @@ namespace ChimeraTK {
template
<
typename
UserType
>
bool
ExceptionHandlingDecorator
<
UserType
>::
doReadTransferNonBlocking
()
{
return
genericTransfer
(
[
this
]()
{
return
ChimeraTK
::
NDRegisterAccessorDecorator
<
UserType
>::
doReadTransferNonBlocking
();
});
return
genericTransfer
(
[
this
]()
{
return
ChimeraTK
::
NDRegisterAccessorDecorator
<
UserType
>::
doReadTransferNonBlocking
();
});
}
template
<
typename
UserType
>
...
...
@@ -130,7 +133,7 @@ namespace ChimeraTK {
* modify the recoveryAcessor's user buffer while data is written to the device.
*/
{
auto
lock
{
d
m
.
getRecoverySharedLock
()};
auto
lock
{
d
eviceModule
.
getRecoverySharedLock
()};
if
(
_recoveryAccessor
!=
nullptr
)
{
// Access to _recoveryAccessor is only possible channel-wise
...
...
@@ -170,12 +173,12 @@ namespace ChimeraTK {
deviceModule
.
notify
();
ChimeraTK
::
NDRegisterAccessorDecorator
<
UserType
>::
interrupt
();
}
template
<
typename
UserType
>
void
ExceptionHandlingDecorator
<
UserType
>::
setOwner
(
EntityOwner
*
owner
)
{
_owner
=
owner
;
}
INSTANTIATE_TEMPLATE_FOR_CHIMERATK_USER_TYPES
(
ExceptionHandlingDecorator
);
}
/* 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