20 #ifndef HEDGEHOG_GRAPH_SIGNAL_HANDLER_H 21 #define HEDGEHOG_GRAPH_SIGNAL_HANDLER_H 27 #include "../../hedgehog.h" 36 template<
class GraphOutput,
class ... GraphInputs>
39 static Graph<GraphOutput, GraphInputs...>
56 std::string signalString(std::to_string(signum));
58 std::string signalString(strsignal(signum));
63 std::cout <<
"signal caught: " << signum <<
": (" << signalString <<
")" << std::endl;
65 signalString +
"-graph-output.dot", colorScheme, structureOptions, debugOptions);
84 structureOptions = options;
90 debugOptions = options;
110 template<
class GraphOutput,
class ... GraphInputs>
114 template<
class GraphOutput,
class ... GraphInputs>
119 template<
class GraphOutput,
class ... GraphInputs>
123 template<
class GraphOutput,
class ... GraphInputs>
127 template<
class GraphOutput,
class ... GraphInputs>
133 #endif //HEDGEHOG_GRAPH_SIGNAL_HANDLER_H static void setDebugOptions(DebugOptions options)
Sets the debug options for dot file generation.
static void registerGraph(Graph< GraphOutput, GraphInputs... > *graph)
Registers a task graph to be displayed when a signal is fired.
static void handleSignal(int signum=SIGTERM)
Function that handles signals.
StructureOptions
Enum structural options.
static void setColorScheme(ColorScheme scheme)
Sets the color scheme for dot file generation.
static DebugOptions debugOptions
< The debug options to use for graph dot file
Implements a signal handler to catch events such as termination and killing.
DebugOptions
Enum to enable debug printing.
static ColorScheme colorScheme
< The color scheme to use for graph dot file
Colors nodes based on execution time.
void createDotFile(std::filesystem::path const &dotFilePath, ColorScheme colorScheme=ColorScheme::NONE, StructureOptions structureOptions=StructureOptions::NONE, DebugOptions debugOption=DebugOptions::NONE)
Create a dot file representing a snapshot of the state of the graph at the moment of the call...
Main Hedgehog object that does computation.
Displays both ALLTHREADING and QUEUE.
Shows debug information such as pointer addresses for nodes and edges.
static StructureOptions structureOptions
< The structure options to use for graph dot file
static Graph< GraphOutput, GraphInputs... > * graphInstance_
< The outer graph instance
static void registerSignal(int signum=SIGTERM, bool atExit=false)
Registers a signal for handling. (default SIGTERM)
static void setStructureOptions(StructureOptions options)
Sets the structure options for dot file generation.
static bool signalHandled_
Flag to indicate if a signal has been fired or not.
static void atExit()
Create a dot file at exit if the instance still exist.
ColorScheme
Enum color options.