Commit 40b5b480 authored by Dominik Charousset's avatar Dominik Charousset

Deduce mailbox element types from `Actor`

parent 20fa7182
......@@ -34,8 +34,10 @@ namespace policy {
class not_prioritizing {
public:
template <class Actor>
mailbox_element_ptr next_message(Actor* self) {
return mailbox_element_ptr{self->mailbox().try_pop()};
typename Actor::mailbox_type::unique_pointer next_message(Actor* self) {
typename Actor::mailbox_type::unique_pointer result;
result.reset(self->mailbox().try_pop());
return result;
}
template <class Actor>
......@@ -44,7 +46,8 @@ class not_prioritizing {
}
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());
}
......
......@@ -78,8 +78,9 @@ class prioritizing {
}
template <class Actor>
void push_to_cache(Actor* self, mailbox_element_ptr ptr) {
auto high_prio = [](const mailbox_element& val) {
void push_to_cache(Actor* self,
typename Actor::mailbox_type::unique_pointer ptr) {
auto high_prio = [](const typename Actor::mailbox_type::value_type& val) {
return val.is_high_priority();
};
auto& cache = self->mailbox().cache();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment