cisst-saw
Loading...
Searching...
No Matches
cmnThrow.h File Reference

Declaration of the template function cmnThrow. More...

#include <cisstCommon/cmnLogger.h>
#include <stdexcept>
#include <cstdlib>

Go to the source code of this file.

Macros

#define _cmnThrow_h

Functions

template<class _exceptionType>
void cmnThrow (const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
void cmnThrow (const std::string &message, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR) CISST_THROW(std
void cmnThrow (const char *message, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR) CISST_THROW(std

Detailed Description

Declaration of the template function cmnThrow.

Macro Definition Documentation

◆ _cmnThrow_h

#define _cmnThrow_h

Function Documentation

◆ cmnThrow() [1/2]

void cmnThrow ( const char * message,
cmnLogLevel lod = CMN_LOG_LEVEL_INIT_ERROR )
inline

◆ cmnThrow() [2/2]

void cmnThrow ( const std::string & message,
cmnLogLevel lod = CMN_LOG_LEVEL_INIT_ERROR )
inline

Throw an std::runtime_error with a user defined message. These functions are provided to simplify the programmer's life as:

cmnThrow("Error Message");
void cmnThrow(const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
Definition cmnThrow.h:76

is a bit shorter than:

cmnThrow(std::runtime_error("Error Message"));
See also
cmnThrow and CMN_ASSERT