Commit cc024c4a authored by Dominik Charousset's avatar Dominik Charousset

Rename message_id::from_integer_value to make

parent 5634c340
......@@ -30,6 +30,7 @@
#include "caf/meta/type_name.hpp"
#include "caf/detail/comparable.hpp"
#include "caf/detail/type_traits.hpp"
namespace caf {
......@@ -116,12 +117,6 @@ public:
return value_;
}
static inline message_id from_integer_value(uint64_t value) {
message_id result;
result.value_ = value;
return result;
}
static constexpr message_id make() {
return message_id{};
}
......@@ -130,6 +125,11 @@ public:
return prio == message_priority::high ? high_prioity_flag_mask : 0;
}
template <class Int, class E = detail::enable_if_tt<std::is_integral<Int>>>
static constexpr message_id make(Int value) {
return {static_cast<uint64_t>(value)};
}
long compare(const message_id& other) const {
return (value_ == other.value_) ? 0
: (value_ < other.value_ ? -1 : 1);
......
......@@ -219,11 +219,11 @@ connection_state instance::handle(execution_unit* ctx,
CAF_LOG_DEBUG(CAF_ARG(forwarding_stack) << CAF_ARG(msg));
if (hdr.has(header::named_receiver_flag))
callee_.deliver(hdr.source_node, hdr.source_actor, receiver_name,
message_id::from_integer_value(hdr.operation_data),
message_id::make(hdr.operation_data),
forwarding_stack, msg);
else
callee_.deliver(hdr.source_node, hdr.source_actor, hdr.dest_actor,
message_id::from_integer_value(hdr.operation_data),
message_id::make(hdr.operation_data),
forwarding_stack, msg);
break;
}
......
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