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 */
38  SCIP_INTERRUPT** interrupt /**< pointer to store the CTRL-C interrupt data */
39  );
40 
41 /** frees a CTRL-C interrupt data */
43  SCIP_INTERRUPT** interrupt /**< pointer to the CTRL-C interrupt data */
44  );
45 
46 /** captures the CTRL-C interrupt to call the SCIP's own interrupt handler */
48  SCIP_INTERRUPT* interrupt /**< CTRL-C interrupt data */
49  );
50 
51 /** releases the CTRL-C interrupt and restores the old interrupt handler */
53  SCIP_INTERRUPT* interrupt /**< CTRL-C interrupt data */
54  );
55 
56 /** returns whether the user interrupted by pressing CTRL-C */
58  void
59  );
60 
61 /** returns whether the process has received a SIGTERM */
63  void
64  );
65 
66 /** send a termination signal to the process so that SCIP tries to terminate as soon as possible */
67 void SCIPtryTerminate(
68  void
69  );
70 
71 /** resets the number of interrupts to 0 */
73  void
74  );
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #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:70
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