FflasFfpack
Public Member Functions | Protected Attributes
Failure Class Reference

A precondtion failed. More...

#include <debug.h>

Public Member Functions

 Failure ()
 
void operator() (const char *function, int line, const char *check)
 
void operator() (const char *function, const char *file, int line, const char *check)
 
void setErrorStream (std::ostream &stream)
 
std::ostream & print (std::ostream &o) const
 

Protected Attributes

std::ostream * _errorStream
 

Detailed Description

A precondtion failed.

The throw mechanism is usually used here as in

if (!check)
failure()(__func__,__LINE__,"this check just failed");
Failure & failure()
Definition: debug.h:174

The parameters of the constructor help debugging.

Constructor & Destructor Documentation

◆ Failure()

Failure ( )
inline

Member Function Documentation

◆ operator()() [1/2]

void operator() ( const char *  function,
int  line,
const char *  check 
)
inline

A precondtion failed.

Parameters
functionusually __func__, the function that threw the error
lineusually __LINE__, the line where it happened
checka string telling what failed.

◆ operator()() [2/2]

void operator() ( const char *  function,
const char *  file,
int  line,
const char *  check 
)
inline

A precondtion failed. The parameter help debugging. This is not much different from the previous except we can digg faster in the file where the exception was triggered.

Parameters
functionusually __func__, the function that threw the error
fileusually __FILE__, the file where this function is
lineusually __LINE__, the line where it happened
checka string telling what failed.

◆ setErrorStream()

void setErrorStream ( std::ostream &  stream)

◆ print()

std::ostream & print ( std::ostream &  o) const
inline

overload the virtual print of LinboxError.

Parameters
ooutput stream

Field Documentation

◆ _errorStream

std::ostream* _errorStream
protected

The documentation for this class was generated from the following file: