Updated TODO.
[libsex.git] / libsex / declare.hxx
blob2e84982e4a7cf8336dc3034ce7732b90fd6a5c81
1 /**
2 * @file
4 * Macro @ref LIBSEX_DECLARE.
5 */
7 #ifndef LIBSEX_DECLARE_HXX
8 #define LIBSEX_DECLARE_HXX
10 #include <libsex/Exception.hxx>
12 /**
13 * Declares an exception inheriting from a supplied class.
15 * @note Due to technical limitations, it is not possible
16 * to use LIBSEX_DECLARE to declare a class in global
17 * scope. However, in a truly modular system that would be
18 * bad practice anyways, so I don't care.
20 * @param parent Parent class (incl. scope).
21 * @param scope Non-global scope of class to be defined.
22 * @param name Name of class to be defined.
23 * @see LIBSEX_DEFINE
25 #define LIBSEX_DECLARE(parent, scope, name) \
26 class scope::name : public parent\
28 public:\
29 static const char* const TEMPLATE;\
30 name(const char* const errorMessage);\
31 name(\
32 const char* const errorMessage,\
33 const libsex::Exception& previous);\
36 #endif