![]() |
Trading System API
3.0
Library for Simulating and Deploying Trading and Investment Strategies
|
Class tsa::exception used by most classes of the Trading System API library. The class inherits from std::exception (standard C++ library). Class tsa::exception extends std::exception by including the file and line number of the code that originated the exception in the exception message. More...
Public Member Functions | |
exception (void) | |
Constructor. | |
exception (const char *message) | |
Constructor. | |
exception (const char *message, const source_location &src_loc) | |
Constructor. Use SLOC macro as sourceLocation. | |
exception (const std::string &message, const source_location &src_loc) | |
Constructor. Use SLOC macro as sourceLocation. | |
exception (const char *origin, const char *message, const source_location &src_loc) | |
Constructor. Use SLOC macro as sourceLocation. | |
exception (const object *raisingClassPtr, const std::string &message, const source_location &sourceLocation) | |
Constructor. | |
virtual | ~exception () throw () |
Destructor. | |
void | id (identifier_t) |
Sets the exception ID. | |
std::string | line (void) const |
const std::string & | message (void) const |
const std::string & | origin (void) const |
virtual const char * | what () const throw () |
Returns the exception message. | |
Class tsa::exception used by most classes of the Trading System API library. The class inherits from std::exception (standard C++ library). Class tsa::exception extends std::exception by including the file and line number of the code that originated the exception in the exception message.
Raise an exception as follows:
If the exception is thrown by a class derived from tsa::object, then the object's 'this' pointer can be passed to the exception constructor such as:
Using the 'this' pointer in such a way allows the exception object to enhance the exception message by adding information about the throwing class.