#include <acado/utils/acado_namespace_macros.hpp>
#include <acado/utils/acado_types.hpp>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
Go to the source code of this file.
Classes | |
class | Logger |
A very simple logging class. More... | |
Macros | |
#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. More... | |
#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, VS_HIDDEN, VS_VISIBLE, VS_HIDDEN, VS_VISIBLE } |
Functions | |
const char * | returnValueLevelToString (returnValueLevel level) |
const char * | returnValueTypeToString (returnValueType type) |
#define __FILE__ 0 |
Definition at line 94 of file acado_message_handling.hpp.
#define __FUNCTION__ 0 |
Definition at line 90 of file acado_message_handling.hpp.
#define __LINE__ 0 |
Definition at line 98 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 144 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 106 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 110 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 114 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 118 of file acado_message_handling.hpp.
#define ACADOINFO | ( | retval | ) | returnValue("", LVL_INFO, retval) |
Macro to return a information
Definition at line 130 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 134 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 122 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 126 of file acado_message_handling.hpp.
#define COL_DEBUG "\033[1;34m" |
Colored/formatted terminal output
Definition at line 60 of file acado_message_handling.hpp.
#define COL_ERROR "\033[1;31m" |
Definition at line 62 of file acado_message_handling.hpp.
#define COL_FATAL "\033[0;31m" |
Definition at line 61 of file acado_message_handling.hpp.
#define COL_INFO "\033[0m" |
Definition at line 64 of file acado_message_handling.hpp.
#define COL_WARNING "\033[1;33m" |
Definition at line 63 of file acado_message_handling.hpp.
#define LOG | ( | level | ) |
Just define a handy macro for getting the logger.
Definition at line 193 of file acado_message_handling.hpp.
#define QUOTE | ( | x | ) | QUOTE_(x) |
Definition at line 103 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 102 of file acado_message_handling.hpp.
enum returnValueStatus |
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 77 of file acado_message_handling.hpp.
enum VisibilityStatus |
Defines visibility status of a message.
Definition at line 51 of file acado_message_handling.hpp.
const char* returnValueLevelToString | ( | returnValueLevel | level | ) |
Converts returnValueLevel enum type to a const char*
Definition at line 359 of file acado_message_handling.cpp.
const char* returnValueTypeToString | ( | returnValueType | type | ) |
Converts returnValueType enum type to a const char*
Definition at line 383 of file acado_message_handling.cpp.