jaffarCommon
Loading...
Searching...
No Matches
Macros | Functions
exceptions.hpp File Reference

Contains common functions for exception throwing. More...

#include "string.hpp"
#include <stdarg.h>
#include <stdexcept>
#include <stdio.h>
Include dependency graph for exceptions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define JAFFAR_THROW_RUNTIME(...)   jaffarCommon::exceptions::throwException("Runtime", __FILE__, __LINE__, __VA_ARGS__)
 
#define JAFFAR_THROW_LOGIC(...)   jaffarCommon::exceptions::throwException("Logic", __FILE__, __LINE__, __VA_ARGS__)
 

Functions

__JAFFAR_COMMON__INLINE__ void jaffarCommon::exceptions::throwException (const char *exceptionType, const char *fileName, const int lineNumber, const char *format,...)
 

Detailed Description

Contains common functions for exception throwing.

Macro Definition Documentation

◆ JAFFAR_THROW_LOGIC

#define JAFFAR_THROW_LOGIC (   ...)    jaffarCommon::exceptions::throwException("Logic", __FILE__, __LINE__, __VA_ARGS__)

Macro for throwing logic exceptions. It includes the file, line and a C-formatted string

◆ JAFFAR_THROW_RUNTIME

#define JAFFAR_THROW_RUNTIME (   ...)    jaffarCommon::exceptions::throwException("Runtime", __FILE__, __LINE__, __VA_ARGS__)

Macro for throwing runtime exceptions. It includes the file, line and a C-formatted string

Function Documentation

◆ throwException()

__JAFFAR_COMMON__INLINE__ void jaffarCommon::exceptions::throwException ( const char *  exceptionType,
const char *  fileName,
const int  lineNumber,
const char *  format,
  ... 
)

Common function for throwing exceptions.

Parameters
[in]exceptionTypeThe type of exception to launch (e.g., "Logic", "Runtime")
[in]fileNameThe file in which the exception was originall thrown
[in]lineNumberThe line inside the file where the exception was originall thrown
[in]formatA constant formatted string
[in]...parameters for the formatted string