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
dd826000
Commit
dd826000
authored
Feb 12, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed continuation handling
continuation is called only if given functor is invoked
parent
7f9d99c4
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
313 additions
and
259 deletions
+313
-259
cppa/detail/projection.hpp
cppa/detail/projection.hpp
+32
-0
cppa/detail/pseudo_tuple.hpp
cppa/detail/pseudo_tuple.hpp
+1
-1
cppa/detail/receive_policy.hpp
cppa/detail/receive_policy.hpp
+0
-7
cppa/match_expr.hpp
cppa/match_expr.hpp
+274
-250
cppa/message_future.hpp
cppa/message_future.hpp
+6
-1
No files found.
cppa/detail/projection.hpp
View file @
dd826000
...
...
@@ -119,6 +119,20 @@ class projection {
return
false
;
}
/**
* @brief Invokes @p fun with a projection of <tt>args...</tt> and stores
* the result of @p fun in @p result.
*/
template
<
class
PartialFun
>
inline
bool
operator
()(
PartialFun
&
fun
,
typename
PartialFun
::
result_type
&
result
,
Args
...
args
)
const
{
return
invoke
(
fun
,
result
,
args
...);
}
template
<
class
PartialFun
>
inline
bool
operator
()(
PartialFun
&
fun
,
const
util
::
void_type
&
,
Args
...
args
)
const
{
return
(
*
this
)(
fun
,
args
...);
}
private:
template
<
typename
Storage
,
typename
T
>
...
...
@@ -181,6 +195,24 @@ class projection<util::empty_type_list> {
return
false
;
}
template
<
class
PartialFun
>
bool
operator
()(
PartialFun
&
fun
,
const
util
::
void_type
&
)
const
{
if
(
fun
.
defined_at
())
{
fun
();
return
true
;
}
return
false
;
}
template
<
class
PartialFun
>
bool
operator
()(
PartialFun
&
fun
,
typename
PartialFun
::
result_type
&
res
)
const
{
if
(
fun
.
defined_at
())
{
res
=
fun
();
return
true
;
}
return
false
;
}
};
template
<
class
ProjectionFuns
,
class
List
>
...
...
cppa/detail/pseudo_tuple.hpp
View file @
dd826000
...
...
@@ -49,7 +49,7 @@ struct pseudo_tuple {
}
inline
pointer
mutable_at
(
size_t
p
)
{
return
const_cast
<
pointer
>
(
data
[
p
])
;
return
data
[
p
]
;
}
inline
pointer
&
operator
[](
size_t
p
)
{
...
...
cppa/detail/receive_policy.hpp
View file @
dd826000
...
...
@@ -359,14 +359,7 @@ class receive_policy {
case
sync_response
:
{
if
(
awaited_response
.
valid
()
&&
node
->
mid
==
awaited_response
)
{
auto
previous_node
=
hm_begin
(
client
,
node
,
policy
);
# ifdef CPPA_DEBUG
if
(
!
fun
(
node
->
msg
))
{
std
::
cerr
<<
"WARNING: actor didn't handle a "
"synchronous message
\n
"
;
}
# else
fun
(
node
->
msg
);
# endif
client
->
mark_arrived
(
awaited_response
);
client
->
remove_handler
(
awaited_response
);
hm_cleanup
(
client
,
previous_node
,
policy
);
...
...
cppa/match_expr.hpp
View file @
dd826000
This diff is collapsed.
Click to expand it.
cppa/message_future.hpp
View file @
dd826000
...
...
@@ -136,7 +136,12 @@ class message_future {
template
<
typename
F
>
behavior
bhvr_from_fun
(
F
fun
)
{
auto
handle_sync_failure
=
[]
{
self
->
handle_sync_failure
();
};
auto
handle_sync_failure
=
[]()
->
bool
{
self
->
handle_sync_failure
();
return
false
;
// do not treat this as a match to cause a
// continuation to be invoked only in case
// `fun` was invoked
};
return
{
on
(
atom
(
"EXITED"
),
any_vals
)
>>
handle_sync_failure
,
on
(
atom
(
"TIMEOUT"
))
>>
handle_sync_failure
,
...
...
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