idaeim studio
 Utility

Exception Class Reference

An Exception thrown by classes in the idaeim namespace. More...

#include <Exception.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)
 Creates an Exception containing a message.
void message (const std::string &message)
 Sets a new message string.
std::string message () const throw ()
 Gets the user-provided caller_ID and message string.
const char * what () const throw ()
 Gets a C-string describing what produced the Exception.
virtual ~Exception () throw ()

Static Public Attributes

static const char *const ID
 Class identification name with source code version and date.


Detailed Description

An Exception thrown by classes in the idaeim namespace.

This class is the root of of the idaeim hierarchy of classes used to signal types of Exceptions:

Error
Associated with an unrecoverable error condition.

Invalid_Argument [std::invalid_argument]
An invalid or otherwise unrecognized argument value from which no recovery is available.
IO_Failure [std::ios_base::failure]
A failure condition occured in an iostream.
Out_of_Range [std::out_of_range]
A value is outside of the acceptable range.

Each idaeim module is expected to provide a set of one or more exception subclasses that more specifically identify exception occurances within the module.

For all Exceptions a message string is provided 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.

Author:
Bradford Castalia
Version:
1.7

Constructor & Destructor Documentation

Exception ( const std::string &  message = "",
const char *  caller_ID = NULL 
) [explicit]

Creates an Exception containing a message.

If the message ends with a new-line character ('\n'), it is removed (but only one is removed). If a caller_ID is provided, it preceeds the message string separated by a new-line character.

Parameters:
message The message string.
caller_ID An optional C-string (NULL terminated char*) identifying the source of the Exception.

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


Member Function Documentation

const char * what (  )  const throw ()

Gets a C-string describing what produced the Exception.

Returns:
The C-string (NULL terminated char*) that includes the Exception ID as the first line followed by the caller_ID and message string.

std::string message (  )  const throw ()

Gets the user-provided caller_ID and message string.

Returns:
The message string. The caller_ID followed by the user message.

References Exception::ID.

void message ( const std::string &  message  ) 

Sets a new message string.

If the message ends with a new-line character ('\n'), it is removed (but only one is removed). If a caller_ID was provided when the Exception was created it remains; the new message is appended in place of the previous message.

Parameters:
message A string to replace the previous message.


Member Data Documentation

const char *const ID [static]

Initial value:

        "idaeim::Exception (1.8 2009/07/12 04:41:35)"
Class identification name with source code version and date.

Referenced by Exception::message().


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

Generated on Mon Oct 12 19:59:40 2009 for Utility by  doxygen 1.5.8