Namespaces | Macros | Typedefs
except.h File Reference

Basic exceptions and related helper macros. More...

#include <sstream>
#include <stdexcept>
#include <string>
#include "tclap/ArgException.h"
+ Include dependency graph for except.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 basis
 

Macros

#define _BASIS_EXCEPT_H
 
#define BASIS_THROW(type, msg)
 Throw exception with given message. More...
 

Typedefs

typedef TCLAP::ArgException basis::ArgException
 Exception thrown by command-line parsing library. More...
 
typedef TCLAP::ArgParseException basis::ArgParseException
 Exception thrown on command-line argument parsing error. More...
 
typedef TCLAP::SpecificationException basis::CmdLineException
 Exception thrown when command-line specification is wrong. More...
 
typedef TCLAP::CmdLineParseException basis::CmdLineParseException
 Exception thrown on command-line parsing error. More...
 
typedef TCLAP::ExitException basis::ExitException
 Exception thrown by command-line parsing library to indicate that program should exit with the given exit code. More...
 

Detailed Description

Basic exceptions and related helper macros.

Definition in file except.h.

Macro Definition Documentation

§ _BASIS_EXCEPT_H

#define _BASIS_EXCEPT_H

Definition at line 15 of file except.h.

§ BASIS_THROW

#define BASIS_THROW (   type,
  msg 
)
Value:
{ \
::std::ostringstream oss; \
oss << msg; \
throw type(oss.str().c_str()); \
}
cmake msg

Throw exception with given message.

Example:

void func(int i) {
if (i < 0) BASIS_THROW(std::invalid_argument, "Argument i (= " << i << ") must be positive");
}
Parameters
[in]typeThe type of the exception. Note that this exception type has to implement a constructor with one std::string as argument, the exception message.
[in]msgThe exception message. The given argument is streamed into a std::ostringstream.

Definition at line 48 of file except.h.