ug4
ug::UGError Class Reference

Instances of this class or of derived classes are thrown if errors arise. More...

#include <error.h>

+ Inheritance diagram for ug::UGError:

Public Member Functions

const std::string & get_file (size_t i) const
 returns the file where a message occured More...
 
unsigned long get_line (size_t i) const
 returns the line where a message occured More...
 
const std::string & get_msg () const
 returns the initial message More...
 
const std::string & get_msg (size_t i) const
 returns a message in the message-stack (innermost is first) More...
 
std::string get_stacktrace () const
 
size_t num_msg () const
 number of messages in message-stack More...
 
void push_msg (const char *msg, const char *file=" -- no file -- ", const unsigned long line=0)
 adds a message to the message stack More...
 
void push_msg (const std::string &msg, const char *file=" -- no file -- ", const unsigned long line=0)
 adds a message to the message stack More...
 
 UGError (const char *msg, const char *file=" -- no file -- ", const unsigned long line=0)
 
 UGError (const std::string &msg, const char *file=" -- no file -- ", const unsigned long line=0)
 
 UGError (const std::string &msg, const std::exception &ex, const char *file, const unsigned long line)
 
virtual ~UGError ()
 virtual destructor More...
 

Protected Attributes

std::vector< std::string > m_vFile
 
std::vector< unsigned long > m_vLine
 
std::vector< std::string > m_vMsg
 

Detailed Description

Instances of this class or of derived classes are thrown if errors arise.

By default the error-code is 0 and terminate returns false.

Constructor & Destructor Documentation

◆ UGError() [1/3]

ug::UGError::UGError ( const char *  msg,
const char *  file = " -- no file -- ",
const unsigned long  line = 0 
)
inline

References push_msg().

◆ UGError() [2/3]

ug::UGError::UGError ( const std::string &  msg,
const char *  file = " -- no file -- ",
const unsigned long  line = 0 
)
inline

References push_msg().

◆ UGError() [3/3]

ug::UGError::UGError ( const std::string &  msg,
const std::exception &  ex,
const char *  file,
const unsigned long  line 
)

◆ ~UGError()

virtual ug::UGError::~UGError ( )
inlinevirtual

virtual destructor

Member Function Documentation

◆ get_file()

const std::string& ug::UGError::get_file ( size_t  i) const
inline

◆ get_line()

unsigned long ug::UGError::get_line ( size_t  i) const
inline

◆ get_msg() [1/2]

◆ get_msg() [2/2]

const std::string& ug::UGError::get_msg ( size_t  i) const
inline

returns a message in the message-stack (innermost is first)

References m_vMsg.

◆ get_stacktrace()

std::string ug::UGError::get_stacktrace ( ) const
inline

◆ num_msg()

◆ push_msg() [1/2]

void ug::UGError::push_msg ( const char *  msg,
const char *  file = " -- no file -- ",
const unsigned long  line = 0 
)
inline

adds a message to the message stack

References m_vFile, m_vLine, and m_vMsg.

◆ push_msg() [2/2]

void ug::UGError::push_msg ( const std::string &  msg,
const char *  file = " -- no file -- ",
const unsigned long  line = 0 
)
inline

Member Data Documentation

◆ m_vFile

std::vector<std::string> ug::UGError::m_vFile
protected

Referenced by get_file(), and push_msg().

◆ m_vLine

std::vector<unsigned long> ug::UGError::m_vLine
protected

Referenced by get_line(), and push_msg().

◆ m_vMsg

std::vector<std::string> ug::UGError::m_vMsg
protected

Referenced by get_msg(), num_msg(), and push_msg().


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