15 #define __FILENAME__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) 17 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) 34 vw_exception(
const char* file,
int lineNumber, std::string
const& message) noexcept;
40 const
char*
what() const noexcept override;
49 : vw_exception(file, lineNumber, message)
134 void vw_trace(
const char* filename,
int linenumber,
const char* fmt, ...);
137 #define VW_TRACE(fmt, ...) VW::vw_trace(__FILE__, __LINE__, fmt, __VA_ARGS__) 139 struct StopWatchData;
149 double MilliSeconds()
const;
153 bool launchDebugger();
155 #define THROWERRNO(args) \ 157 std::stringstream __msg; \ 159 char __errmsg[256]; \ 160 if (strerror_s(__errmsg, sizeof __errmsg, errno) != 0) \ 161 __msg << ", errno = unknown"; \ 163 __msg << ", errno = " << __errmsg; \ 164 throw VW::vw_exception(__FILENAME__, __LINE__, __msg.str()); \ 167 #define THROWERRNO(args) \ 169 std::stringstream __msg; \ 171 char __errmsg[256]; \ 172 if (strerror_r(errno, __errmsg, sizeof __errmsg) != 0) \ 173 __msg << "errno = unknown"; \ 175 __msg << "errno = " << __errmsg; \ 176 throw VW::vw_exception(__FILENAME__, __LINE__, __msg.str()); \ 181 #define THROW(args) \ 183 std::stringstream __msg; \ 185 throw VW::vw_exception(__FILENAME__, __LINE__, __msg.str()); \ 188 #define THROW_EX(ex, args) \ 190 std::stringstream __msg; \ 192 throw ex(__FILENAME__, __LINE__, __msg.str()); \ 196 #define VW_ASSERT(condition, args) \ 205 #define GET_MACRO(_1, _2, NAME, ...) NAME 208 #define THROW_OR_RETURN(...) \ 209 EXPAND(GET_MACRO(__VA_ARGS__, THROW_OR_RETURN_NORMAL, THROW_OR_RETURN_VOID, UNUSED)(__VA_ARGS__)) 213 #define THROW_OR_RETURN_NORMAL(args, retval) \ 219 #define THROW_OR_RETURN_VOID(args) \ 225 #else // VW_NOEXCEPT defined 227 #define THROW_OR_RETURN_NORMAL(args, retval) \ 230 std::stringstream __msgA; \ 232 throw VW::vw_exception(__FILE__, __LINE__, __msgA.str()); \ 235 #define THROW_OR_RETURN_VOID(args) \ 238 std::stringstream __msgB; \ 240 throw VW::vw_exception(__FILE__, __LINE__, __msgB.str()); \ 244 #define _UNUSED(x) ((void)(x)) 249 std::cerr << "(" << __FILENAME__ << ":" << __LINE__ << "," << __func__ << ") " << #x << ": " << x << std::endl; \
strict_parse_exception(const char *file, int lineNumber, const std::string &message)
strict_parse_exception(const strict_parse_exception &ex)
vw_argument_disagreement_exception(const char *file, int lineNumber, const std::string &message)
vw_argument_disagreement_exception & operator=(const vw_argument_disagreement_exception &other)
vw_argument_invalid_value_exception(const char *file, int lineNumber, const std::string &message)
vw_unrecognised_option_exception(const vw_unrecognised_option_exception &ex)
const char * Filename() const
const char * what() const noexcept override
vw_unrecognised_option_exception(const char *file, int lineNumber, const std::string &message)
vw_argument_invalid_value_exception(const vw_argument_invalid_value_exception &ex)
vw_unrecognised_option_exception & operator=(const vw_unrecognised_option_exception &other)
vw_exception & operator=(const vw_exception &other) noexcept
~vw_exception() noexcept override
vw_argument_invalid_value_exception & operator=(const vw_argument_invalid_value_exception &other)
vw_exception(const char *file, int lineNumber, std::string const &message) noexcept
strict_parse_exception & operator=(const strict_parse_exception &other)
vw_argument_disagreement_exception(const vw_argument_disagreement_exception &ex)