Scippy

SCIP

Solving Constraint Integer Programs

objmessagehdlr.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-2014 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file objmessagehdlr.h
17  * @brief C++ wrapper for message handlers
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_OBJMESSAGEHDLR_H__
24 #define __SCIP_OBJMESSAGEHDLR_H__
25 
26 #include "scip/scip.h"
27 #include "objscip/objcloneable.h"
28 
29 namespace scip
30 {
31 
32 /**
33  * @brief C++ wrapper for message handlers
34  *
35  * This class defines the interface for message handlers implemented in C++. Note that all functions are pure virtual
36  * (these functions have to be implemented).
37  *
38  * - \ref type_message.h "Corresponding C interface"
39  */
41 {
42 public:
43  /** should the output be buffered up to the next newline? */
45 
46  /** default constructor */
48  SCIP_Bool bufferedoutput /**< should the output be buffered up to the next newline? */
49  )
50  : scip_bufferedoutput_(bufferedoutput)
51  {
52  }
53 
54  /** destructor */
55  virtual ~ObjMessagehdlr()
56  {
57  }
58 
59  /** warning message print method of message handler
60  *
61  * @see SCIP_DECL_MESSAGEWARNING(x) in @ref type_message.h
62  */
63  virtual SCIP_DECL_MESSAGEWARNING(scip_warning)
64  { /*lint --e{715}*/
65 
66  }
67 
68  /** dialog message print method of message handler
69  *
70  * @see SCIP_DECL_MESSAGEDIALOG(x) in @ref type_message.h
71  */
72  virtual SCIP_DECL_MESSAGEDIALOG(scip_dialog)
73  { /*lint --e{715}*/
74 
75  }
76 
77  /** info message print method of message handler
78  *
79  * @see SCIP_DECL_MESSAGEINFO(x) in @ref type_message.h
80  */
81  virtual SCIP_DECL_MESSAGEINFO(scip_info)
82  { /*lint --e{715}*/
83 
84  }
85 
86  /** destructor of message handler to free message handler data
87  *
88  * @see SCIP_DECL_MESSAGEHDLRFREE(x) in @ref type_message.h
89  */
90  virtual SCIP_DECL_MESSAGEHDLRFREE(scip_free)
91  { /*lint --e{715}*/
92  return SCIP_OKAY;
93  }
94 };
95 
96 } /* namespace scip */
97 
98 
99 
100 /** creates the message handler for the given message handler object */
101 extern
103  SCIP_MESSAGEHDLR** messagehdlr, /**< pointer to store the message handler */
104  scip::ObjMessagehdlr* objmessagehdlr, /**< message handler object */
105  SCIP_Bool deleteobject /**< should the message handler object be deleted when message handler is freed? */
106  );
107 
108 /** returns the message handler object for the given message handler */
109 extern
111  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
112  );
113 
114 #endif
virtual SCIP_DECL_MESSAGEDIALOG(scip_dialog)
ObjMessagehdlr(SCIP_Bool bufferedoutput)
struct SCIP_Messagehdlr SCIP_MESSAGEHDLR
Definition: type_message.h:50
SCIP_RETCODE SCIPcreateObjMessagehdlr(SCIP_MESSAGEHDLR **messagehdlr, scip::ObjMessagehdlr *objmessagehdlr, SCIP_Bool deleteobject)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
virtual SCIP_DECL_MESSAGEHDLRFREE(scip_free)
definition of base class for all clonable classes
#define SCIP_Bool
Definition: def.h:49
C++ wrapper for message handlers.
virtual SCIP_DECL_MESSAGEINFO(scip_info)
const SCIP_Bool scip_bufferedoutput_
virtual SCIP_DECL_MESSAGEWARNING(scip_warning)
scip::ObjMessagehdlr * SCIPgetObjMessagehdlr(SCIP_MESSAGEHDLR *messagehdlr)
SCIP callable library.