Modified DECLARE/DEFINE to expect seperate scope.
[libsex.git] / libsex / define.hxx
blob416f3ec3df87cbb21da8f63736c931739bec713d
1 /**
2 * @file
4 * Macro @ref LIBSEX_DEFINE.
5 */
7 #ifndef LIBSEX_DEFINE_HXX
8 #define LIBSEX_DEFINE_HXX
10 /**
11 * Defines an exception inheriting from a supplied parent.
13 * @param parent Parent class (incl. scope).
14 * @param scope Non-global scope of class to be defined.
15 * @param name Name of the class to be defined.
16 * @param message Error message template.
17 * @see LIBSEX_DECLARE
18 * @see snprintf
20 #define LIBSEX_DEFINE(parent, scope, name, message) \
21 const char* const scope::name::TEMPLATE = message;\
23 scope::name::name(const char* const errorMessage)\
24 : parent(errorMessage)\
28 scope::name::name(\
29 const char* const errorMessage,\
30 const libsex::Exception& previous)\
31 : parent(errorMessage, previous)\
35 #endif