lsst.pex.exceptions  8.0.0.0-23-g68b96ed
Classes | Namespaces | Defines | Typedefs | Functions
include/lsst/pex/exceptions/Exception.h File Reference
#include <exception>
#include <ostream>
#include <string>
#include <vector>
#include "boost/current_function.hpp"

Go to the source code of this file.

Classes

struct  lsst::pex::exceptions::Tracepoint
 One point in the Traceback vector held by Exception. More...
class  lsst::pex::exceptions::Exception

Namespaces

namespace  lsst
namespace  lsst::pex
namespace  lsst::pex::exceptions

Defines

#define LSST_EXCEPT_HERE   __FILE__, __LINE__, BOOST_CURRENT_FUNCTION
#define LSST_EXCEPT(type,...)   type(LSST_EXCEPT_HERE, __VA_ARGS__)
#define LSST_EXCEPT_ADD(e, m)   e.addMessage(LSST_EXCEPT_HERE, m)
#define LSST_EARGS_TYPED
#define LSST_EARGS_UNTYPED   ex_file, ex_line, ex_func, ex_message
#define LSST_EXCEPTION_TYPE(t, b, c)

Typedefs

typedef std::vector< Tracepoint > lsst::pex::exceptions::Traceback

Functions

std::ostream & lsst::pex::exceptions::operator<< (std::ostream &stream, Exception const &e)

Define Documentation

Value:
char const* ex_file, int ex_line, char const* ex_func, \
    std::string const& ex_message

The initial arguments required for new exception subclasses.

#define LSST_EARGS_UNTYPED   ex_file, ex_line, ex_func, ex_message

The initial arguments to the base class constructor for new subclasses.

#define LSST_EXCEPT (   type,
  ... 
)    type(LSST_EXCEPT_HERE, __VA_ARGS__)

Create an exception with a given type and message and optionally other arguments (dependent on the type).

Parameters:
[in]typeC++ type of the exception to be thrown.
#define LSST_EXCEPT_ADD (   e,
 
)    e.addMessage(LSST_EXCEPT_HERE, m)

Add the current location and a message to an existing exception before rethrowing it.

#define LSST_EXCEPT_HERE   __FILE__, __LINE__, BOOST_CURRENT_FUNCTION

For internal use; gathers the file, line, and function for a tracepoint.

#define LSST_EXCEPTION_TYPE (   t,
  b,
 
)
Value:
class t : public b { \
    public: \
        t(LSST_EARGS_TYPED) : b(LSST_EARGS_UNTYPED) { }; \
        t(std::string const & message) : b(message) { }; \
        virtual char const* getType(void) const throw() { return #c " *"; }; \
        virtual lsst::pex::exceptions::Exception* clone(void) const { \
            return new t(*this); \
        }; \
    };

Macro used to define new types of exceptions without additional data.

Parameters:
[in]tType of the exception.
[in]bBase class of the exception.
[in]cC++ class of the exception (fully specified).
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines