HiRISE
 libHiRISE

Public Member Functions | Static Public Attributes

Exception Class Reference

An exception thrown by UA::HiRISE classes. More...

#include <Exceptions.hh>

Inheritance diagram for Exception:
Inheritance graph
[legend]
Collaboration diagram for Exception:
Collaboration graph
[legend]

List of all members.

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.2 2009/11/03 20:05:42)"
 Class identification name with source code version and date.

Detailed Description

An exception thrown by UA::HiRISE classes.

This class is at the root of a hierarchy of classes used to signal exceptions:

Error
An unrecoverable error condition.
Invalid_Argument [std::invalid_argument]
An invalid or otherwise unrecognized argument value from which no recovery is possible.
Out_of_Range [std::out_of_range]
A value is outside the acceptable 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.

Author:
Bradford Castalia, Christian Schaller - UA/PIRL
Version:
2.3

Constructor & Destructor Documentation

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.

Parameters:
messageThe message string. Default: ""
caller_idAn optional C-string identifying the source of the Exception. Default: NULL

References ID.

virtual ~Exception (  ) throw () [inline, virtual]

Member Function Documentation

const char * what (  ) const throw ()

Gets a C-string that describes the condition that created the Exception.

Returns:
The C-string that includes the Exception ID as the first followed by the caller_id and the message string.
std::string message (  ) const throw ()

Gets the user-provided called_id (if any) and message string.

Returns:
The message string, which is the caller_id followed by the user message.

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.

Parameters:
new_messageA string to replace the previous message.

Member Data Documentation

const char *const ID = "UA::HiRISE::Exception (2.2 2009/11/03 20:05:42)" [static]

Class identification name with source code version and date.

Referenced by Exception::message().


The documentation for this class was generated from the following files: