Commit ca84509a authored by Dominik Charousset's avatar Dominik Charousset

Add system paramater to middleman hooks

parent c72835f7
...@@ -154,7 +154,7 @@ public: ...@@ -154,7 +154,7 @@ public:
template<class C, typename... Ts> template<class C, typename... Ts>
void add_hook(Ts&&... xs) { void add_hook(Ts&&... xs) {
// if only we could move a unique_ptr into a lambda in C++11 // if only we could move a unique_ptr into a lambda in C++11
auto ptr = new C(std::forward<Ts>(xs)...); auto ptr = new C(system_, std::forward<Ts>(xs)...);
backend().dispatch([=] { backend().dispatch([=] {
ptr->next.swap(hooks_); ptr->next.swap(hooks_);
hooks_.reset(ptr); hooks_.reset(ptr);
...@@ -171,7 +171,7 @@ public: ...@@ -171,7 +171,7 @@ public:
template <class F> template <class F>
void add_shutdown_cb(F fun) { void add_shutdown_cb(F fun) {
struct impl : hook { struct impl : hook {
impl(F&& f) : fun_(std::move(f)) { impl(actor_system&, F&& f) : fun_(std::move(f)) {
// nop // nop
} }
......
...@@ -294,9 +294,10 @@ actor_addr middleman::remote_actor(std::set<std::string> ifs, ...@@ -294,9 +294,10 @@ actor_addr middleman::remote_actor(std::set<std::string> ifs,
if (! (xs.empty() && ifs.empty()) if (! (xs.empty() && ifs.empty())
&& ! std::includes(xs.begin(), xs.end(), ifs.begin(), ifs.end())) { && ! std::includes(xs.begin(), xs.end(), ifs.begin(), ifs.end())) {
std::string what = "expected signature: "; std::string what = "expected signature: ";
what += deep_to_string(xs);
what += ", found: ";
what += deep_to_string(ifs); what += deep_to_string(ifs);
what += ", found: ";
what += deep_to_string(xs);
throw network_error(std::move(what)); throw network_error(std::move(what));
} }
result = std::move(res); result = std::move(res);
......
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