Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Utopia::GotSignal Class Reference

An exception for when the program should end due to handling of a signal. More...

#include <exceptions.hh>

Inheritance diagram for Utopia::GotSignal:
Inheritance graph
[legend]
Collaboration diagram for Utopia::GotSignal:
Collaboration graph
[legend]

Public Member Functions

 GotSignal (const int signum)
 Construct a GotSignal exception, which has a standardized what message.
 
- Public Member Functions inherited from Utopia::Exception
 Exception (const std::string &what_arg, const int exit_code_arg=1)
 Construct an Utopia-specific exception.
 
 Exception (const char *what_arg, const int exit_code_arg=1)
 Construct an Utopia-specific exception.
 

Additional Inherited Members

- Public Attributes inherited from Utopia::Exception
const int exit_code
 The exit code to use when exiting due to this exception.
 

Detailed Description

An exception for when the program should end due to handling of a signal.

This exception can only be initialized with a signal number. From that, a standardized what-argument is generated and the exit code is calculated according to Unix convention as 128 + abs(signum)

Constructor & Destructor Documentation

◆ GotSignal()

Utopia::GotSignal::GotSignal ( const int  signum)
inline

Construct a GotSignal exception, which has a standardized what message.

The constructor takes the number of the signal that triggered this exception and computes an exit code from that according to Unix convention, i.e.: 128 + abs(signum)

59 :
60 Exception("Received signal: " + std::to_string(signum),
61 128 + abs(signum))
62 {}
Exception(const std::string &what_arg, const int exit_code_arg=1)
Construct an Utopia-specific exception.
Definition exceptions.hh:26
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213

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