libHiRISE
|
An exception thrown by UA::HiRISE classes. More...
#include <Exceptions.hh>
Public Member Functions | |
Exception (const std::string &message="", const char *caller_id=NULL) | |
Constructs an Exception with a message. | |
virtual | ~Exception () throw () |
const char * | what () const throw () |
Gets a C-string that describes the condition that created the Exception. | |
std::string | message () const throw () |
Gets the user-provided called_id (if any) and message string. | |
void | message (const std::string &new_message) |
Sets the message string. | |
Static Public Attributes | |
static const char *const | ID = "UA::HiRISE::Exception (2.3 2020/02/14 00:58:12)" |
Class identification name with source code version and date. |
An exception thrown by UA::HiRISE classes.
This class is at the root of a hierarchy of classes used to signal exceptions:
Error
Invalid_Argument
[std::invalid_argument
] Out_of_Range
[std::out_of_range
] An Exception has a message string that describes the reason for the exception. The message
method will return this message, while the what
method will prepend the Exception class ID to the message and return that.
Exception | ( | const std::string & | message = "" , |
const char * | caller_id = NULL |
||
) | [explicit] |
Constructs an Exception with a message.
If the message ends with a newline character ('
'), it is removed. If a caller_id is provided, it preceeds the message string separated by a newline character.
message | The message string. Default: "" |
caller_id | An optional C-string identifying the source of the Exception. Default: NULL |
References ID.
virtual ~Exception | ( | ) | throw () [inline, virtual] |
const char * what | ( | ) | const throw () |
std::string message | ( | ) | const throw () |
Gets the user-provided called_id (if any) and message string.
References Exception::ID.
void message | ( | const std::string & | new_message ) |
Sets the message string.
If the message ends with a newline character ('
'), it is removed. If a caller_id was provided when the Exception was created it remains; the new message is substituted in place of the previous message.
new_message | A string to replace the previous message. |
const char *const ID = "UA::HiRISE::Exception (2.3 2020/02/14 00:58:12)" [static] |
Class identification name with source code version and date.
Referenced by Exception::message().