Scippy

UG

Ubiquity Generator framework

scipParaObjMessageHdlr.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and software framework */
4/* UG --- Ubquity Generator Framework */
5/* */
6/* Copyright Written by Yuji Shinano <shinano@zib.de>, */
7/* Copyright (C) 2021-2024 by Zuse Institute Berlin, */
8/* licensed under LGPL version 3 or later. */
9/* Commercial licenses are available through <licenses@zib.de> */
10/* */
11/* This code is free software; you can redistribute it and/or */
12/* modify it under the terms of the GNU Lesser General Public License */
13/* as published by the Free Software Foundation; either version 3 */
14/* of the License, or (at your option) any later version. */
15/* */
16/* This program is distributed in the hope that it will be useful, */
17/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
18/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
19/* GNU Lesser General Public License for more details. */
20/* */
21/* You should have received a copy of the GNU Lesser General Public License */
22/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
23/* */
24/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
25
26/**@file scipParaObjMessageHdlr.h
27 * @brief SCIP message handler for ParaSCIP and FiberSCIP.
28 * @author Yuji Shinano
29 *
30 *
31 *
32 */
33
34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35
36#ifndef __SCIP_PARA_OBJ_MESSAGE_HDLR_H__
37#define __SCIP_PARA_OBJ_MESSAGE_HDLR_H__
38
39#include "objscip/objmessagehdlr.h"
40#include "scip/scip.h"
41#include "ug/paraComm.h"
42
43namespace ParaSCIP
44{
45
46/** C++ wrapper object for file readers */
47class ScipParaObjMessageHdlr: public scip::ObjMessagehdlr
48{
49 // MYMESSAGEHDLRDATA *mymessagehdlrdata;
51 FILE* logfile; /**< log file where to copy messages into */
52 SCIP_Bool quiet; /**< should screen messages be suppressed? */
53
54 void logMessage(
55 FILE* file, /**< file stream to print message into */
56 const char* msg /**< message to print */
57 );
58
59public:
60
61 /** default constructor */
64 FILE* file,
65 SCIP_Bool quiet,
66 SCIP_Bool bufferedoutput /* should the output be buffered up to the next newline? */
67 );
68
69 /** destructor */
71
72 /** return log file */
73 FILE* getlogfile() const { return logfile; };
74
75 /** error message print method of message handler
76 *
77 * This method is invoked, if SCIP wants to display an error message to the screen or a file
78 */
79 virtual void scip_error(
80 SCIP_MESSAGEHDLR* messagehdlr, /**< the message handler itself */
81 FILE* file, /**< file stream to print into */
82 const char* msg /**< string to output into the file */
83 );
84
85 /** warning message print method of message handler
86 *
87 * This method is invoked, if SCIP wants to display a warning message to the screen or a file
88 */
89 virtual void scip_warning(
90 SCIP_MESSAGEHDLR* messagehdlr, /**< the message handler itself */
91 FILE* file, /**< file stream to print into */
92 const char* msg /**< string to output into the file */
93 );
94
95 /** dialog message print method of message handler
96 *
97 * This method is invoked, if SCIP wants to display a dialog message to the screen or a file
98 */
99 virtual void scip_dialog(
100 SCIP_MESSAGEHDLR* messagehdlr, /**< the message handler itself */
101 FILE* file, /**< file stream to print into */
102 const char* msg /**< string to output into the file */
103 );
104
105 /** info message print method of message handler
106 *
107 * This method is invoked, if SCIP wants to display an information message to the screen or a file
108 */
109 virtual void scip_info(
110 SCIP_MESSAGEHDLR* messagehdlr, /**< the message handler itself */
111 FILE* file, /**< file stream to print into */
112 const char* msg /**< string to output into the file */
113 );
114};
115
116extern "C" {
117/** error message function as used by SCIP */
118extern
119SCIP_DECL_ERRORPRINTING(scip_errorfunction);
120}
121
122}
123
124#endif // __SCIP_PARA_OBJ_MESSAGE_HDLR_H__
virtual void scip_warning(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *msg)
void logMessage(FILE *file, const char *msg)
ScipParaObjMessageHdlr(UG::ParaComm *comm, FILE *file, SCIP_Bool quiet, SCIP_Bool bufferedoutput)
virtual void scip_error(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *msg)
virtual void scip_info(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *msg)
virtual void scip_dialog(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *msg)
Base class of communicator object.
Definition: paraComm.h:102
SCIP_DECL_ERRORPRINTING(scip_errorfunction)
Base class of communicator for UG Framework.