contur2
Loading...
Searching...
No Matches
contur::IpcManager Class Reference

Registry/mediator for named IPC channels. More...

#include <ipc_manager.h>

Public Member Functions

 IpcManager ()
 ~IpcManager ()
 IpcManager (const IpcManager &)=delete
IpcManageroperator= (const IpcManager &)=delete
 IpcManager (IpcManager &&) noexcept
IpcManageroperator= (IpcManager &&) noexcept
Result< void > createPipe (const std::string &name, std::size_t capacity=1024)
 Creates a pipe channel if it does not already exist.
Result< void > createSharedMemory (const std::string &name, std::size_t bytes)
 Creates a shared-memory channel if it does not already exist.
Result< void > createMessageQueue (const std::string &name, std::size_t maxMessages=64, bool priorityMode=false)
 Creates a message queue channel if it does not already exist.
Result< std::reference_wrapper< IIpcChannel > > getChannel (const std::string &name)
 Looks up a channel by name.
Result< void > destroyChannel (const std::string &name)
 Destroys a channel by name.
bool exists (const std::string &name) const noexcept
 Checks whether a named channel exists.
std::size_t channelCount () const noexcept
 Number of registered channels.

Private Attributes

std::unique_ptr< Impl > impl_

Detailed Description

Registry/mediator for named IPC channels.

IpcManager owns channel lifetimes and provides lookup by name.

Definition at line 17 of file ipc_manager.h.

Constructor & Destructor Documentation

◆ IpcManager() [1/3]

contur::IpcManager::IpcManager ( )

◆ ~IpcManager()

contur::IpcManager::~IpcManager ( )

◆ IpcManager() [2/3]

contur::IpcManager::IpcManager ( const IpcManager & )
delete

◆ IpcManager() [3/3]

contur::IpcManager::IpcManager ( IpcManager && )
noexcept

Member Function Documentation

◆ channelCount()

std::size_t contur::IpcManager::channelCount ( ) const
nodiscardnoexcept

Number of registered channels.

◆ createMessageQueue()

Result< void > contur::IpcManager::createMessageQueue ( const std::string & name,
std::size_t maxMessages = 64,
bool priorityMode = false )
nodiscard

Creates a message queue channel if it does not already exist.

Parameters
nameChannel name.
maxMessagesMaximum queued messages.
priorityModeTrue enables priority ordering.
Returns
Ok on success, InvalidArgument on invalid input.

◆ createPipe()

Result< void > contur::IpcManager::createPipe ( const std::string & name,
std::size_t capacity = 1024 )
nodiscard

Creates a pipe channel if it does not already exist.

Parameters
nameChannel name.
capacityPipe capacity in bytes.
Returns
Ok on success, InvalidArgument on invalid input.

◆ createSharedMemory()

Result< void > contur::IpcManager::createSharedMemory ( const std::string & name,
std::size_t bytes )
nodiscard

Creates a shared-memory channel if it does not already exist.

Parameters
nameChannel name.
bytesShared-memory size in bytes.
Returns
Ok on success, InvalidArgument on invalid input.

◆ destroyChannel()

Result< void > contur::IpcManager::destroyChannel ( const std::string & name)
nodiscard

Destroys a channel by name.

Returns
Ok on success or NotFound.

◆ exists()

bool contur::IpcManager::exists ( const std::string & name) const
nodiscardnoexcept

Checks whether a named channel exists.

◆ getChannel()

Result< std::reference_wrapper< IIpcChannel > > contur::IpcManager::getChannel ( const std::string & name)
nodiscard

Looks up a channel by name.

Returns
Reference to channel or NotFound.

◆ operator=() [1/2]

IpcManager & contur::IpcManager::operator= ( const IpcManager & )
delete

◆ operator=() [2/2]

IpcManager & contur::IpcManager::operator= ( IpcManager && )
noexcept

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> contur::IpcManager::impl_
private

Definition at line 64 of file ipc_manager.h.


The documentation for this class was generated from the following file: