cRuntimeError Class Reference¶
|
API
|
Public Member Functions | |
| cRuntimeError (ErrorCodeInt errcode,...) | |
| cRuntimeError (const char *msg,...) | |
| cRuntimeError (const cObject *where, ErrorCodeInt errcode,...) | |
| cRuntimeError (const cObject *where, const char *msg,...) | |
| cRuntimeError (const std::exception &e, const char *location) | |
| cRuntimeError (const cRuntimeError &e) | |
| virtual cRuntimeError * | dup () const override |
| Public Member Functions inherited from cException | |
| cException (ErrorCodeInt errcode,...) | |
| cException (const char *msg,...) | |
| cException (const cObject *where, ErrorCodeInt errcode,...) | |
| cException (const cObject *where, const char *msg,...) | |
| cException (const cException &)=default | |
| virtual | ~cException () throw () |
| virtual void | setMessage (const char *txt) |
| virtual void | prependMessage (const char *fmt,...) |
| virtual void | appendMessage (const char *fmt,...) |
| virtual bool | isError () const |
| virtual int | getErrorCode () const |
| virtual const char * | what () const override throw () |
| virtual std::string | getFormattedMessage () const |
| virtual int | getSimulationStage () const |
| virtual eventnumber_t | getEventNumber () const |
| virtual simtime_t | getSimtime () const |
| virtual bool | hasContext () const |
| virtual const char * | getContextClassName () const |
| virtual const char * | getContextFullPath () const |
| virtual int | getContextComponentId () const |
| virtual int | getContextComponentKind () const |
Additional Inherited Members | |
| Protected Member Functions inherited from cException | |
| void | init (const cObject *obj, ErrorCode errorcode, const std::string &msg) |
Description
Thrown when the simulation kernel or other components detect a runtime error.
For example, cSimpleModule::scheduleAt() throws this exception when the specified simulation time is in the past, or the message pointer is nullptr.
Constructor & Destructor Documentation
◆ cRuntimeError() [1/6]
| cRuntimeError | ( | ErrorCodeInt | errcode, |
| ... ) |
Error is identified by an error code, and the message comes from a string table. The error string may expect printf-like arguments (s, d) which also have to be passed to the constructor.
Referenced by cRuntimeError(), cRuntimeError(), cRuntimeError(), cRuntimeError(), and dup().
◆ cRuntimeError() [2/6]
| cRuntimeError | ( | const char * | msg, |
| ... ) |
To be called like printf(). The error code is set to E_CUSTOM.
References cRuntimeError().
◆ cRuntimeError() [3/6]
| cRuntimeError | ( | const cObject * | where, |
| ErrorCodeInt | errcode, | ||
| ... ) |
Error is identified by an error code, and the message comes from a string table. The error string may expect printf-like arguments (s, d) which also have to be passed to the constructor. The 1st arg is the object where the error occurred: its class and object name will be prepended to the message like this: "(cArray)arr".
References cRuntimeError().
◆ cRuntimeError() [4/6]
| cRuntimeError | ( | const cObject * | where, |
| const char * | msg, | ||
| ... ) |
To be called like printf(). The error code is set to E_CUSTOM. The 1st arg is the object where the error occurred: its class and object name will be prepended to the message like this: "(cArray)arr".
References cRuntimeError(), and cException::init().
◆ cRuntimeError() [5/6]
| cRuntimeError | ( | const std::exception & | e, |
| const char * | location ) |
Constructor for re-throwing an exception with location info.
◆ cRuntimeError() [6/6]
|
inline |
Copy constructor. We unfortunately need to copy exception objects when handing them back from an activity() method.
References cRuntimeError().
Member Function Documentation
◆ dup()
|
inlineoverridevirtual |
Creates and returns an exact copy of this object. We unfortunately need to copy exception objects when handing them back from an activity() method.
Reimplemented from cException.
References cRuntimeError().
Generated on for API by