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
a4b56488
Commit
a4b56488
authored
5 years ago
by
Martin Killenberg
Browse files
Options
Downloads
Patches
Plain Diff
ExceptionHandlingDecorator: unifies both constructors
parent
38fd10f9
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/ExceptionHandlingDecorator.h
+6
-10
6 additions, 10 deletions
include/ExceptionHandlingDecorator.h
src/ExceptionHandlingDecorator.cc
+1
-6
1 addition, 6 deletions
src/ExceptionHandlingDecorator.cc
with
7 additions
and
16 deletions
include/ExceptionHandlingDecorator.h
+
6
−
10
View file @
a4b56488
...
...
@@ -18,18 +18,14 @@ namespace ChimeraTK {
template
<
typename
UserType
>
class
ExceptionHandlingDecorator
:
public
ChimeraTK
::
NDRegisterAccessorDecorator
<
UserType
>
{
public:
/// Basic constructor, inititalizes the base decorator and the reference to the DeviceModule
ExceptionHandlingDecorator
(
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
accessor
,
DeviceModule
&
devMod
);
/**
* Constructor for writeable registers, allows also setting the recoveryAccessor.
* Deletgates to the basic contructor for member initialization.
* Decorate the accessors which is handed in the constuctor. It needs the device module to implement
* the exception handling. Accessors which write to the device in addition need a recovery accessor
* so the variables can be written again after a device has recovered from an error. Accessors
* which only read don't specify the third parameter.
*/
ExceptionHandlingDecorator
(
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
accessor
,
DeviceModule
&
devMod
,
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
recoveryAccessor
);
ExceptionHandlingDecorator
(
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
accessor
,
DeviceModule
&
devMod
,
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
recoveryAccessor
=
{
nullptr
});
bool
doWriteTransfer
(
ChimeraTK
::
VersionNumber
versionNumber
=
{})
override
;
...
...
This diff is collapsed.
Click to expand it.
src/ExceptionHandlingDecorator.cc
+
1
−
6
View file @
a4b56488
...
...
@@ -7,16 +7,11 @@ constexpr useconds_t DeviceOpenTimeout = 500;
namespace
ChimeraTK
{
template
<
typename
UserType
>
ExceptionHandlingDecorator
<
UserType
>::
ExceptionHandlingDecorator
(
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
accessor
,
DeviceModule
&
devMod
)
:
ChimeraTK
::
NDRegisterAccessorDecorator
<
UserType
>
(
accessor
),
dm
(
devMod
)
{}
template
<
typename
UserType
>
ExceptionHandlingDecorator
<
UserType
>::
ExceptionHandlingDecorator
(
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
accessor
,
DeviceModule
&
devMod
,
boost
::
shared_ptr
<
ChimeraTK
::
NDRegisterAccessor
<
UserType
>>
recoveryAccessor
)
:
ExceptionHandling
Decorator
<
UserType
>
(
accessor
,
devMod
)
{
:
ChimeraTK
::
NDRegisterAccessor
Decorator
<
UserType
>
(
accessor
)
,
dm
(
devMod
)
{
// Register recoveryAccessor at the DeviceModule
if
(
recoveryAccessor
!=
nullptr
)
{
_recoveryAccessor
=
recoveryAccessor
;
...
...
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