Class wrapping a POSIX message queue. More...
#include <eagine/message_bus/posix_mqueue.hpp>
Public Types | |
| using | receive_handler = callable_ref< void(unsigned, span< const char >)> |
| Alias for received message handler. More... | |
Public Member Functions | |
| constexpr | posix_mqueue () noexcept=default |
| Default constructor. | |
| posix_mqueue (posix_mqueue &&temp) noexcept | |
| Move constructible. | |
| posix_mqueue (const posix_mqueue &)=delete | |
| Not copy constructible. | |
| auto | operator= (posix_mqueue &&temp)=delete |
| Not move assignable. | |
| auto | operator= (const posix_mqueue &)=delete |
| Not copy assignable. | |
| auto | get_name () const noexcept -> string_view |
| Returns the unique name of this queue. More... | |
| auto | set_name (std::string name) -> auto & |
| Sets the unique name of the queue. More... | |
| auto | set_name (identifier id) -> auto & |
| Sets the unique name of the queue. More... | |
| posix_mqueue (std::string name) | |
| Constructs the queue and sets the specified name. More... | |
| auto | error_message () const -> std::string |
| Returns the error message of the last failed operation. More... | |
| auto | had_error () const -> bool |
| Indicates if there a previous operation finished with an error. More... | |
| auto | needs_retry () const -> bool |
| Indicates if a previous operation on the queue needs to be retried. More... | |
| constexpr auto | is_open () const noexcept -> bool |
| Indicates if this message queue is open. More... | |
| constexpr auto | is_usable () const noexcept -> bool |
| Indicates if this message queue can be used. More... | |
| auto | unlink () -> auto & |
| Unlinks the OS queue objects. More... | |
| auto | create () -> auto & |
| Creates new OS queue objects. More... | |
| auto | open () -> auto & |
| Opens existing OS queue objects. More... | |
| auto | close () -> posix_mqueue & |
| Closes the OS queue objects. More... | |
| auto | max_data_size () -> valid_if_positive< span_size_t > |
| Returns the absolute maximum block size that can be sent in a message. More... | |
| auto | data_size () noexcept -> span_size_t |
| Returns the maximum block size that can be sent in a message. | |
| auto | send (unsigned priority, span< const char > blk) -> auto & |
| Sents a block of data with the specified priority. | |
| auto | receive (memory::span< char > blk, receive_handler handler) -> auto & |
| Receives messages and calls the specified handler on them. | |
Class wrapping a POSIX message queue.
| using eagine::msgbus::posix_mqueue::receive_handler = callable_ref<void(unsigned, span<const char>)> |
Alias for received message handler.
|
inline |
Constructs the queue and sets the specified name.
|
inline |
|
inline |
|
inline |
Returns the error message of the last failed operation.
|
inlinenoexcept |
Returns the unique name of this queue.
|
inline |
Indicates if there a previous operation finished with an error.
Referenced by is_usable().
|
inlineconstexprnoexcept |
Indicates if this message queue is open.
Referenced by close(), is_usable(), max_data_size(), receive(), and send().
|
inlineconstexprnoexcept |
Indicates if this message queue can be used.
Referenced by eagine::msgbus::posix_mqueue_connection::is_usable().
|
inline |
Returns the absolute maximum block size that can be sent in a message.
Referenced by data_size().
|
inline |
Indicates if a previous operation on the queue needs to be retried.
Referenced by is_usable().
|
inline |
|
inline |
Sets the unique name of the queue.
|
inline |
Sets the unique name of the queue.
Referenced by eagine::msgbus::posix_mqueue_connection::open(), posix_mqueue(), and set_name().
|
inline |