Commit 578c940f authored by Dominik Charousset's avatar Dominik Charousset

Prettify to_string output for actors

parent 6ad52ebb
...@@ -223,6 +223,12 @@ private: ...@@ -223,6 +223,12 @@ private:
intrusive_ptr<data> data_; intrusive_ptr<data> data_;
}; };
/// Returns whether `x` contains an URI.
/// @relates node_id
inline bool wraps_uri(const node_id& x) noexcept {
return x && x->implementation_id() == node_id::uri_data::class_id;
}
/// @relates node_id /// @relates node_id
inline bool operator==(const node_id& x, const node_id& y) noexcept { inline bool operator==(const node_id& x, const node_id& y) noexcept {
return x.compare(y) == 0; return x.compare(y) == 0;
......
...@@ -114,11 +114,17 @@ namespace { ...@@ -114,11 +114,17 @@ namespace {
void append_to_string_impl(std::string& x, const actor_control_block* y) { void append_to_string_impl(std::string& x, const actor_control_block* y) {
if (y != nullptr) { if (y != nullptr) {
if (wraps_uri(y->nid)) {
append_to_string(x, y->nid);
x += "/id/";
x += std::to_string(y->aid);
} else {
x += std::to_string(y->aid); x += std::to_string(y->aid);
x += '@'; x += '@';
append_to_string(x, y->nid); append_to_string(x, y->nid);
}
} else { } else {
x += "0@invalid-node"; x += "null:pointer";
} }
} }
......
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