linbox
PreconditionFailed Class Reference

A precondition failed. More...

#include <debug.h>

Public Member Functions

 PreconditionFailed (const char *function, int line, const char *check)
 
 PreconditionFailed (const char *function, const char *file, int line, const char *check)
 
std::ostream & print (std::ostream &o) const
 

Static Public Member Functions

static void setErrorStream (std::ostream &stream)
 

Detailed Description

A precondition failed.

The throw mechanism is usually used here as in

if (!check)
throw(PreconditionFailed(__func__,__LINE__,"this check just failed");
PreconditionFailed(const char *function, int line, const char *check)
Definition debug.h:94

The parameters of the constructor help debugging.

Constructor & Destructor Documentation

◆ PreconditionFailed() [1/2]

PreconditionFailed ( 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.

◆ PreconditionFailed() [2/2]

PreconditionFailed ( 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.

Member Function Documentation

◆ setErrorStream()

void setErrorStream ( std::ostream & stream)
static

◆ print()

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

overload the virtual print of LinboxError.

Parameters
ooutput stream

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