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
Nils-Arne Dreier
dune-common
Commits
8b733156
Commit
8b733156
authored
9 years ago
by
Christian Engwer
Committed by
Christoph Grüninger
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[lib] move implementation of expctions to the lib
parent
c4b1b118
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
dune/common/exceptions.cc
+33
-1
33 additions, 1 deletion
dune/common/exceptions.cc
dune/common/exceptions.hh
+0
-30
0 additions, 30 deletions
dune/common/exceptions.hh
with
33 additions
and
31 deletions
dune/common/exceptions.cc
+
33
−
1
View file @
8b733156
...
...
@@ -3,6 +3,38 @@
#include
<dune/common/exceptions.hh>
namespace
Dune
{
// static member of Dune::Exception
/*
static member of Dune::Exception
*/
ExceptionHook
*
Exception
::
_hook
=
0
;
/*
Implementation of Dune::Exception
*/
Exception
::
Exception
()
{
// call the hook if necessary
if
(
_hook
!=
0
)
_hook
->
operator
()();
}
void
Exception
::
registerHook
(
ExceptionHook
*
hook
)
{
_hook
=
hook
;
}
void
Exception
::
clearHook
()
{
_hook
=
0
;
}
void
Exception
::
message
(
const
std
::
string
&
msg
)
{
_message
=
msg
;
}
const
char
*
Exception
::
what
()
const
noexcept
{
return
_message
.
data
();
}
}
This diff is collapsed.
Click to expand it.
dune/common/exceptions.hh
+
0
−
30
View file @
8b733156
...
...
@@ -174,36 +174,6 @@ namespace Dune {
virtual
void
operator
()
()
=
0
;
};
/*
Implementation of Dune::Exception
*/
inline
Exception
::
Exception
()
{
// call the hook if necessary
if
(
_hook
!=
0
)
_hook
->
operator
()();
}
inline
void
Exception
::
registerHook
(
ExceptionHook
*
hook
)
{
_hook
=
hook
;
}
inline
void
Exception
::
clearHook
()
{
_hook
=
0
;
}
inline
void
Exception
::
message
(
const
std
::
string
&
msg
)
{
_message
=
msg
;
}
const
char
*
Exception
::
what
()
const
noexcept
{
return
_message
.
data
();
}
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
stream
,
const
Exception
&
e
)
{
return
stream
<<
e
.
what
();
...
...
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