exception.h
Go to the documentation of this file.
1 
10 #pragma once
13 
18 #define INTEROP_THROW(EXCEPTION, MESSAGE) \
19  throw EXCEPTION ( static_cast<std::ostringstream&>(std::ostringstream().flush() << MESSAGE << "\n" << __FILE__<< "::" \
20  << __FUNCTION__<< " (" << __LINE__ << ")" ).str())
21 
24 #define INTEROP_BOUNDS_CHECK(VALUE, RANGE, MESSAGE) \
25  if((VALUE) >= (RANGE)) throw illumina::interop::model::index_out_of_bounds_exception ( \
26  static_cast<std::ostringstream&>(std::ostringstream().flush() << MESSAGE << " - " << VALUE << " >= " << RANGE << "\n" << __FILE__ << "::" \
27  << __FUNCTION__<< " (" << __LINE__ << ")" ).str())
28 
31 #define INTEROP_RANGE_CHECK(VALUE, RANGE, EXCEPTION, MESSAGE) \
32  if((VALUE) >= (RANGE)) throw EXCEPTION ( \
33  static_cast<std::ostringstream&>(std::ostringstream().flush() << MESSAGE << " - " << VALUE << " >= " << RANGE << "\n" << __FILE__ << "::" \
34  << __FUNCTION__<< " (" << __LINE__ << ")" ).str())
35 
38 #define INTEROP_RANGE_CHECK_GT(VALUE, RANGE, EXCEPTION, MESSAGE) \
39  if((VALUE) > (RANGE)) throw EXCEPTION ( \
40  static_cast<std::ostringstream&>(std::ostringstream().flush() << MESSAGE << " - " << VALUE << " > " << RANGE << "\n" << __FILE__ << "::" \
41  << __FUNCTION__<< " (" << __LINE__ << ")" ).str())
42 
43 
46 #define INTEROP_RANGE_CHECK_NE(VALUE, RANGE, EXCEPTION, MESSAGE) \
47  if((VALUE) > (RANGE)) throw EXCEPTION ( \
48  static_cast<std::ostringstream&>(std::ostringstream().flush() << MESSAGE << " - " << VALUE << " != " << RANGE << "\n" << __FILE__ << "::" \
49  << __FUNCTION__<< " (" << __LINE__ << ")" ).str())
50