MySQL 9.1.0
Source Code Documentation
ExitStatus Class Reference

exit status of processes. More...

#include <exit_status.h>

Classes

struct  continued_t
 
struct  exited_t
 
struct  native_t
 
struct  stopped_t
 
struct  terminated_t
 

Public Member Functions

constexpr ExitStatus (int exit_code)
 construct a exit-status of a exited process. More...
 
constexpr ExitStatus (exited_t, int exit_code)
 
constexpr ExitStatus (native_t, int native_exit_code)
 
constexpr ExitStatus (terminated_t, int signum)
 
constexpr ExitStatus (stopped_t, int signum)
 
constexpr ExitStatus (continued_t)
 
constexpr std::optional< int > exited () const
 check if the status is a clean exit. More...
 
constexpr std::optional< int > terminated () const
 check if the status is a terminated exit. More...
 
constexpr std::optional< int > stopped () const
 check if the status is a stopped process. More...
 
constexpr bool continued () const
 check if the status is continued process. More...
 

Private Types

enum class  StatusKind { kSignalled , kExited , kStopped , kContinued }
 

Static Private Member Functions

static constexpr ExitStatus from_native (int native_exit_code)
 

Private Attributes

StatusKind status_kind_
 
int status_
 

Friends

bool operator== (const ExitStatus &a, const ExitStatus &b)
 

Detailed Description

exit status of processes.

a process can report its exit status:

  • exited (via exit(num))
  • terminated (via a signal, exception, ...)
  • stopped or continued (via SIGSTOP, SIGCONT)

Member Enumeration Documentation

◆ StatusKind

enum class ExitStatus::StatusKind
strongprivate
Enumerator
kSignalled 
kExited 
kStopped 
kContinued 

Constructor & Destructor Documentation

◆ ExitStatus() [1/6]

constexpr ExitStatus::ExitStatus ( int  exit_code)
inlineconstexpr

construct a exit-status of a exited process.

◆ ExitStatus() [2/6]

constexpr ExitStatus::ExitStatus ( exited_t  ,
int  exit_code 
)
inlineconstexpr

◆ ExitStatus() [3/6]

constexpr ExitStatus::ExitStatus ( native_t  ,
int  native_exit_code 
)
inlineconstexpr

◆ ExitStatus() [4/6]

constexpr ExitStatus::ExitStatus ( terminated_t  ,
int  signum 
)
inlineconstexpr

◆ ExitStatus() [5/6]

constexpr ExitStatus::ExitStatus ( stopped_t  ,
int  signum 
)
inlineconstexpr

◆ ExitStatus() [6/6]

constexpr ExitStatus::ExitStatus ( continued_t  )
inlineconstexpr

Member Function Documentation

◆ continued()

constexpr bool ExitStatus::continued ( ) const
inlineconstexpr

check if the status is continued process.

◆ exited()

constexpr std::optional< int > ExitStatus::exited ( ) const
inlineconstexpr

check if the status is a clean exit.

if true, contains the exit-code.

◆ from_native()

static constexpr ExitStatus ExitStatus::from_native ( int  native_exit_code)
inlinestaticconstexprprivate

◆ stopped()

constexpr std::optional< int > ExitStatus::stopped ( ) const
inlineconstexpr

check if the status is a stopped process.

if true, contains the signal number used to stop the process.

◆ terminated()

constexpr std::optional< int > ExitStatus::terminated ( ) const
inlineconstexpr

check if the status is a terminated exit.

if true, contains the signal number used to terminate the process.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const ExitStatus a,
const ExitStatus b 
)
friend

Member Data Documentation

◆ status_

int ExitStatus::status_
private

◆ status_kind_

StatusKind ExitStatus::status_kind_
private

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