Developer documentation
Version 3.0.3-105-gd3941f44
signal_handler.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __signal_handler_h__
18#define __signal_handler_h__
19
20#include <string>
21
22namespace MR
23{
24 namespace SignalHandler
25 {
27 using cleanup_function_type = void(*)();
28
30 void init();
33
35 void mark_file_for_deletion (const std::string& filename);
37 void unmark_file_for_deletion (const std::string& filename);
38 }
39}
40
41#endif
void init()
set up the signal handler
void on_signal(cleanup_function_type func)
add function to be run when a signal is received and at program exit
void unmark_file_for_deletion(const std::string &filename)
unmark the file from deletion
void(*)() cleanup_function_type
the type of function expected for on_signal()
void mark_file_for_deletion(const std::string &filename)
mark the file for deletion when a signal is received or at program exit
Definition: base.h:24