Public Member Functions | Private Member Functions | Private Attributes

wave_ex Class Reference

Smart exception object. More...

#include <wave_ex.h>

List of all members.

Public Member Functions

 wave_ex (const char *filename, int line)
 ~wave_ex (void)

Private Member Functions

 wave_ex (void) throw ()
void Throw (void) throw (std::exception)

Private Attributes

bool m_thrown

Detailed Description

Smart exception object.

Once you create one of these on the stack it will automatically throw in the destructor. It can be caught as a std::exception.

Once you create it, use it like a stringstream.

Use the provided helper macro to construct the exception object, this will also provide the file and line number:

        function(void) {
                if (something_bad()) {
                        wex << "Something bad just happened!";
                        wex << more_info();
                        wex << "Good luck!";
                }       //  <-- automatically throws here

Definition at line 84 of file wave_ex.h.

Constructor & Destructor Documentation

wave_ex::wave_ex ( const char *  filename,
int  line 
) [inline]

Definition at line 86 of file wave_ex.h.

wave_ex::~wave_ex ( void   )  [inline]

Definition at line 92 of file wave_ex.h.

wave_ex::wave_ex ( void   )  throw () [inline, private]

Definition at line 100 of file wave_ex.h.

Member Function Documentation

void wave_ex::Throw ( void   )  throw (std::exception) [inline, private]

Definition at line 103 of file wave_ex.h.

Member Data Documentation

bool wave_ex::m_thrown [private]

Definition at line 111 of file wave_ex.h.

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