cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
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) throw (_exceptionType)
 
void cmnThrow (const std::string &message, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR) throw (std::runtime_error)
 
void cmnThrow (const char *message, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR) throw (std::runtime_error)
 

Detailed Description

Declaration of the template function cmnThrow.

Macro Definition Documentation

#define _cmnThrow_h

Function Documentation

void cmnThrow ( const std::string &  message,
cmnLogLevel  lod = CMN_LOG_LEVEL_INIT_ERROR 
)
throw (std::runtime_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");

is a bit shorter than:

cmnThrow(std::runtime_error("Error Message"));
See Also
cmnThrow and CMN_ASSERT
void cmnThrow ( const char *  message,
cmnLogLevel  lod = CMN_LOG_LEVEL_INIT_ERROR 
)
throw (std::runtime_error
)
inline