Vowpal Wabbit
Classes | Namespaces | Macros | Functions
vw_exception.h File Reference
#include <stdexcept>
#include <sstream>
#include <array>
#include <string>
#include <cstring>
#include <string.h>
#include <locale.h>

Classes

class  VW::vw_exception
 
class  VW::vw_argument_disagreement_exception
 
class  VW::vw_argument_invalid_value_exception
 
class  VW::vw_unrecognised_option_exception
 
class  VW::strict_parse_exception
 

Namespaces

 VW
 

Macros

#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
#define THROWERRNO(args)
 
#define THROW(args)
 
#define THROW_EX(ex, args)
 
#define VW_ASSERT(condition, args)   if (!(condition)) { THROW(args); }
 
#define EXPAND(x)   x
 
#define GET_MACRO(_1, _2, NAME, ...)   NAME
 
#define THROW_OR_RETURN(...)   EXPAND(GET_MACRO(__VA_ARGS__, THROW_OR_RETURN_NORMAL, THROW_OR_RETURN_VOID, UNUSED)(__VA_ARGS__))
 
#define THROW_OR_RETURN_NORMAL(args, retval)
 
#define THROW_OR_RETURN_VOID(args)
 
#define _UNUSED(x)   ((void)(x))
 

Functions

std::string VW::strerror_to_string (int error_number)
 

Macro Definition Documentation

#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#define _UNUSED (   x)    ((void)(x))
#define EXPAND (   x)    x
#define GET_MACRO (   _1,
  _2,
  NAME,
  ... 
)    NAME
#define THROW (   args)
Value:
{ \
std::stringstream __msg; \
__msg << args; \
throw VW::vw_exception(__FILENAME__, __LINE__, __msg.str()); \
}
#define __FILENAME__
Definition: vw_exception.h:22
Definition: vw_exception.h:27
#define THROW_EX (   ex,
  args 
)
Value:
{ \
std::stringstream __msg; \
__msg << args; \
throw ex(__FILENAME__, __LINE__, __msg.str()); \
}
#define __FILENAME__
Definition: vw_exception.h:22
#define THROW_OR_RETURN (   ...)    EXPAND(GET_MACRO(__VA_ARGS__, THROW_OR_RETURN_NORMAL, THROW_OR_RETURN_VOID, UNUSED)(__VA_ARGS__))
#define THROW_OR_RETURN_NORMAL (   args,
  retval 
)
Value:
do \
{ \
std::stringstream __msgA; \
__msgA << args; \
throw VW::vw_exception(__FILE__, __LINE__, __msgA.str()); \
} while (0)
Definition: vw_exception.h:27
#define THROW_OR_RETURN_VOID (   args)
Value:
do \
{ \
std::stringstream __msgB; \
__msgB << args; \
throw VW::vw_exception(__FILE__, __LINE__, __msgB.str()); \
} while (0)
Definition: vw_exception.h:27
#define THROWERRNO (   args)
Value:
{ \
std::stringstream __msg; \
__msg << args; \
__msg << ", errno = " << VW::strerror_to_string(errno); \
throw VW::vw_exception(__FILENAME__, __LINE__, __msg.str()); \
}
#define __FILENAME__
Definition: vw_exception.h:22
std::string strerror_to_string(int error_number)
Definition: vw_exception.h:114
Definition: vw_exception.h:27
#define VW_ASSERT (   condition,
  args 
)    if (!(condition)) { THROW(args); }