SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs
Exception.h File Reference
#include <stdexcept>
#include <boost/exception/all.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/numeric/interval.hpp>
#include <Core/Utils/share.h>

Go to the source code of this file.

Classes

struct  ExceptionBase
 
struct  NullPointerException
 
struct  OutOfRangeException
 
struct  InvalidArgumentException
 
struct  DimensionMismatch
 
struct  InvalidArgumentValue
 
struct  NotImplemented
 
struct  AssertionFailed
 

Namespaces

 SCIRun
 STL datatypes needed.
 
 SCIRun::Core
 

Macros

#define ENSURE_NOT_NULL(var, message)   if (!(var)) BOOST_THROW_EXCEPTION(SCIRun::Core::NullPointerException() << SCIRun::Core::NullObjectInfo(message))
 
#define THROW_OUT_OF_RANGE(message)   BOOST_THROW_EXCEPTION(SCIRun::Core::OutOfRangeException() << SCIRun::Core::ErrorMessage(message))
 
#define THROW_INVALID_ARGUMENT(message)   BOOST_THROW_EXCEPTION(SCIRun::Core::InvalidArgumentException() << SCIRun::Core::ErrorMessage(message))
 
#define ENSURE_DIMENSIONS_MATCH(var1, var2, message)
 
#define REPORT_INVALID_ARGUMENT_VALUE(message)
 
#define REPORT_NOT_IMPLEMENTED(message)
 
#define ASSERTMSG(condition, message)
 

Typedefs

typedef boost::error_info
< struct tag_error_message,
std::string > 
ErrorMessage
 
typedef boost::error_info
< struct tag_null_object,
std::string > 
NullObjectInfo
 
typedef boost::error_info
< struct tag_file_not_found,
std::string > 
FileNotFound
 
typedef boost::error_info
< struct
tag_linear_algebra_error,
std::string > 
LinearAlgebraErrorMessage
 
typedef boost::error_info
< struct
tag_double_out_of_range,
boost::tuple< std::string,
double,
boost::numeric::interval
< double > > > 
DoubleOutOfRangeInfo
 
typedef boost::error_info
< struct tag_int_out_of_range,
boost::tuple< std::string, int,
boost::numeric::interval< int > > > 
IntOutOfRangeInfo
 
typedef boost::error_info
< struct
tag_dimension_mismatch,
std::string > 
DimensionMismatchInfo
 
typedef boost::error_info
< struct
tag_invalid_argument_value,
std::string > 
InvalidArgumentValueInfo
 
typedef boost::error_info
< struct tag_not_implemented,
std::string > 
NotImplementedInfo
 

Macro Definition Documentation

#define ASSERTMSG (   condition,
  message 
)
Value:
if(!(condition)){ \
BOOST_THROW_EXCEPTION(SCIRun::Core::AssertionFailed() << SCIRun::Core::ErrorMessage(message)); \
}
Definition: Exception.h:111
boost::error_info< struct tag_error_message, std::string > ErrorMessage
Definition: Exception.h:52
#define ENSURE_DIMENSIONS_MATCH (   var1,
  var2,
  message 
)
Value:
if (var1 != var2) \
SCIRun::Core::DimensionMismatchInfo::value_type( \
std::string(message) )))
Definition: Exception.h:78
boost::error_info< struct tag_dimension_mismatch, std::string > DimensionMismatchInfo
Definition: Exception.h:73
#define ENSURE_NOT_NULL (   var,
  message 
)    if (!(var)) BOOST_THROW_EXCEPTION(SCIRun::Core::NullPointerException() << SCIRun::Core::NullObjectInfo(message))
#define REPORT_INVALID_ARGUMENT_VALUE (   message)
Value:
SCIRun::Core::InvalidArgumentValueInfo::value_type( \
std::string(message) )))
boost::error_info< struct tag_invalid_argument_value, std::string > InvalidArgumentValueInfo
Definition: Exception.h:74
Definition: Exception.h:82
#define REPORT_NOT_IMPLEMENTED (   message)
Value:
SCIRun::Core::NotImplementedInfo::value_type( \
std::string(message) )))
Definition: Exception.h:89
boost::error_info< struct tag_not_implemented, std::string > NotImplementedInfo
Definition: Exception.h:75
Todo:
should not need this in production code.
#define THROW_INVALID_ARGUMENT (   message)    BOOST_THROW_EXCEPTION(SCIRun::Core::InvalidArgumentException() << SCIRun::Core::ErrorMessage(message))
#define THROW_OUT_OF_RANGE (   message)    BOOST_THROW_EXCEPTION(SCIRun::Core::OutOfRangeException() << SCIRun::Core::ErrorMessage(message))