Scippy

SCIP

Solving Constraint Integer Programs

dialog.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-2024 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file dialog.h
26  * @ingroup INTERNALAPI
27  * @brief internal methods for user interface dialog
28  * @author Tobias Achterberg
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_DIALOG_H__
34 #define __SCIP_DIALOG_H__
35 
36 
37 #include "scip/def.h"
38 #include "scip/type_retcode.h"
39 #include "scip/type_set.h"
40 #include "scip/type_dialog.h"
41 #include "scip/pub_dialog.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /*
48  * dialog handler
49  */
50 
51 /** copies the given dialog to a new scip */
53  SCIP_DIALOG* dialog, /**< dialog */
54  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
55  );
56 
57 /** creates a dialog handler */
59  SCIP_SET* set, /**< global SCIP settings */
60  SCIP_DIALOGHDLR** dialoghdlr /**< pointer to store dialog handler */
61  );
62 
63 /** frees a dialog handler and it's dialog tree */
65  SCIP* scip, /**< SCIP data structure */
66  SCIP_DIALOGHDLR** dialoghdlr /**< pointer to dialog handler */
67  );
68 
69 /** executes the root dialog of the dialog handler */
71  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
72  SCIP_SET* set /**< global SCIP settings */
73  );
74 
75 /** makes given dialog the root dialog of dialog handler; captures dialog and releases former root dialog */
77  SCIP* scip, /**< SCIP data structure */
78  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
79  SCIP_DIALOG* dialog /**< dialog to be the root */
80  );
81 
82 
83 
84 
85 /*
86  * dialog
87  */
88 
89 /** creates and captures a user interface dialog */
91  SCIP_DIALOG** dialog, /**< pointer to store the dialog */
92  SCIP_DECL_DIALOGCOPY ((*dialogcopy)), /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
93  SCIP_DECL_DIALOGEXEC ((*dialogexec)), /**< execution method of dialog */
94  SCIP_DECL_DIALOGDESC ((*dialogdesc)), /**< description output method of dialog, or NULL */
95  SCIP_DECL_DIALOGFREE ((*dialogfree)), /**< destructor of dialog to free user data, or NULL */
96  const char* name, /**< name of dialog: command name appearing in parent's dialog menu */
97  const char* desc, /**< description of dialog used if description output method is NULL */
98  SCIP_Bool issubmenu, /**< is the dialog a sub-menu? */
99  SCIP_DIALOGDATA* dialogdata /**< user defined dialog data */
100  );
101 
102 /** captures a dialog */
103 void SCIPdialogCapture(
104  SCIP_DIALOG* dialog /**< dialog */
105  );
106 
107 /** releases a dialog */
109  SCIP* scip, /**< SCIP data structure */
110  SCIP_DIALOG** dialog /**< pointer to dialog */
111  );
112 
113 /** executes dialog */
115  SCIP_DIALOG* dialog, /**< dialog */
116  SCIP_SET* set, /**< global SCIP settings */
117  SCIP_DIALOGHDLR* dialoghdlr, /**< dialog handler */
118  SCIP_DIALOG** nextdialog /**< pointer to store the next dialog to process */
119  );
120 
121 /** adds a sub-dialog to the given dialog as menu entry and captures the sub-dialog */
123  SCIP_DIALOG* dialog, /**< dialog */
124  SCIP_SET* set, /**< global SCIP settings */
125  SCIP_DIALOG* subdialog /**< sub-dialog to add as menu entry in dialog */
126  );
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif
SCIP_RETCODE SCIPdialogExec(SCIP_DIALOG *dialog, SCIP_SET *set, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG **nextdialog)
Definition: dialog.c:939
#define SCIP_DECL_DIALOGCOPY(x)
Definition: type_dialog.h:62
SCIP_RETCODE SCIPdialogRelease(SCIP *scip, SCIP_DIALOG **dialog)
Definition: dialog.c:922
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings
struct SCIP_DialogData SCIP_DIALOGDATA
Definition: type_dialog.h:51
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPdialoghdlrCreate(SCIP_SET *set, SCIP_DIALOGHDLR **dialoghdlr)
Definition: dialog.c:336
#define SCIP_DECL_DIALOGDESC(x)
Definition: type_dialog.h:82
void SCIPdialogCapture(SCIP_DIALOG *dialog)
Definition: dialog.c:912
SCIP_RETCODE SCIPdialogCopyInclude(SCIP_DIALOG *dialog, SCIP_SET *set)
Definition: dialog.c:318
#define SCIP_Bool
Definition: def.h:91
SCIP_RETCODE SCIPdialogCreate(SCIP_DIALOG **dialog, SCIP_DECL_DIALOGCOPY((*dialogcopy)), SCIP_DECL_DIALOGEXEC((*dialogexec)), SCIP_DECL_DIALOGDESC((*dialogdesc)), SCIP_DECL_DIALOGFREE((*dialogfree)), const char *name, const char *desc, SCIP_Bool issubmenu, SCIP_DIALOGDATA *dialogdata)
Definition: dialog.c:824
#define SCIP_DECL_DIALOGFREE(x)
Definition: type_dialog.h:70
SCIP_RETCODE SCIPdialoghdlrSetRoot(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
Definition: dialog.c:413
#define SCIP_DECL_DIALOGEXEC(x)
Definition: type_dialog.h:96
SCIP_RETCODE SCIPdialogAddEntry(SCIP_DIALOG *dialog, SCIP_SET *set, SCIP_DIALOG *subdialog)
Definition: dialog.c:964
SCIP_RETCODE SCIPdialoghdlrFree(SCIP *scip, SCIP_DIALOGHDLR **dialoghdlr)
Definition: dialog.c:367
type definitions for user interface dialog
common defines and data types used in all packages of SCIP
public methods for user interface dialog
SCIP_RETCODE SCIPdialoghdlrExec(SCIP_DIALOGHDLR *dialoghdlr, SCIP_SET *set)
Definition: dialog.c:385