36 #include <MessageHandling.hpp> 91 {
RET_QP_NOT_SOLVED,
"Problems occured while solving QP with standard solver", VS_VISIBLE },
133 {
RET_LI_RESOLVED,
"Linear independence of active contraint matrix successfully resolved", VS_VISIBLE },
134 {
RET_ENSURELI_FAILED,
"Failed to ensure linear indepence of active contraint matrix", VS_VISIBLE },
153 {
RET_NO_SOLUTION,
"QP solution does not satisfy KKT optimality conditions", VS_VISIBLE },
183 outputFile( _outputFile ),
195 errorVisibility( _errorVisibility ),
196 warningVisibility( _warningVisibility ),
197 infoVisibility( _infoVisibility ),
211 errorVisibility( _errorVisibility ),
212 warningVisibility( _warningVisibility ),
213 infoVisibility( _infoVisibility ),
214 outputFile( _outputFile ),
269 const char* additionaltext,
270 const char* functionname,
271 const char* filename,
272 const unsigned long linenumber,
282 return throwMessage( Enumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"ERROR" );
293 const char* additionaltext,
294 const char* functionname,
295 const char* filename,
296 const unsigned long linenumber,
306 return throwMessage( Wnumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"WARNING" );
317 const char* additionaltext,
318 const char* functionname,
319 const char* filename,
320 const unsigned long linenumber,
330 return throwMessage( Inumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"INFO" );
359 char myPrintfString[160];
364 sprintf( myPrintfString,
" %d - %s \n",keypos,returnValueList[keypos].data );
388 const char* additionaltext,
389 const char* functionname,
390 const char* filename,
391 const unsigned long linenumber,
393 const char* RETstring
399 char myPrintfString[160];
402 char whitespaces[41];
405 if ( numberOfWhitespaces < 0 )
406 numberOfWhitespaces = 0;
408 if ( numberOfWhitespaces > 40 )
409 numberOfWhitespaces = 40;
411 for( i=0; i<numberOfWhitespaces; ++i )
412 whitespaces[i] =
' ';
413 whitespaces[numberOfWhitespaces] =
'\0';
418 if ( returnValueList[keypos].key == RETnumber )
431 if ( ( returnValueList[keypos].globalVisibilityStatus ==
VS_VISIBLE ) && ( localVisibilityStatus ==
VS_VISIBLE ) )
435 sprintf( myPrintfString,
"%s->", whitespaces );
439 if ( additionaltext == 0 )
441 sprintf( myPrintfString,
"%s (%s, %s:%d): \t%s\n",
442 RETstring,functionname,filename,(
int)linenumber,returnValueList[keypos].data
448 sprintf( myPrintfString,
"%s (%s, %s:%d): \t%s %s\n",
449 RETstring,functionname,filename,(
int)linenumber,returnValueList[keypos].data,additionaltext
455 if ( RETstring[0] ==
'E' )
477 const char* additionaltext,
478 const char* functionname,
479 const char* filename,
480 const unsigned long linenumber,
482 const char* RETstring
488 if ( additionaltext == 0 ) i++;
489 if ( functionname == 0 ) i++;
490 if ( filename == 0 ) i++;
491 if ( linenumber == 0 ) i++;
492 if ( localVisibilityStatus ==
VS_VISIBLE ) i++;
493 if ( RETstring == 0 ) i++;
522 return returnValueList[ error ].
data;
VisibilityStatus infoVisibility
returnValue throwError(returnValue Enumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
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.
Data structure for entries in global message list.
void setOutputFile(myFILE *_outputFile)
returnValue throwWarning(returnValue Wnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue myPrintf(const char *s)
VisibilityStatus warningVisibility
MessageHandling & operator=(const MessageHandling &rhs)
MessageHandling globalMessageHandler(myStderr, VS_VISIBLE, VS_VISIBLE, VS_VISIBLE)
void setInfoVisibilityStatus(VisibilityStatus _infoVisibility)
returnValue setErrorCount(int _errorCount)
Handles all kind of error messages, warnings and other information.
returnValue listAllMessages()
MessageHandling::ReturnValueList returnValueList[]
VisibilityStatus errorVisibility
void rhs(const real_t *x, real_t *f)
static const char * getErrorString(int error)
void setErrorVisibilityStatus(VisibilityStatus _errorVisibility)
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)
MessageHandling * getGlobalMessageHandler()