Commit b71aa335 authored by Dominik Charousset's avatar Dominik Charousset

Improve to_string for actor_config

parent 1b4a018e
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "caf/actor_config.hpp" #include "caf/actor_config.hpp"
#include "caf/abstract_actor.hpp"
namespace caf { namespace caf {
actor_config::actor_config(execution_unit* ptr) actor_config::actor_config(execution_unit* ptr)
...@@ -28,9 +30,26 @@ actor_config::actor_config(execution_unit* ptr) ...@@ -28,9 +30,26 @@ actor_config::actor_config(execution_unit* ptr)
// nop // nop
} }
std::string to_string(const actor_config&) { std::string to_string(const actor_config& x) {
// TODO: print flags and groups std::string result = "actor_config(";
return "actor_config"; if (x.groups == nullptr)
result += "[]";
else
result += deep_to_string(*x.groups);
auto add = [&](int flag, const char* name) {
if ((x.flags & flag) != 0) {
result += ", ";
result += name;
}
};
add(abstract_channel::is_actor_bind_decorator_flag, "bind_decorator_flag");
add(abstract_channel::is_actor_dot_decorator_flag, "dot_decorator_flag");
add(abstract_actor::is_detached_flag, "detached_flag");
add(abstract_actor::is_blocking_flag, "blocking_flag");
add(abstract_actor::is_priority_aware_flag, "priority_aware_flag");
add(abstract_actor::is_hidden_flag, "hidden_flag");
result += ")";
return result;
} }
} // namespace caf } // namespace caf
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