MessageHandling.h
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-2015 by Hans Joachim Ferreau, Andreas Potschka,
6  * Christian Kirches et al. All rights reserved.
7  *
8  * qpOASES is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * qpOASES is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with qpOASES; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23 
24 
35 #ifndef QPOASES_MESSAGEHANDLING_H
36 #define QPOASES_MESSAGEHANDLING_H
37 
38 
39 #include <stdio.h>
40 #include <string.h>
41 #include <math.h>
42 
43 #ifdef __DEBUG__
44  #include <assert.h>
45 #else
46  #define assert(ignore)((void) 0);
47 #endif
48 
49 #include <qpOASES_e/Constants.h>
50 
51 
53 
54 
56 #define stdFile stderr
57 
58 
67 typedef enum
68 {
70 /* miscellaneous */
83 /* Indexlist */
90 /* SubjectTo / Bounds / Constraints */
102 /* QProblem */
199 /* SQProblem */
202 /* Utils */
207 /* Options */
209 /* SolutionAnalysis */
211 /* Benchmark */
218 /* Sparse matrices */
221 /* Dropping of infeasible constraints */
223 /* Simple exitflags */
229 } returnValue;
230 
231 
241 typedef struct
242 {
244  const char* data;
245  VisibilityStatus globalVisibilityStatus;
248 
249 
250 
261 typedef struct
262 {
263  VisibilityStatus errorVisibility;
264  VisibilityStatus warningVisibility;
265  VisibilityStatus infoVisibility;
267  FILE* outputFile;
269  int errorCount;
271 
272 
273 
276  FILE* _outputFile,
277  VisibilityStatus _errorVisibility,
278  VisibilityStatus _warningVisibility,
279  VisibilityStatus _infoVisibility
280  );
281 
283  MessageHandling* TO
284  );
285 
286 
294  returnValue Enumber,
295  const char* additionaltext,
296  const char* functionname,
297  const char* filename,
298  const unsigned long linenumber,
299  VisibilityStatus localVisibilityStatus
302  );
303 
309  returnValue Wnumber,
310  const char* additionaltext,
311  const char* functionname,
312  const char* filename,
313  const unsigned long linenumber,
314  VisibilityStatus localVisibilityStatus
317  );
318 
323  returnValue Inumber,
324  const char* additionaltext,
325  const char* functionname,
326  const char* filename,
327  const unsigned long linenumber,
328  VisibilityStatus localVisibilityStatus
331  );
332 
333 
337 
338 
342 
343 
347 
351 
355 
358 static inline FILE* MessageHandling_getOutputFile( MessageHandling* _THIS );
359 
362 static inline int MessageHandling_getErrorCount( MessageHandling* _THIS );
363 
364 
367  VisibilityStatus _errorVisibility
368  );
369 
372  VisibilityStatus _warningVisibility
373  );
374 
377  VisibilityStatus _infoVisibility
378  );
379 
381 static inline void MessageHandling_setOutputFile( MessageHandling* _THIS,
382  FILE* _outputFile
383  );
384 
389  int _errorCount
390  );
391 
395  const returnValue _returnValue
396  );
397 
398 
400  returnValue RETnumber,
401  const char* additionaltext,
402  const char* functionname,
403  const char* filename,
404  const unsigned long linenumber,
405  VisibilityStatus localVisibilityStatus,
408  const char* RETstring
409  );
410 
411 
412 #ifndef __FILE__
413 
414  #define __FILE__ 0
415 #endif
416 
417 #ifndef __LINE__
418 
419  #define __LINE__ 0
420 #endif
421 
423 /*#define __FUNC__ 0*/
424 #define __FUNC__ ("(no function name provided)")
425 /*#define __FUNC__ __func__*/
426 /*#define __FUNC__ __FUNCTION__*/
427 
428 
430 #define THROWERROR(retval) ( MessageHandling_throwError( qpOASES_getGlobalMessageHandler(),(retval),0,__FUNC__,__FILE__,__LINE__,VS_VISIBLE) )
431 
433 #define THROWWARNING(retval) ( MessageHandling_throwWarning( qpOASES_getGlobalMessageHandler(),(retval),0,__FUNC__,__FILE__,__LINE__,VS_VISIBLE) )
434 
436 #define THROWINFO(retval) ( MessageHandling_throwInfo( qpOASES_getGlobalMessageHandler(),(retval),0,__FUNC__,__FILE__,__LINE__,VS_VISIBLE) )
437 
438 
443 
444 
445 /*
446  * g e t E r r o r V i s i b i l i t y S t a t u s
447  */
449 {
450  return _THIS->errorVisibility;
451 }
452 
453 
454 /*
455  * g e t W a r n i n g V i s i b i l i t y S t a t u s
456  */
458 {
459  return _THIS->warningVisibility;
460 }
461 
462 
463 /*
464  * g e t I n f o V i s i b i l i t y S t a t u s
465  */
467 {
468  return _THIS->infoVisibility;
469 }
470 
471 
472 /*
473  * g e t O u t p u t F i l e
474  */
475 static inline FILE* MessageHandling_getOutputFile( MessageHandling* _THIS )
476 {
477  return _THIS->outputFile;
478 }
479 
480 
481 /*
482  * g e t E r r o r C o u n t
483  */
485 {
486  return _THIS->errorCount;
487 }
488 
489 
490 /*
491  * s e t E r r o r V i s i b i l i t y S t a t u s
492  */
493 static inline void MessageHandling_setErrorVisibilityStatus( MessageHandling* _THIS, VisibilityStatus _errorVisibility )
494 {
495  _THIS->errorVisibility = _errorVisibility;
496 }
497 
498 
499 /*
500  * s e t W a r n i n g V i s i b i l i t y S t a t u s
501  */
502 static inline void MessageHandling_setWarningVisibilityStatus( MessageHandling* _THIS, VisibilityStatus _warningVisibility )
503 {
504  _THIS->warningVisibility = _warningVisibility;
505 }
506 
507 
508 /*
509  * s e t I n f o V i s i b i l i t y S t a t u s
510  */
511 static inline void MessageHandling_setInfoVisibilityStatus( MessageHandling* _THIS, VisibilityStatus _infoVisibility )
512 {
513  _THIS->infoVisibility = _infoVisibility;
514 }
515 
516 
517 /*
518  * s e t O u t p u t F i l e
519  */
520 static inline void MessageHandling_setOutputFile( MessageHandling* _THIS, FILE* _outputFile )
521 {
522  _THIS->outputFile = _outputFile;
523 }
524 
525 
526 /*
527  * s e t E r r o r C o u n t
528  */
529 static inline returnValue MessageHandling_setErrorCount( MessageHandling* _THIS, int _errorCount )
530 {
531  if ( _errorCount >= 0 )
532  {
533  _THIS->errorCount = _errorCount;
534  return SUCCESSFUL_RETURN;
535  }
536  else
537  return RET_INVALID_ARGUMENTS;
538 }
539 
540 
542 
543 
544 #endif /* QPOASES_MESSAGEHANDLING_H */
545 
546 
547 /*
548  * end of file
549  */
static returnValue MessageHandling_setErrorCount(MessageHandling *_THIS, int _errorCount)
void MessageHandlingCPY(MessageHandling *FROM, MessageHandling *TO)
static void MessageHandling_setOutputFile(MessageHandling *_THIS, FILE *_outputFile)
Allows to pass back messages to the calling function.
static FILE * MessageHandling_getOutputFile(MessageHandling *_THIS)
returnValue MessageHandling_throwMessage(MessageHandling *_THIS, returnValue RETnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus, const char *RETstring)
returnValue MessageHandling_throwWarning(MessageHandling *_THIS, returnValue Wnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue MessageHandling_throwInfo(MessageHandling *_THIS, returnValue Inumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
const char * MessageHandling_getErrorCodeMessage(MessageHandling *_THIS, const returnValue _returnValue)
returnValue MessageHandling_reset(MessageHandling *_THIS)
static void MessageHandling_setInfoVisibilityStatus(MessageHandling *_THIS, VisibilityStatus _infoVisibility)
static VisibilityStatus MessageHandling_getInfoVisibilityStatus(MessageHandling *_THIS)
Handles all kind of error messages, warnings and other information.
Data structure for entries in returnValueList.
static VisibilityStatus MessageHandling_getErrorVisibilityStatus(MessageHandling *_THIS)
void MessageHandlingCON(MessageHandling *_THIS, FILE *_outputFile, VisibilityStatus _errorVisibility, VisibilityStatus _warningVisibility, VisibilityStatus _infoVisibility)
returnValue MessageHandling_throwError(MessageHandling *_THIS, returnValue Enumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
static void MessageHandling_setErrorVisibilityStatus(MessageHandling *_THIS, VisibilityStatus _errorVisibility)
static void MessageHandling_setWarningVisibilityStatus(MessageHandling *_THIS, VisibilityStatus _warningVisibility)
returnValue MessageHandling_listAllMessages(MessageHandling *_THIS)
MessageHandling * qpOASES_getGlobalMessageHandler()
static VisibilityStatus MessageHandling_getWarningVisibilityStatus(MessageHandling *_THIS)
returnValue
Defines all symbols for global return values.
static int MessageHandling_getErrorCount(MessageHandling *_THIS)


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