iceoryx_hoofs/source/posix_wrapper/named_pipe.cpp
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) semaphores are initalized via placementCreate call
NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) semaphores are initalized via placementCreate call
NOLINTNEXTLINE ( cppcoreguidelines - pro - type - member - init ) semaphores are initalized via placementCreate call
NamedPipe::NamedPipeData::NamedPipeData(bool& isInitialized,
                                        IpcChannelError& error,
                                        const uint64_t maxMsgNumber) noexcept
{
    auto signalError = [&](const char* name) {
        std::cerr << "Unable to create " << name << " semaphore for named pipe \"" << 'x' << "\"";
        isInitialized = false;
        error = IpcChannelError::INTERNAL_LOGIC_ERROR;
    };
    Semaphore::placementCreate(
        &semaphores[SEND_SEMAPHORE], CreateUnnamedSharedMemorySemaphore, static_cast<unsigned int>(maxMsgNumber))
        .or_else([&](auto) { signalError("send"); });
    if (!isInitialized)
    {
        return;
    }
    Semaphore::placementCreate(&semaphores[RECEIVE_SEMAPHORE], CreateUnnamedSharedMemorySemaphore, 0U)
        .or_else([&](auto) { signalError("receive"); });
    if (!isInitialized)
    {
        return;
    }
    initializationGuard.store(VALID_DATA);
}
NamedPipe :: NamedPipeData :: NamedPipeData ( bool & isInitialized , IpcChannelError & error , const uint64_t maxMsgNumber ) noexcept { auto signalError = [ & ] ( const char * name ) { std :: cerr << " " << name << " \" " << ' ' << " \" " ; isInitialized = false ; error = IpcChannelError :: INTERNAL_LOGIC_ERROR ; } ; Semaphore :: placementCreate ( & semaphores [ SEND_SEMAPHORE ] , CreateUnnamedSharedMemorySemaphore , static_cast < unsigned int > ( maxMsgNumber ) ) . or_else ( [ & ] ( auto ) { signalError ( " " ) ; } ) ; if ( ! isInitialized ) { return ; } Semaphore :: placementCreate ( & semaphores [ RECEIVE_SEMAPHORE ] , CreateUnnamedSharedMemorySemaphore , 0U ) . or_else ( [ & ] ( auto ) { signalError ( " " ) ; } ) ; if ( ! isInitialized ) { return ; } initializationGuard . store ( VALID_DATA ) ; }
NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) semaphores are initalized via placementCreate call
NOLINTNEXTLINE ( cppcoreguidelines - pro - type - member - init ) semaphores are initalized via placementCreate call