Flow-IPC 1.0.1
Flow-IPC project: Public API.
Namespaces | Typedefs | Enumerations | Functions
util_fwd.hpp File Reference

Namespaces

namespace  ipc
 Catch-all namespace for the Flow-IPC project: A library/API in modern C++17 providing high-performance communication between processes.
 
namespace  ipc::util
 Flow-IPC module containing miscellaneous general-use facilities that ubiquitously used by ~all Flow-IPC modules and/or do not fit into any other Flow-IPC module.
 

Typedefs

using ipc::util::String_view = flow::util::String_view
 Short-hand for Flow's String_view.
 
using ipc::util::Fine_duration = flow::Fine_duration
 Short-hand for Flow's Fine_duration.
 
using ipc::util::Fine_time_pt = flow::Fine_time_pt
 Short-hand for Flow's Fine_time_pt.
 
using ipc::util::Task = flow::async::Task
 Short-hand for polymorphic function (a-la std::function<>) that takes no arguments and returns nothing.
 
using ipc::util::Blob_const = boost::asio::const_buffer
 Short-hand for an immutable blob somewhere in memory, stored as exactly a void const * and a size_t. More...
 
using ipc::util::Blob_mutable = boost::asio::mutable_buffer
 Short-hand for an mutable blob somewhere in memory, stored as exactly a void* and a size_t. More...
 
using ipc::util::process_id_t = ::pid_t
 Syntactic-sugary type for POSIX process ID (integer).
 
using ipc::util::user_id_t = ::uid_t
 Syntactic-sugary type for POSIX user ID (integer).
 
using ipc::util::group_id_t = ::gid_t
 Syntactic-sugary type for POSIX group ID (integer).
 
using ipc::util::Open_or_create = bipc::open_or_create_t
 Tag type indicating an atomic open-if-exists-else-create operation. More...
 
using ipc::util::Open_only = bipc::open_only_t
 Tag type indicating an ideally-atomic open-if-exists-else-fail operation. More...
 
using ipc::util::Create_only = bipc::create_only_t
 Tag type indicating a create-unless-exists-else-fail operation. More...
 
using ipc::util::Permissions = bipc::permissions
 Short-hand for Unix (POSIX) permissions class.
 

Enumerations

enum class  ipc::util::Permissions_level : size_t {
  ipc::util::S_NO_ACCESS , ipc::util::S_USER_ACCESS , ipc::util::S_GROUP_ACCESS , ipc::util::S_UNRESTRICTED ,
  ipc::util::S_END_SENTINEL
}
 Simple specifier of desired access permissions, usually but not necessarily translated into a Permissions value (though even then different value in different contexts). More...
 

Functions

Permissions ipc::util::shared_resource_permissions (Permissions_level permissions_lvl)
 Maps general Permissions_level specifier to low-level Permissions value, when the underlying resource is in the file-system and is either accessible (read-write in terms of file system) or inaccessible. More...
 
void ipc::util::set_resource_permissions (flow::log::Logger *logger_ptr, const fs::path &path, const Permissions &perms, Error_code *err_code=0)
 Utility that sets the permissions of the given resource (at the supplied file system path) to specified POSIX value. More...
 
void ipc::util::set_resource_permissions (flow::log::Logger *logger_ptr, Native_handle handle, const Permissions &perms, Error_code *err_code=0)
 Identical to the other set_resource_permissions() overload but operates on a pre-opened Native_handle (a/k/a handle, socket, file descriptor) to the resource in question. More...
 
bool ipc::util::process_running (process_id_t process_id)
 Returns true if and only if the given process (by PID) is reported as running by the OS. More...
 
const uint8_t * ipc::util::blob_data (const Blob_const &blob)
 Syntactic-sugary helper that returns pointer to first byte in an immutable buffer, as const uint8_t*. More...
 
uint8_t * ipc::util::blob_data (const Blob_mutable &blob)
 Syntactic-sugary helper that returns pointer to first byte in a mutable buffer, as uint8_t*. More...