Handling of OpenVSP ErrorObj information is accomplished through this group of API functions. Click here to return to the main page. More...
Classes | |
| class | vsp::ErrorObj |
| class | vsp::ErrorMgrSingleton |
Functions | |
| ERROR_CODE | vsp::ErrorObj::GetErrorCode () |
| string | vsp::ErrorObj::GetErrorString () |
| bool | vsp::ErrorMgrSingleton::GetErrorLastCallFlag () |
| int | vsp::ErrorMgrSingleton::GetNumTotalErrors () |
| ErrorObj | vsp::ErrorMgrSingleton::PopLastError () |
| ErrorObj | vsp::ErrorMgrSingleton::GetLastError () |
| void | vsp::ErrorMgrSingleton::SilenceErrors () |
| void | vsp::ErrorMgrSingleton::PrintOnErrors () |
| static ErrorMgrSingleton & | vsp::ErrorMgrSingleton::getInstance () |
| class vsp::ErrorObj |
ErrorObj is defined by an error code enum and associated error string.
Definition at line 38 of file APIErrorMgr.h.
Public Member Functions | |
|---|---|
| ErrorObj (ERROR_CODE err_code, const string &err_str) | |
| ErrorObj (const ErrorObj &from) | |
| ERROR_CODE | GetErrorCode () |
| string | GetErrorString () |
| void | NoError () |
Public Attributes | |
| ERROR_CODE | m_ErrorCode |
| string | m_ErrorString |
|
inline |
Definition at line 57 of file APIErrorMgr.h.
|
inline |
Definition at line 166 of file APIErrorMgr.h.
| ERROR_CODE vsp::ErrorObj::m_ErrorCode |
Definition at line 159 of file APIErrorMgr.h.
| string vsp::ErrorObj::m_ErrorString |
Definition at line 160 of file APIErrorMgr.h.
| class vsp::ErrorMgrSingleton |
ErrorMgrSingleton is the queue that API errors are reported through. An API function that fails pushes an ErrorObj onto it and returns a default value rather than throwing, so a script that does not check anything keeps running. Reach it with ErrorMgrSingleton.getInstance(), then use GetNumTotalErrors and PopLastError to find out what went wrong.
Definition at line 184 of file APIErrorMgr.h.
Public Member Functions | |
|---|---|
| bool | GetErrorLastCallFlag () |
| int | GetNumTotalErrors () |
| ErrorObj | PopLastError () |
| ErrorObj | GetLastError () |
| bool | PopErrorAndPrint (FILE *stream) |
| void | SilenceErrors () |
| void | PrintOnErrors () |
| void | AddError (ERROR_CODE code, const string &desc) |
| void | NoError () |
| virtual void | MessageCallback (const MessageBase *from, const MessageData &data) |
Static Public Member Functions | |
| static ErrorMgrSingleton & | getInstance () |
Private Member Functions | |
| ErrorMgrSingleton (ErrorMgrSingleton const ©)=delete | |
| ErrorMgrSingleton & | operator= (ErrorMgrSingleton const ©)=delete |
Private Attributes | |
| bool | m_PrintErrors |
| bool | m_ErrorLastCallFlag |
| stack< ErrorObj > | m_ErrorStack |
|
private |
Definition at line 524 of file APIErrorMgr.h.
|
private |
Definition at line 525 of file APIErrorMgr.h.
|
private |
Definition at line 523 of file APIErrorMgr.h.
|
inline |
Get the ERROR_CODE enum of the last raised error
Definition at line 107 of file APIErrorMgr.h.
| bool vsp::ErrorMgrSingleton::GetErrorLastCallFlag | ( | ) |
Check if there was an error on the last call to the API
|
inline |
Get the error string of the last raised error
Definition at line 153 of file APIErrorMgr.h.
|
inlinestatic |
Get the error manager. There is one queue for the whole session, and this is how a script reaches it – every other call in this group is made on the object returned here.
Definition at line 515 of file APIErrorMgr.h.
| ErrorObj vsp::ErrorMgrSingleton::GetLastError | ( | ) |
Return the most recent error from the stack (does NOT pop error off the stack)
| int vsp::ErrorMgrSingleton::GetNumTotalErrors | ( | ) |
Count the total number of errors on the stack
| ErrorObj vsp::ErrorMgrSingleton::PopLastError | ( | ) |
Pop (remove) and return the most recent error from the stack. Note, errors are printed on occurrence by default.
|
inline |
Cause errors to be printed to stdout as they occur.
Definition at line 468 of file APIErrorMgr.h.
|
inline |
Prevent errors from printing to stdout as they occur.
Definition at line 427 of file APIErrorMgr.h.