#include <exception>
#include <string>
Go to the source code of this file.
Classes | |
class | Except::Base |
Namespaces | |
namespace | Except |
Defines | |
#define | STRINGIFY_1(x) #x |
#define | STRINGIFY_2(x) STRINGIFY_1(x) |
#define | LOCATION __FILE__ ":" STRINGIFY_2(__LINE__) |
#define | MAKE_EXCEPTION(NAME, PARENT) |
#define LOCATION __FILE__ ":" STRINGIFY_2(__LINE__) |
Definition at line 99 of file AlcapExcept.h.
#define MAKE_EXCEPTION | ( | NAME, | |||
PARENT | ) |
namespace Except { \ class NAME : public PARENT { \ public: \ NAME() {AppendWhat(#NAME);} \ NAME(const char* message) {AppendWhat(#NAME, message);} \ NAME(const char* file, int line) {AppendWhat(#NAME, file, line);} \ }; \ }
A macro to build an exception class __name that is derived from __parent. The __parent class must be derived from Except::Base which provides the AppendWhat method. This macro builds an exception class that can be used:
/// MAKE_EXCEPTION(Child,Base); /// ... /// try { /// throw Except::Child(); /// } /// catch (Except::Base& ex) { /// std::cout << ex.what << std::endl; /// } ///
Definition at line 115 of file AlcapExcept.h.
#define STRINGIFY_1 | ( | x | ) | #x |
Definition at line 97 of file AlcapExcept.h.
#define STRINGIFY_2 | ( | x | ) | STRINGIFY_1(x) |
Definition at line 98 of file AlcapExcept.h.