20#ifndef HEDGEHOG_GRAPH_SIGNAL_HANDLER_H
21#define HEDGEHOG_GRAPH_SIGNAL_HANDLER_H
38template<
size_t Separator,
class ...AllTypes>
55 std::string signalString(std::to_string(signum));
57 std::string signalString(strsignal(signum));
62 std::cout <<
"signal caught: " << signum <<
": (" << signalString <<
")" << std::endl;
112template<
size_t Separator,
class ...AllTypes>
113bool GraphSignalHandler<Separator, AllTypes...>::signalHandled_ =
false;
118template<
size_t Separator,
class ...AllTypes>
119Graph<Separator, AllTypes...> *GraphSignalHandler<Separator, AllTypes...>::graphInstance_ =
nullptr;
124template<
size_t Separator,
class ...AllTypes>
130template<
size_t Separator,
class ...AllTypes>
136template<
size_t Separator,
class ...AllTypes>
StructureOptions
Enum structural options.
@ ALL
Displays both THREADING and QUEUE.
DebugOptions
Enum to enable debug printing.
@ ALL
Shows debug information such as pointer addresses for nodes and edges.
ColorScheme
Enum color options.
@ EXECUTION
Colors nodes based on execution time.
Hedgehog graph abstraction.
void createDotFile(std::filesystem::path const &dotFilePath, ColorScheme colorScheme=ColorScheme::NONE, StructureOptions structureOptions=StructureOptions::NONE, DebugOptions debugOption=DebugOptions::NONE, std::unique_ptr< ColorPicker > colorPicker=std::make_unique< JetColor >(), bool verbose=false)
Create a dot file representing a snapshot of the state of the graph at the moment of the call,...
Implements a signal handler to catch events such as termination and killing.
static void atExit()
Create a dot file at exit if the instance still exist.
static void handleSignal(int signum=SIGTERM)
Function that handles signals.
static void setColorScheme(ColorScheme scheme)
Sets the color scheme for dot file generation.
static void setStructureOptions(StructureOptions options)
Sets the structure options for dot file generation.
static StructureOptions structureOptions
< The structure options to use for graph dot file
static ColorScheme colorScheme
< The color scheme to use for graph dot file
static void registerSignal(int signum=SIGTERM, bool atExit=false)
Registers a signal for handling. (default SIGTERM)
static bool signalHandled_
Flag to indicate if a signal has been fired or not.
static Graph< Separator, AllTypes... > * graphInstance_
< The outer graph instance
static DebugOptions debugOptions
< The debug options to use for graph dot file
static void setDebugOptions(DebugOptions options)
Sets the debug options for dot file generation.
static void registerGraph(Graph< Separator, AllTypes... > *graph)
Registers a task graph to be displayed when a signal is fired.