Classes | Defines | Enumerations | Functions
acado_message_handling.hpp File Reference
#include <acado/utils/acado_namespace_macros.hpp>
#include <acado/utils/acado_types.hpp>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
Include dependency graph for acado_message_handling.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Logger
 A very simple logging class. More...

Defines

#define __FILE__   0
#define __FUNCTION__   0
#define __LINE__   0
#define ACADO_TRY(X)   for(returnValue ACADO_R = X; !ACADO_R;) return ACADO_R
#define ACADOERROR(retval)   returnValue("Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_ERROR, retval)
#define ACADOERRORTEXT(retval, text)   returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_ERROR, retval)
#define ACADOFATAL(retval)   returnValue("Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_FATAL, retval)
#define ACADOFATALTEXT(retval, text)   returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_FATAL, retval)
#define ACADOINFO(retval)   returnValue("", LVL_INFO, retval)
#define ACADOINFOTEXT(retval, text)   returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_INFO, retval)
#define ACADOWARNING(retval)   returnValue("Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_WARNING, retval)
#define ACADOWARNINGTEXT(retval, text)   returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_WARNING, retval)
#define COL_DEBUG   "\033[1;34m"
#define COL_ERROR   "\033[1;31m"
#define COL_FATAL   "\033[0;31m"
#define COL_INFO   "\033[0m"
#define COL_WARNING   "\033[1;33m"
#define LOG(level)
 Just define a handy macro for getting the logger.
#define QUOTE(x)   QUOTE_(x)
#define QUOTE_(x)   #x

Enumerations

enum  returnValueStatus { STATUS_UNHANDLED, STATUS_HANDLED }
enum  VisibilityStatus {
  VS_VISIBLE, VS_HIDDEN, VS_VISIBLE, VS_HIDDEN,
  VS_VISIBLE, VS_HIDDEN, VS_HIDDEN, VS_VISIBLE
}

Functions

const char * returnValueLevelToString (returnValueLevel level)
const char * returnValueTypeToString (returnValueType type)

Define Documentation

#define __FILE__   0

Definition at line 89 of file acado_message_handling.hpp.

#define __FUNCTION__   0

Definition at line 85 of file acado_message_handling.hpp.

#define __LINE__   0

Definition at line 93 of file acado_message_handling.hpp.

#define ACADO_TRY (   X)    for(returnValue ACADO_R = X; !ACADO_R;) return ACADO_R

Executes the statement X and handles returned message. This is the default message handler. Statement X must return type returnValue. If message is not equal to SUCCESSFUL_RETURN a message is added informing where and what this statement is and imediately returned. Example: ACADO_TRY( func() ); Example 2, extended use: ADACO_TRY( func() ).addMessage( "func() failed" );

Definition at line 139 of file acado_message_handling.hpp.

#define ACADOERROR (   retval)    returnValue("Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_ERROR, retval)

Macro to return a error

Definition at line 101 of file acado_message_handling.hpp.

#define ACADOERRORTEXT (   retval,
  text 
)    returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_ERROR, retval)

Macro to return a error, with user message

Definition at line 105 of file acado_message_handling.hpp.

#define ACADOFATAL (   retval)    returnValue("Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_FATAL, retval)

Macro to return a fatal error

Definition at line 109 of file acado_message_handling.hpp.

#define ACADOFATALTEXT (   retval,
  text 
)    returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_FATAL, retval)

Macro to return a fatal error, with user message

Definition at line 113 of file acado_message_handling.hpp.

#define ACADOINFO (   retval)    returnValue("", LVL_INFO, retval)

Macro to return a information

Definition at line 125 of file acado_message_handling.hpp.

#define ACADOINFOTEXT (   retval,
  text 
)    returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_INFO, retval)

Macro to return a information, with user message

Definition at line 129 of file acado_message_handling.hpp.

#define ACADOWARNING (   retval)    returnValue("Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_WARNING, retval)

Macro to return a warning

Definition at line 117 of file acado_message_handling.hpp.

#define ACADOWARNINGTEXT (   retval,
  text 
)    returnValue("Message: "#text"\n Code: ("#retval") \n File: " __FILE__ "\n Line: " QUOTE(__LINE__), LVL_WARNING, retval)

Macro to return a warning, with user message

Definition at line 121 of file acado_message_handling.hpp.

#define COL_DEBUG   "\033[1;34m"

Colored/formatted terminal output

Definition at line 55 of file acado_message_handling.hpp.

#define COL_ERROR   "\033[1;31m"

Definition at line 57 of file acado_message_handling.hpp.

#define COL_FATAL   "\033[0;31m"

Definition at line 56 of file acado_message_handling.hpp.

#define COL_INFO   "\033[0m"

Definition at line 59 of file acado_message_handling.hpp.

#define COL_WARNING   "\033[1;33m"

Definition at line 58 of file acado_message_handling.hpp.

#define LOG (   level)
Value:
if (level < Logger::instance().getLogLevel()); \
                else Logger::instance().get( level )

Just define a handy macro for getting the logger.

Definition at line 188 of file acado_message_handling.hpp.

#define QUOTE (   x)    QUOTE_(x)

Definition at line 98 of file acado_message_handling.hpp.

#define QUOTE_ (   x)    #x

Macro to quote macro values as strings, e.g. __LINE__ number to string, used in other macros

Definition at line 97 of file acado_message_handling.hpp.


Enumeration Type Documentation

Defines whether user has handled the returned value

Enumerator:
STATUS_UNHANDLED 

returnValue was not yet handled by user

STATUS_HANDLED 

returnValue was handled by user

Definition at line 72 of file acado_message_handling.hpp.

Defines visibility status of a message.

Enumerator:
VS_VISIBLE 

Message visible.

VS_HIDDEN 

Message not visible.

VS_VISIBLE 

Message visible.

VS_HIDDEN 

Message not visible.

VS_VISIBLE 

Message visible.

VS_HIDDEN 

Message not visible.

VS_HIDDEN 

Message not visible.

VS_VISIBLE 

Message visible.

Definition at line 46 of file acado_message_handling.hpp.


Function Documentation

Converts returnValueLevel enum type to a const char*

Definition at line 362 of file acado_message_handling.cpp.

Converts returnValueType enum type to a const char*

Definition at line 386 of file acado_message_handling.cpp.



acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:19