KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs | Functions
l_exception.h File Reference

Support for error handling exception classes in libKJB. More...

#include <l/l_sys_err.h>
#include <l/l_sys_str.h>
#include <l/l_string.h>
#include <boost/preprocessor/seq.hpp>
#include <exception>
#include <string>
#include <iosfwd>

Go to the source code of this file.

Classes

class  kjb::Exception
 Base class of all exceptions in the jwsc++ library. More...
 
class  kjb::KJB_error
 Exception often thrown when wrapped C functions return error codes. More...
 
class  kjb::Not_implemented
 Object thrown when attempting to use unimplemented functionality. More...
 
class  kjb::Runtime_error
 Object thrown when computation fails somehow during execution. More...
 
class  kjb::Cant_happen
 Object thrown when the program does something thought impossible. More...
 
class  kjb::Illegal_argument
 Object thrown when an argument to a function is not acceptable. More...
 
class  kjb::Index_out_of_bounds
 Object thrown when an index argument exceeds the size of a container. More...
 
class  kjb::Dimension_mismatch
 Object thrown when an argument is of the wrong size or dimensions. More...
 
class  kjb::Divide_by_zero
 Object thrown when an division is attempted with a zero divisor. More...
 
class  kjb::Serialization_error
 Object thrown when serialization or deserialization fails. More...
 
class  kjb::IO_error
 Object thrown when input or output fails. More...
 
class  kjb::Result_error
 Object thrown when a function cannot generate a valid result. More...
 
class  kjb::Missing_dependency
 Object thrown when a program lacks required resources or libraries. More...
 
class  kjb::Option_exception
 Object thrown for exceptions related to command-line options. More...
 
class  kjb::Missing_option
 Object thrown when an obligatory command-line option is absent. More...
 
class  kjb::Stack_overflow
 Object thrown if a finite size stack is full and pushed farther. More...
 
class  kjb::Stack_underflow
 Object thrown if stack is empty and popped. More...
 
class  kjb::Resource_exhaustion
 Object thrown if a resource allocation failed (memory, fp, etc.) More...
 

Namespaces

 kjb
 Classes and functions for dealing with trajectory files.
 

Macros

#define KJB_THROW(ex)   throw ex(__FILE__, __LINE__)
 
#define KJB_THROW_2(ex, msg)   throw ex(msg, __FILE__, __LINE__)
 
#define KJB_THROW_3(ex, fmt, params)
 
#define ETX(a)
 
#define ETX_2(a, msg)
 
#define NTX(a)
 
#define IFT(a, ex, msg)
 
#define IFTD(a, ex, msg, params)
 

Typedefs

typedef Cant_happen kjb::Cant_happen_exception
 

Functions

std::string kjb::kjb_get_error ()
 similar to kjb_c::kjb_get_error(), but this returns std::string. More...
 
void kjb::throw_kjb_error (const char *msg, const char *file, unsigned line)
 

Detailed Description

Support for error handling exception classes in libKJB.

Author
Kobus Barnard
Joseph Schlect
Kyle Simek
Luca Del Pero
Andrew Predoehl

Macro Definition Documentation

#define ETX (   a)
Value:
do \
{ \
if (a) \
{ \
kjb::throw_kjb_error( "", __FILE__, __LINE__ ); \
} \
} \
if(ss(2)==3) grayIm
void throw_kjb_error(const char *msg, const char *file, unsigned line)
Definition: l_exception.cpp:748
while(1)
Definition: splitter.cc:797
#define ETX_2 (   a,
  msg 
)
Value:
do \
{ \
if (a) \
{ \
kjb::throw_kjb_error(msg, __FILE__, __LINE__); \
} \
} \
if(ss(2)==3) grayIm
void throw_kjb_error(const char *msg, const char *file, unsigned line)
Definition: l_exception.cpp:748
while(1)
Definition: splitter.cc:797
#define IFT (   a,
  ex,
  msg 
)
Value:
do \
{ \
if(!(a)) \
{ \
KJB_THROW_2(ex, msg); \
} \
} \
while(0) \
if(ss(2)==3) grayIm
#define KJB_THROW_2(ex, msg)
Definition: l_exception.h:48
while(1)
Definition: splitter.cc:797
#define IFTD (   a,
  ex,
  msg,
  params 
)
Value:
do \
{ \
if(!(a)) \
{ \
KJB_THROW_3(ex, msg, params); \
} \
} \
while(0) \
if(ss(2)==3) grayIm
#define KJB_THROW_3(ex, fmt, params)
Definition: l_exception.h:56
while(1)
Definition: splitter.cc:797
#define KJB_THROW (   ex)    throw ex(__FILE__, __LINE__)
#define KJB_THROW_2 (   ex,
  msg 
)    throw ex(msg, __FILE__, __LINE__)
#define KJB_THROW_3 (   ex,
  fmt,
  params 
)
Value:
do \
{ \
char buffer[ERROR_MESS_BUFF_SIZE]; \
kjb_c::kjb_sprintf(buffer, ERROR_MESS_BUFF_SIZE, fmt, \
BOOST_PP_SEQ_ENUM(params)); \
throw ex(buffer, __FILE__, __LINE__); \
} \
while(1)
Definition: splitter.cc:797
#define NTX (   a)
Value:
do \
{ \
if ((a) == NULL) \
{ \
kjb::throw_kjb_error( "Null result", \
__FILE__, __LINE__ ); \
} \
} \
if(ss(2)==3) grayIm
void throw_kjb_error(const char *msg, const char *file, unsigned line)
Definition: l_exception.cpp:748
while(1)
Definition: splitter.cc:797