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
00a0d0a5
Commit
00a0d0a5
authored
Apr 13, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return whether `allow` consumed a message
parent
057b9aa2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+16
-7
No files found.
libcaf_test/caf/test/dsl.hpp
View file @
00a0d0a5
...
@@ -384,10 +384,7 @@ public:
...
@@ -384,10 +384,7 @@ public:
allow_clause
(
allow_clause
&&
other
)
=
default
;
allow_clause
(
allow_clause
&&
other
)
=
default
;
~
allow_clause
()
{
~
allow_clause
()
{
if
(
peek_
!=
nullptr
)
{
eval
();
if
(
peek_
())
run_once
();
}
}
}
allow_clause
&
from
(
const
wildcard
&
)
{
allow_clause
&
from
(
const
wildcard
&
)
{
...
@@ -428,6 +425,16 @@ public:
...
@@ -428,6 +425,16 @@ public:
};
};
}
}
bool
eval
()
{
if
(
peek_
!=
nullptr
)
{
if
(
peek_
())
{
run_once
();
return
true
;
}
}
return
false
;
}
protected:
protected:
void
run_once
()
{
void
run_once
()
{
auto
dptr
=
dynamic_cast
<
caf
::
blocking_actor
*>
(
dest_
);
auto
dptr
=
dynamic_cast
<
caf
::
blocking_actor
*>
(
dest_
);
...
@@ -609,10 +616,12 @@ struct test_coordinator_fixture {
...
@@ -609,10 +616,12 @@ struct test_coordinator_fixture {
/// Convenience macro for defining allow clauses.
/// Convenience macro for defining allow clauses.
#define allow(types, fields) \
#define allow(types, fields) \
do {
\
([&] {
\
CAF_MESSAGE("allow" << #types << "." << #fields); \
CAF_MESSAGE("allow" << #types << "." << #fields); \
allow_clause<CAF_EXPAND(CAF_DSL_LIST types)>{sched}.fields; \
allow_clause<CAF_EXPAND(CAF_DSL_LIST types)> x{sched}; \
} while (false)
x.fields; \
return x.eval(); \
})()
/// Convenience macro for defining disallow clauses.
/// Convenience macro for defining disallow clauses.
#define disallow(types, fields) \
#define disallow(types, fields) \
...
...
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