$darkmode
main_commands.cpp File Reference
#include "main_commands.hpp"
#include <csignal>
#include <cstdlib>
#include <iostream>
#include <tuple>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <cloe/core.hpp>
#include <cloe/stack.hpp>
#include <fable/utility.hpp>
#include "error_handler.hpp"
#include "simulation.hpp"
Include dependency graph for main_commands.cpp:

Functions

void engine::handle_signal (int sig)
 
template<typename Options >
std::string engine::handle_uuid_impl (const Options &opt)
 
std::string engine::handle_uuid (const RunOptions &opt)
 
std::string engine::handle_uuid (const ProbeOptions &opt)
 
template<typename Options >
std::tuple< cloe::Stack, sol::state > engine::handle_config_impl (const Options &opt, const std::vector< std::string > &filepaths)
 
std::tuple< cloe::Stack, sol::state > engine::handle_config (const RunOptions &opt, const std::vector< std::string > &filepaths)
 
std::tuple< cloe::Stack, sol::state > engine::handle_config (const ProbeOptions &opt, const std::vector< std::string > &filepaths)
 

Variables

Simulation * engine::GLOBAL_SIMULATION_INSTANCE {nullptr}
 

Function Documentation

◆ handle_signal()

void engine::handle_signal ( int  sig)

Handle interrupt signals sent by the operating system.

When this function is called, it cannot call any other functions that might have set any locks, because it might not get the lock, and then the program hangs instead of gracefully exiting. It's a bit sad, true, but that's the way it is.

That is why you cannot make use of the logging in this function. You also cannot make use of triggers, because they also have a lock.

The function immediately resets the signal handler to the default provided by the standard library, so that in the case that we do hang for some reasons, the user can force abort by sending the signal a third time.

Here is the call graph for this function:
Here is the caller graph for this function: