21#ifndef IPC_DOXYGEN_ONLY
22# error "As of this writing this is a documentation-only "header" (the "source" is for humans and Doxygen only)."
366 template<
typename Handle_name_func>
A documentation-only concept defining the behavior of an object representing a light-weight handle to...
~Persistent_mq_handle()
Destroys this handle (or no-op if no handle was successfully constructed, or if it's a moved-from or ...
bool interrupt_receives()
Enables receives-interrupted mode: is_receivable() (future calls), receive() (future or concurrent ca...
size_t max_n_msgs() const
Returns the max message count of the underlying queue.
Persistent_mq_handle()
Construct null handle, suitable only for being subsequently moved-to or destroyed.
void wait_sendable(Error_code *err_code=0)
Equivalent to send() except stops short of writing anything, with non-error return indicating that tr...
Native_handle native_handle() const
Available if and only if S_HAS_NATIVE_HANDLE is true: Returns the stored native MQ handle; null means...
static void remove_persistent(flow::log::Logger *logger_ptr, const Shared_name &name, Error_code *err_code=0)
Removes the named persistent MQ.
Persistent_mq_handle & operator=(Persistent_mq_handle &&src)
Replaces handle with the source handle while making the latter invalid.
Persistent_mq_handle(flow::log::Logger *logger_ptr, const Shared_name &absolute_name, util::Create_only mode_tag, size_t max_n_msg, size_t max_msg_sz, const util::Permissions &perms=util::Permissions(), Error_code *err_code=0)
Construct handle to non-existing named MQ, creating it first.
const Shared_name & absolute_name() const
Returns name equal to absolute_name passed to ctor.
Persistent_mq_handle(Persistent_mq_handle &&src)
Constructs handle from the source handle while making the latter invalid.
void swap(Persistent_mq_handle &val1, Persistent_mq_handle &val2)
Swaps two objects.
void wait_receivable(Error_code *err_code=0)
Equivalent to receive() except stops short of reading anything, with non-error return indicating that...
bool try_receive(util::Blob_mutable *blob, Error_code *err_code=0)
Non-blocking receive: pops copy of message from queue into buffer and returns true; if queue is empty...
void send(const util::Blob_const &blob, Error_code *err_code=0)
Blocking send: pushes copy of message to queue; if queue is full blocks until it is not.
bool timed_wait_sendable(util::Fine_duration timeout_from_now, Error_code *err_code=0)
Equivalent to timed_send() except stops short of writing anything, with true result indicating that t...
bool allow_receives()
Disables mode enabled by interrupt_receives().
bool timed_send(const util::Blob_const &blob, util::Fine_duration timeout_from_now, Error_code *err_code=0)
Blocking timed send: pushes copy of message to queue; if queue is full blocks until it is not,...
bool is_sendable(Error_code *err_code=0)
Equivalent to try_send() except stops short of writing anything, with true result indicating that try...
static void for_each_persistent(const Handle_name_func &handle_name_func)
Lists all named persistent MQs currently persisting, invoking the given handler synchronously on each...
static constexpr bool S_HAS_NATIVE_HANDLE
true if and only if native_handle() method exists, and the returned value may be waited-on by poll()/...
bool timed_wait_receivable(util::Fine_duration timeout_from_now, Error_code *err_code=0)
Equivalent to timed_receive() except stops short of reading anything, with true result indicating tha...
bool is_receivable(Error_code *err_code=0)
Equivalent to try_receive() except stops short of reading anything, with true result indicating that ...
static const Shared_name S_RESOURCE_TYPE_ID
Shared_name relative-folder fragment (no separators) identifying this resource type.
bool try_send(const util::Blob_const &blob, Error_code *err_code=0)
Non-blocking send: pushes copy of message to queue and returns true; if queue is full then no-op and ...
void receive(util::Blob_mutable *blob, Error_code *err_code=0)
Blocking receive: pops copy of message from queue into buffer; if queue is empty blocks until it is n...
size_t max_msg_size() const
Returns the max message size of the underlying queue.
Persistent_mq_handle(const Persistent_mq_handle &)=delete
Copying of handles is prohibited.
Persistent_mq_handle & operator=(const Persistent_mq_handle &)=delete
Copying of handles is prohibited.
Persistent_mq_handle(flow::log::Logger *logger_ptr, const Shared_name &absolute_name, util::Open_or_create mode_tag, size_t max_n_msg_on_create, size_t max_msg_sz_on_create, const util::Permissions &perms_on_create=util::Permissions(), Error_code *err_code=0)
Construct handle to existing named MQ, or else if it does not exist creates it first and opens it (at...
bool allow_sends()
Disables mode enabled by interrupt_sends().
bool timed_receive(util::Blob_mutable *blob, util::Fine_duration timeout_from_now, Error_code *err_code=0)
Blocking timed receive: pops copy of message from queue into buffer; if queue is empty blocks until i...
Persistent_mq_handle(flow::log::Logger *logger_ptr, const Shared_name &absolute_name, util::Open_only mode_tag, Error_code *err_code=0)
Construct handle to existing named MQ.
bool interrupt_sends()
Enables sends-interrupted mode: is_sendable() (future calls), send() (future or concurrent calls),...
String-wrapping abstraction representing a name uniquely distinguishing a kernel-persistent entity fr...
Flow-IPC module providing transmission of structured messages and/or low-level blobs (and more) betwe...
bipc::permissions Permissions
Short-hand for Unix (POSIX) permissions class.
bipc::open_only_t Open_only
Tag type indicating an ideally-atomic open-if-exists-else-fail operation.
boost::asio::mutable_buffer Blob_mutable
Short-hand for an mutable blob somewhere in memory, stored as exactly a void* and a size_t.
bipc::open_or_create_t Open_or_create
Tag type indicating an atomic open-if-exists-else-create operation.
bipc::create_only_t Create_only
Tag type indicating a create-unless-exists-else-fail operation.
flow::Fine_duration Fine_duration
Short-hand for Flow's Fine_duration.
boost::asio::const_buffer Blob_const
Short-hand for an immutable blob somewhere in memory, stored as exactly a void const * and a size_t.
flow::Error_code Error_code
Short-hand for flow::Error_code which is very common.
A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.