version 3.3

errorhandler.h File Reference

#include <vrs/config.h>
#include <vrs/exception.h>

Go to the source code of this file.

Namespaces

namespace  VRS

Classes

class  VRS::ErrorHandler

Defines

#define VRS_WHICH_FUNCTION   ""
#define VRS_CONSTRUCT_ERRORHANDLER(ERROR_TYPE, ERROR_MSG, MSG)
#define VRS_CheckArg(EXPR, MSG)   if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(ARGUMENT_ERROR, EXPR, MSG); } ((void)0)
#define VRS_Error(EXPR, MSG)   if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(PROGRAM_ERROR, EXPR, MSG); } ((void)0)
#define VRS_InternalError(EXPR, MSG)   if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(PROGRAM_ERROR, EXPR, MSG); } ((void)0)
#define VRS_Assertion(EXPR, MSG)   VRS_Error(EXPR, MSG)
#define VRS_RangeAssertion(VAL, MINV, MAXV)   VRS_Assertion(((MINV) <= (VAL)) && ((VAL) < (MAXV)), "range error: [" << (MINV) << ", " << (MAXV) << "), " << (VAL))
#define VRS_Warning(EXPR, MSG)   if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(WARNING, EXPR, MSG); } ((void)0)
#define VRS_WarnOnce(EXPR, MSG)
#define VRS_InternalWarning(EXPR, MSG)   if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(WARNING, EXPR, MSG); } ((void)0)
#define VRS_InternalWarnOnce(EXPR, MSG)
#define VRS_NoImpl(MSG)   VRS_CONSTRUCT_ERRORHANDLER(NOIMPL, "Not implemented", MSG); ((void)0)
#define VRS_Cast(TYPE, POINTER)   VRS_CastImpl(POINTER, (TYPE*) 0)
#define VRS_GuardedCast(TYPE, POINTER)   VRS_GuardedCastImpl(POINTER, (TYPE*) 0)

Functions

template<class S, class T>
T * VRS_CastImpl (const S *s, T *)
template<class S, class T>
T * VRS_GuardedCastImpl (const S *s, T *dummy)


Define Documentation

#define VRS_Assertion ( EXPR,
MSG   )     VRS_Error(EXPR, MSG)

#define VRS_Cast ( TYPE,
POINTER   )     VRS_CastImpl(POINTER, (TYPE*) 0)

casts POINTER to TYPE* returns 0 if !POINTER->isA(TYPE::ClassNameVRS())

#define VRS_CheckArg ( EXPR,
MSG   )     if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(ARGUMENT_ERROR, EXPR, MSG); } ((void)0)

#define VRS_CONSTRUCT_ERRORHANDLER ( ERROR_TYPE,
ERROR_MSG,
MSG   ) 

Value:

{ \
        std::ostream& s = ::VRS::ErrorHandler::newErrorOutputStringStream(); \
        s << VRS_WHICH_FUNCTION << MSG; \
        ::VRS::ErrorHandler::callHandler(::VRS::ErrorHandler::ERROR_TYPE, #ERROR_MSG, __FILE__, __LINE__); \
    }

#define VRS_Error ( EXPR,
MSG   )     if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(PROGRAM_ERROR, EXPR, MSG); } ((void)0)

#define VRS_GuardedCast ( TYPE,
POINTER   )     VRS_GuardedCastImpl(POINTER, (TYPE*) 0)

casts POINTER to TYPE* asserts that POINTER->isA(TYPE::ClassNameVRS())

#define VRS_InternalError ( EXPR,
MSG   )     if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(PROGRAM_ERROR, EXPR, MSG); } ((void)0)

#define VRS_InternalWarning ( EXPR,
MSG   )     if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(WARNING, EXPR, MSG); } ((void)0)

#define VRS_InternalWarnOnce ( EXPR,
MSG   ) 

Value:

{   static bool haveWarned = false; \
        if (!haveWarned) { \
            if(!(EXPR)) { \
                VRS_CONSTRUCT_ERRORHANDLER(WARNING, EXPR, MSG); \
                haveWarned = true; \
            } \
        } \
    } ((void)0)

#define VRS_NoImpl ( MSG   )     VRS_CONSTRUCT_ERRORHANDLER(NOIMPL, "Not implemented", MSG); ((void)0)

#define VRS_RangeAssertion ( VAL,
MINV,
MAXV   )     VRS_Assertion(((MINV) <= (VAL)) && ((VAL) < (MAXV)), "range error: [" << (MINV) << ", " << (MAXV) << "), " << (VAL))

#define VRS_Warning ( EXPR,
MSG   )     if(!(EXPR)) { VRS_CONSTRUCT_ERRORHANDLER(WARNING, EXPR, MSG); } ((void)0)

#define VRS_WarnOnce ( EXPR,
MSG   ) 

Value:

{   static bool haveWarned = false; \
        if (!haveWarned) { \
            if(!(EXPR)) { \
                VRS_CONSTRUCT_ERRORHANDLER(WARNING, EXPR, MSG); \
                haveWarned = true; \
            } \
        } \
    } ((void)0)

#define VRS_WHICH_FUNCTION   ""


Function Documentation

template<class S, class T>
T* VRS_CastImpl ( const S *  s,
T *   
) [inline]

template<class S, class T>
T* VRS_GuardedCastImpl ( const S *  s,
T *  dummy 
) [inline]


Generated on Sat May 18 06:00:20 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact