include/symbolism/exception.h

00001 #pragma once
00002 #include <iostream>
00003 
00004 namespace symbolism {
00005 namespace utility {
00006 
00007 class exception: public std::exception
00008 {
00009     public:
00010         exception();
00011         exception(const std::string& extra_info);
00012         exception(const std::string& file, const int line);
00013         exception(const std::string& file, const int line, const std::string& extra_info);
00014         virtual ~exception() throw();
00015 
00016         virtual const std::string description() const throw();
00017         virtual const char* what() const throw();
00018 
00019     private:
00020         std::string what_string;
00021 };
00022 
00023 #define DECLARE_EXCEPTION_CONSTRUCTORS(name) \
00024     public: \
00025         name() \
00026         : symbolism::utility::exception() {} \
00027         name(const std::string& extra_info) \
00028         : symbolism::utility::exception(extra_info) {} \
00029         name(const std::string& file, const int line) \
00030         : symbolism::utility::exception(file, line) {} \
00031         name(const std::string& file, const int line, const std::string& extra_info) \
00032         : symbolism::utility::exception(file, line, extra_info) {}
00033 
00034 }}

Copyright © 2007-2008 Remco Bloemen.

Generated on Tue Jan 22 17:35:31 2008 for symbolism by doxygen 1.5.4

Hosted by SourceForge.net Logo