external_packages/qpoases/INCLUDE/MessageHandling.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of qpOASES.
3  *
4  * qpOASES -- An Implementation of the Online Active Set Strategy.
5  * Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
6  *
7  * qpOASES is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * qpOASES is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with qpOASES; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 
34 #ifndef QPOASES_MESSAGEHANDLING_HPP
35 #define QPOASES_MESSAGEHANDLING_HPP
36 
37 // #define PC_DEBUG
38 
39 #ifdef PC_DEBUG
40  #include <stdio.h>
41 
43  #define myFILE FILE
44 
45  #define myStderr stderr
46 
47  #define myStdout stdout
48 #else
49 
50  #define myFILE int
51 
52  #define myStderr 0
53 
54  #define myStdout 0
55 #endif
56 
57 
58 #include <Types.hpp>
59 #include <Constants.hpp>
60 
61 
65 {
67 /* miscellaneous */
80 /* Indexlist */
87 /* SubjectTo / Bounds / Constraints */
96 /* QProblem */
169 /* Utils */
174 /* SolutionAnalysis */
177 };
178 
179 
180 
188 class MessageHandling
189 {
190  /*
191  * INTERNAL DATA STRUCTURES
192  */
193  public:
195  typedef struct {
196  returnValue key;
197  const char* data;
198  VisibilityStatus globalVisibilityStatus;
200  } ReturnValueList;
201 
202 
203  /*
204  * PUBLIC MEMBER FUNCTIONS
205  */
206  public:
208  MessageHandling( );
209 
211  MessageHandling( myFILE* _outputFile
212  );
213 
215  MessageHandling( VisibilityStatus _errorVisibility,
216  VisibilityStatus _warningVisibility,
217  VisibilityStatus _infoVisibility
218  );
219 
221  MessageHandling( myFILE* _outputFile,
222  VisibilityStatus _errorVisibility,
223  VisibilityStatus _warningVisibility,
224  VisibilityStatus _infoVisibility
225  );
226 
229  );
230 
232  ~MessageHandling( );
233 
236  );
237 
238 
246  returnValue Enumber,
247  const char* additionaltext,
248  const char* functionname,
249  const char* filename,
250  const unsigned long linenumber,
251  VisibilityStatus localVisibilityStatus
254  );
255 
261  returnValue Wnumber,
262  const char* additionaltext,
263  const char* functionname,
264  const char* filename,
265  const unsigned long linenumber,
266  VisibilityStatus localVisibilityStatus
269  );
270 
275  returnValue Inumber,
276  const char* additionaltext,
277  const char* functionname,
278  const char* filename,
279  const unsigned long linenumber,
280  VisibilityStatus localVisibilityStatus
283  );
284 
285 
288  returnValue reset( );
289 
290 
294 
295 
299 
303 
307 
310  inline myFILE* getOutputFile( ) const;
311 
314  inline int getErrorCount( ) const;
315 
316 
318  inline void setErrorVisibilityStatus( VisibilityStatus _errorVisibility
319  );
320 
322  inline void setWarningVisibilityStatus( VisibilityStatus _warningVisibility
323  );
324 
326  inline void setInfoVisibilityStatus( VisibilityStatus _infoVisibility
327  );
328 
330  inline void setOutputFile( myFILE* _outputFile
331  );
332 
336  inline returnValue setErrorCount( int _errorCount
337  );
338 
340  static const char* getErrorString(int error);
341 
342  /*
343  * PROTECTED MEMBER FUNCTIONS
344  */
345  protected:
350  returnValue RETnumber,
351  const char* additionaltext,
352  const char* functionname,
353  const char* filename,
354  const unsigned long linenumber,
355  VisibilityStatus localVisibilityStatus,
358  const char* RETstring
359  );
360 
361 
362  /*
363  * PROTECTED MEMBER VARIABLES
364  */
365  protected:
370  myFILE* outputFile;
372  int errorCount;
373 };
374 
375 
376 #ifndef __FUNCTION__
377 
378  #define __FUNCTION__ 0
379 #endif
380 
381 #ifndef __FILE__
382 
383  #define __FILE__ 0
384 #endif
385 
386 #ifndef __LINE__
387 
388  #define __LINE__ 0
389 #endif
390 
391 
393 #define THROWERROR(retval) ( getGlobalMessageHandler( )->throwError((retval),0,__FUNCTION__,__FILE__,__LINE__,VS_VISIBLE) )
394 
396 #define THROWWARNING(retval) ( getGlobalMessageHandler( )->throwWarning((retval),0,__FUNCTION__,__FILE__,__LINE__,VS_VISIBLE) )
397 
399 #define THROWINFO(retval) ( getGlobalMessageHandler( )->throwInfo((retval),0,__FUNCTION__,__FILE__,__LINE__,VS_VISIBLE) )
400 
401 
406 
407 
408 #include <MessageHandling.ipp>
409 
410 #endif /* QPOASES_MESSAGEHANDLING_HPP */
411 
412 
413 /*
414  * end of file
415  */
returnValue throwError(returnValue Enumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
VisibilityStatus getInfoVisibilityStatus() const
VisibilityStatus getErrorVisibilityStatus() const
returnValue throwInfo(returnValue Inumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
Allows to pass back messages to the calling function.
VisibilityStatus getWarningVisibilityStatus() const
void setOutputFile(myFILE *_outputFile)
returnValue throwWarning(returnValue Wnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
void setInfoVisibilityStatus(VisibilityStatus _infoVisibility)
returnValue setErrorCount(int _errorCount)
Handles all kind of error messages, warnings and other information.
Data structure for entries in returnValueList.
int getErrorCount() const
void rhs(const real_t *x, real_t *f)
static const char * getErrorString(int error)
void setErrorVisibilityStatus(VisibilityStatus _errorVisibility)
myFILE * getOutputFile() const
returnValue throwMessage(returnValue RETnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus, const char *RETstring)
void setWarningVisibilityStatus(VisibilityStatus _warningVisibility)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:53