Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
1031dae6
Commit
1031dae6
authored
Dec 08, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use defaults when setting handlers to nullptr
parent
b6662deb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
libcaf_core/caf/scheduled_actor.hpp
libcaf_core/caf/scheduled_actor.hpp
+21
-6
No files found.
libcaf_core/caf/scheduled_actor.hpp
View file @
1031dae6
...
@@ -197,7 +197,10 @@ public:
...
@@ -197,7 +197,10 @@ public:
/// Sets a custom handler for unexpected messages.
/// Sets a custom handler for unexpected messages.
inline
void
set_default_handler
(
default_handler
fun
)
{
inline
void
set_default_handler
(
default_handler
fun
)
{
if
(
fun
)
default_handler_
=
std
::
move
(
fun
);
default_handler_
=
std
::
move
(
fun
);
else
default_handler_
=
print_and_drop
;
}
}
/// Sets a custom handler for unexpected messages.
/// Sets a custom handler for unexpected messages.
...
@@ -216,7 +219,10 @@ public:
...
@@ -216,7 +219,10 @@ public:
/// Sets a custom handler for error messages.
/// Sets a custom handler for error messages.
inline
void
set_error_handler
(
error_handler
fun
)
{
inline
void
set_error_handler
(
error_handler
fun
)
{
if
(
fun
)
error_handler_
=
std
::
move
(
fun
);
error_handler_
=
std
::
move
(
fun
);
else
error_handler_
=
default_error_handler
;
}
}
/// Sets a custom handler for error messages.
/// Sets a custom handler for error messages.
...
@@ -227,7 +233,10 @@ public:
...
@@ -227,7 +233,10 @@ public:
/// Sets a custom handler for down messages.
/// Sets a custom handler for down messages.
inline
void
set_down_handler
(
down_handler
fun
)
{
inline
void
set_down_handler
(
down_handler
fun
)
{
if
(
fun
)
down_handler_
=
std
::
move
(
fun
);
down_handler_
=
std
::
move
(
fun
);
else
down_handler_
=
default_down_handler
;
}
}
/// Sets a custom handler for down messages.
/// Sets a custom handler for down messages.
...
@@ -238,7 +247,10 @@ public:
...
@@ -238,7 +247,10 @@ public:
/// Sets a custom handler for error messages.
/// Sets a custom handler for error messages.
inline
void
set_exit_handler
(
exit_handler
fun
)
{
inline
void
set_exit_handler
(
exit_handler
fun
)
{
if
(
fun
)
exit_handler_
=
std
::
move
(
fun
);
exit_handler_
=
std
::
move
(
fun
);
else
exit_handler_
=
default_exit_handler
;
}
}
/// Sets a custom handler for exit messages.
/// Sets a custom handler for exit messages.
...
@@ -250,8 +262,11 @@ public:
...
@@ -250,8 +262,11 @@ public:
# ifndef CAF_NO_EXCEPTIONS
# ifndef CAF_NO_EXCEPTIONS
/// Sets a custom exception handler for this actor. If multiple handlers are
/// Sets a custom exception handler for this actor. If multiple handlers are
/// defined, only the functor that was added *last* is being executed.
/// defined, only the functor that was added *last* is being executed.
inline
void
set_exception_handler
(
exception_handler
f
)
{
inline
void
set_exception_handler
(
exception_handler
fun
)
{
exception_handler_
=
std
::
move
(
f
);
if
(
fun
)
exception_handler_
=
std
::
move
(
fun
);
else
exception_handler_
=
default_exception_handler
;
}
}
/// Sets a custom exception handler for this actor. If multiple handlers are
/// Sets a custom exception handler for this actor. If multiple handlers are
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment