roar
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
Roar::ShutdownBarrier Class Reference

#include <shutdown_barrier.hpp>

Collaboration diagram for Roar::ShutdownBarrier:

Classes

struct  Implementation
 

Public Member Functions

 ShutdownBarrier () noexcept
 
 ~ShutdownBarrier ()
 
 ShutdownBarrier (ShutdownBarrier &&)
 
 ShutdownBarrier (ShutdownBarrier const &)=delete
 
ShutdownBarrieroperator= (ShutdownBarrier &&)
 
ShutdownBarrieroperator= (ShutdownBarrier const &)=delete
 
void release (int releasedWithWhatSignal)
 Releases the barrier and stops blocking.
 
int wait ()
 Waits until release is called and returns the signal.
 

Static Private Member Functions

static void installSignalHandlers ()
 

Private Attributes

std::unique_ptr< Implementationm_impl
 

Detailed Description

A ShutdownBarrier will block execution until SIGINT (Ctrl + C), SIGTSTP (Ctrl + Z) or SIGTERM (OS shutdown and graceful termination signal from task managers) is received.

Constructor & Destructor Documentation

◆ ShutdownBarrier() [1/3]

Roar::ShutdownBarrier::ShutdownBarrier ( )
noexcept

◆ ~ShutdownBarrier()

Roar::ShutdownBarrier::~ShutdownBarrier ( )
default

◆ ShutdownBarrier() [2/3]

Roar::ShutdownBarrier::ShutdownBarrier ( ShutdownBarrier &&  )
default

◆ ShutdownBarrier() [3/3]

Roar::ShutdownBarrier::ShutdownBarrier ( ShutdownBarrier const &  )
delete

Member Function Documentation

◆ installSignalHandlers()

void Roar::ShutdownBarrier::installSignalHandlers ( )
staticprivate

◆ operator=() [1/2]

ShutdownBarrier & Roar::ShutdownBarrier::operator= ( ShutdownBarrier &&  )
default

◆ operator=() [2/2]

ShutdownBarrier & Roar::ShutdownBarrier::operator= ( ShutdownBarrier const &  )
delete

◆ release()

void Roar::ShutdownBarrier::release ( int  releasedWithWhatSignal)

Releases the barrier and stops blocking.

◆ wait()

int Roar::ShutdownBarrier::wait ( )

Waits until release is called and returns the signal.

Member Data Documentation

◆ m_impl

std::unique_ptr<Implementation> Roar::ShutdownBarrier::m_impl
private

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