Scippy

SCIP

Solving Constraint Integer Programs

interrupt.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file interrupt.h
17  * @ingroup INTERNALAPI
18  * @brief methods for catching the user CTRL-C interrupt
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_INTERRUPT_H__
25 #define __SCIP_INTERRUPT_H__
26 
27 
28 #include "scip/def.h"
29 #include "scip/type_retcode.h"
30 #include "scip/type_interrupt.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** creates a CTRL-C interrupt data */
37 extern
39  SCIP_INTERRUPT** interrupt /**< pointer to store the CTRL-C interrupt data */
40  );
41 
42 /** frees a CTRL-C interrupt data */
43 extern
45  SCIP_INTERRUPT** interrupt /**< pointer to the CTRL-C interrupt data */
46  );
47 
48 /** captures the CTRL-C interrupt to call the SCIP's own interrupt handler */
49 extern
51  SCIP_INTERRUPT* interrupt /**< CTRL-C interrupt data */
52  );
53 
54 /** releases the CTRL-C interrupt and restores the old interrupt handler */
55 extern
57  SCIP_INTERRUPT* interrupt /**< CTRL-C interrupt data */
58  );
59 
60 /** returns whether the user interrupted by pressing CTRL-C */
61 extern
63  void
64  );
65 
66 /** returns whether the process has received a SIGTERM */
67 extern
69  void
70  );
71 
72 /** send a termination signal to the process so that SCIP tries to terminate as soon as possible */
73 extern
74 void SCIPtryTerminate(
75  void
76  );
77 
78 /** resets the number of interrupts to 0 */
79 extern
81  void
82  );
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif
void SCIPtryTerminate(void)
Definition: interrupt.c:167
SCIP_RETCODE SCIPinterruptCreate(SCIP_INTERRUPT **interrupt)
Definition: interrupt.c:79
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for return codes for SCIP methods
void SCIPresetInterrupted(void)
Definition: interrupt.c:175
SCIP_Bool SCIPterminated(void)
Definition: interrupt.c:159
void SCIPinterruptRelease(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:132
#define SCIP_Bool
Definition: def.h:69
SCIP_Bool SCIPinterrupted(void)
Definition: interrupt.c:151
void SCIPinterruptFree(SCIP_INTERRUPT **interrupt)
Definition: interrupt.c:92
common defines and data types used in all packages of SCIP
void SCIPinterruptCapture(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:102
type definitions for catching the user CTRL-C interrupt