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
40b5b480
Commit
40b5b480
authored
Feb 16, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deduce mailbox element types from `Actor`
parent
20fa7182
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
libcaf_core/caf/policy/not_prioritizing.hpp
libcaf_core/caf/policy/not_prioritizing.hpp
+6
-3
libcaf_core/caf/policy/prioritizing.hpp
libcaf_core/caf/policy/prioritizing.hpp
+3
-2
No files found.
libcaf_core/caf/policy/not_prioritizing.hpp
View file @
40b5b480
...
@@ -34,8 +34,10 @@ namespace policy {
...
@@ -34,8 +34,10 @@ namespace policy {
class
not_prioritizing
{
class
not_prioritizing
{
public:
public:
template
<
class
Actor
>
template
<
class
Actor
>
mailbox_element_ptr
next_message
(
Actor
*
self
)
{
typename
Actor
::
mailbox_type
::
unique_pointer
next_message
(
Actor
*
self
)
{
return
mailbox_element_ptr
{
self
->
mailbox
().
try_pop
()};
typename
Actor
::
mailbox_type
::
unique_pointer
result
;
result
.
reset
(
self
->
mailbox
().
try_pop
());
return
result
;
}
}
template
<
class
Actor
>
template
<
class
Actor
>
...
@@ -44,7 +46,8 @@ class not_prioritizing {
...
@@ -44,7 +46,8 @@ class not_prioritizing {
}
}
template
<
class
Actor
>
template
<
class
Actor
>
void
push_to_cache
(
Actor
*
self
,
mailbox_element_ptr
ptr
)
{
void
push_to_cache
(
Actor
*
self
,
typename
Actor
::
mailbox_type
::
unique_pointer
ptr
)
{
self
->
mailbox
().
cache
().
push_second_back
(
ptr
.
release
());
self
->
mailbox
().
cache
().
push_second_back
(
ptr
.
release
());
}
}
...
...
libcaf_core/caf/policy/prioritizing.hpp
View file @
40b5b480
...
@@ -78,8 +78,9 @@ class prioritizing {
...
@@ -78,8 +78,9 @@ class prioritizing {
}
}
template
<
class
Actor
>
template
<
class
Actor
>
void
push_to_cache
(
Actor
*
self
,
mailbox_element_ptr
ptr
)
{
void
push_to_cache
(
Actor
*
self
,
auto
high_prio
=
[](
const
mailbox_element
&
val
)
{
typename
Actor
::
mailbox_type
::
unique_pointer
ptr
)
{
auto
high_prio
=
[](
const
typename
Actor
::
mailbox_type
::
value_type
&
val
)
{
return
val
.
is_high_priority
();
return
val
.
is_high_priority
();
};
};
auto
&
cache
=
self
->
mailbox
().
cache
();
auto
&
cache
=
self
->
mailbox
().
cache
();
...
...
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