CARMA C++
SharedMemoryException.h File Reference

Exception class for Shared Memory errors specific to BIMA Adapted from ErrorException. More...

#include <string>
#include <iosfwd>
#include "carma/util/BaseException.h"

Go to the source code of this file.

Classes

class  carma::antenna::bima::SharedMemoryException
 Exception class for errors The exception comes with a text string that can be printed or logged. More...
 

Namespaces

module  carma
 IDL for bima Rx Control, inherits from antenna::common::RxControl.
 

Detailed Description

Exception class for Shared Memory errors specific to BIMA Adapted from ErrorException.

Author
: Colby Gutierrez-Kraybill Original: 08 Oct, 2002 Based on ErrorException.h by Steve Scott which is based on Error.h by Brian Glendenning and BaseException.h by N. S. Amarnath

This class allocates memory to form the final message and is therefore subject to the hazard of running out of resources. If this happens, with a new exception being thrown in the constructor of an exception, then the result is an uncaught exception. You are advised to use carma::util::BaseException if a safer exception is desired.

We use some tricks to ensure that the file name and line number of the location where the exception is created is captured by the exception handler. The actual constructor uses three parameters, but most common use will be via the CARMA_ERROR macro, defined at the end of this file. This macro uses only a single parameter thus allowing it to get the filename and line number at compile time.
The full error message that is created always has the file and line number preceeding the user supplied message.

Todo:
The setMessage() methods inherited from BaseException will not work properly with this class (if stack data is used it will disappear when the exception is thrown).

$CarmaCopyright$

Definition in file SharedMemoryException.h.