libcaf
0.17.1
|
Bundles various flags along with an optional request ID. More...
#include <message_id.hpp>
Inherits comparable< message_id >.
Public Member Functions | |
constexpr | message_id () |
Constructs a message ID for asynchronous messages with normal priority. | |
constexpr | message_id (uint64_t value) |
message_id (const message_id &)=default | |
message_id & | operator= (const message_id &)=default |
constexpr uint64_t | category () const noexcept |
Returns the message category, i.e., one of normal_message_category , upstream_message_category , downstream_message_category , or urgent_message_category . More... | |
constexpr message_id | with_category (uint64_t x) const noexcept |
Returns a new message ID with given category. | |
constexpr bool | is_async () const noexcept |
Returns whether a message is asynchronous, i.e., neither a request, nor a response, nor a stream message. More... | |
constexpr bool | is_request () const noexcept |
Returns whether a message is a request. | |
constexpr bool | is_response () const noexcept |
Returns whether a message is a response to a previously send request. | |
constexpr bool | is_answered () const noexcept |
Returns whether a message is tagged as answered by the receiving actor. | |
constexpr bool | is_urgent_message () const noexcept |
Returns whether category() == urgent_message_category . | |
constexpr bool | is_normal_message () const noexcept |
Returns whether category() == normal_message_category . | |
constexpr bool | is_stream_message () const noexcept |
Returns whether category() is an up- or downstream message. | |
constexpr bool | is_upstream_message () const noexcept |
Returns whether category() == upstream_message_category . | |
constexpr bool | is_downstream_message () const noexcept |
Returns whether category() == downstream_message_category . | |
constexpr message_id | response_id () const noexcept |
Returns a response ID for the current request or an asynchronous ID with the same priority as this ID. More... | |
constexpr message_id | request_id () const noexcept |
Extracts the request number part of this ID. | |
constexpr message_id | with_high_priority () const noexcept |
Returns the same ID but high message priority. More... | |
constexpr message_id | with_normal_priority () const noexcept |
Returns the same ID with normal message priority. More... | |
constexpr uint64_t | integer_value () const noexcept |
Returns the "raw bytes" for this ID. | |
constexpr int64_t | compare (const message_id &other) const noexcept |
Returns a negative value if *this < other , zero if *this == other , and a positive value otherwise. More... | |
void | mark_as_answered () noexcept |
Sets the flag for marking an incoming message as answered. | |
message_id & | operator++ () noexcept |
Static Public Attributes | |
static constexpr uint64_t | response_flag_mask = 0x8000000000000000 |
The first bit flags response messages. | |
static constexpr uint64_t | answered_flag_mask = 0x4000000000000000 |
The second bit flags whether the actor already responded. | |
static constexpr uint64_t | category_flag_mask = 0x3000000000000000 |
static constexpr uint64_t | request_id_mask = 0x0FFFFFFFFFFFFFFF |
The trailing 60 bits are used for the actual ID. | |
static constexpr uint64_t | urgent_message_category = 0 |
Identifies one-to-one messages with high priority. | |
static constexpr uint64_t | normal_message_category = 1 |
Identifies one-to-one messages with normal priority. | |
static constexpr uint64_t | upstream_message_category = 2 |
Identifies stream messages that flow upstream, e.g., upstream_msg::ack_batch . More... | |
static constexpr uint64_t | downstream_message_category = 3 |
Identifies stream messages that flow downstream, e.g., downstream_msg::batch . More... | |
static constexpr uint64_t | category_offset = 60 |
Number of bits trailing the category. | |
static constexpr uint64_t | default_async_value = 0x1000000000000000 |
Default value for asynchronous messages with normal message category. | |
Friends | |
template<class Inspector > | |
Inspector::result_type | inspect (Inspector &f, message_id &x) |
Related Functions | |
(Note that these are not member functions.) | |
constexpr message_id | make_message_id (normal_message_priority_constant, uint64_t value) |
Generates a message_id with given integer value. | |
constexpr message_id | make_message_id (high_message_priority_constant, uint64_t value) |
Generates a message_id with given integer value. | |
template<message_priority P = message_priority::normal> | |
constexpr message_id | make_message_id (uint64_t value=0) |
Generates a message_id with given integer value. | |
constexpr message_id | make_message_id (message_priority p) |
Generates a message_id with given priority. | |
Bundles various flags along with an optional request ID.
|
noexcept |
Returns the message category, i.e., one of normal_message_category
, upstream_message_category
, downstream_message_category
, or urgent_message_category
.
|
noexcept |
Returns a negative value if *this < other
, zero if *this == other
, and a positive value otherwise.
|
noexcept |
Returns whether a message is asynchronous, i.e., neither a request, nor a response, nor a stream message.
|
noexcept |
Returns a response ID for the current request or an asynchronous ID with the same priority as this ID.
|
noexcept |
Returns the same ID but high message priority.
!is_stream_message()
|
noexcept |
Returns the same ID with normal message priority.
!is_stream_message()
|
static |
Identifies stream messages that flow downstream, e.g., downstream_msg::batch
.
|
static |
Identifies stream messages that flow upstream, e.g., upstream_msg::ack_batch
.