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
1cd8e14d
Commit
1cd8e14d
authored
Sep 18, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve docu and as_string output for exit reasons
parent
52eabba0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
20 deletions
+21
-20
libcaf_core/caf/exit_reason.hpp
libcaf_core/caf/exit_reason.hpp
+11
-13
libcaf_core/src/exit_reason.cpp
libcaf_core/src/exit_reason.cpp
+10
-7
No files found.
libcaf_core/caf/exit_reason.hpp
View file @
1cd8e14d
...
...
@@ -36,14 +36,12 @@ static constexpr uint32_t not_exited = 0x00000;
static
constexpr
uint32_t
normal
=
0x00001
;
/**
* Indicates that an actor finished execution
* because of an unhandled exception.
* Indicates that an actor finished execution because of an unhandled exception.
*/
static
constexpr
uint32_t
unhandled_exception
=
0x00002
;
/**
* Indicates that the actor received an unexpected
* synchronous reply message.
* Indicates that the actor received an unexpected synchronous reply message.
*/
static
constexpr
uint32_t
unhandled_sync_failure
=
0x00004
;
...
...
@@ -54,30 +52,30 @@ static constexpr uint32_t unhandled_sync_timeout = 0x00005;
/**
* Indicates that the exit reason for this actor is unknown, i.e.,
*
the actor has been terminated and no longer exists.
* the actor has been terminated and no longer exists.
*/
static
constexpr
uint32_t
unknown
=
0x00006
;
/**
* Indicates that the actor was forced to shutdown by
* a user-generated event.
* Indicates that the actor was forced to shutdown by a user-generated event.
*/
static
constexpr
uint32_t
user_shutdown
=
0x00010
;
/**
* Indicates that an actor finishied execution
* because a connection to a remote link was
* closed unexpectedly.
* Indicates that an actor finishied execution because a connection
* to a remote link was closed unexpectedly.
*/
static
constexpr
uint32_t
remote_link_unreachable
=
0x00101
;
/**
* Any user defined exit reason should have a
* value greater or equal to prevent collisions
* with default defined exit reasons.
* Any user defined exit reason should have a value greater or
* equal to prevent collisions with default defined exit reasons.
*/
static
constexpr
uint32_t
user_defined
=
0x10000
;
/**
* Returns a string representation of given exit reason.
*/
const
char
*
as_string
(
uint32_t
value
);
}
// namespace exit_reason
...
...
libcaf_core/src/exit_reason.cpp
View file @
1cd8e14d
...
...
@@ -29,7 +29,8 @@ constexpr const char* s_names_table[] = {
"unhandled_exception"
,
"-invalid-"
,
"unhandled_sync_failure"
,
"unhandled_sync_timeout"
"unhandled_sync_timeout"
,
"unknown"
};
}
// namespace <anonymous>
...
...
@@ -37,13 +38,15 @@ const char* as_string(uint32_t value) {
if
(
value
<=
unhandled_sync_timeout
)
{
return
s_names_table
[
value
];
}
if
(
value
==
remote_link_unreachable
)
{
return
"remote_link_unreachable"
;
switch
(
value
)
{
case
user_shutdown
:
return
"user_shutdown"
;
case
remote_link_unreachable
:
return
"remote_link_unreachable"
;
default:
if
(
value
<
user_defined
)
{
return
"-invalid-"
;
}
return
"-user defined-"
;
}
if
(
value
>=
user_defined
)
{
return
"user_defined"
;
}
return
"illegal_exit_reason"
;
}
}
// namespace exit_reason
...
...
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