libsex  3.1.0
simple exception library (C++)
/home/ptr/dev/dev-libs/libsex/libsex/declare.hxx
Go to the documentation of this file.
00001 /**
00002  * @file
00003  *
00004  * Macro @ref LIBSEX_DECLARE.
00005  */
00006 
00007 #ifndef LIBSEX_DECLARE_HXX
00008 #define LIBSEX_DECLARE_HXX
00009 
00010 #include <libsex/Exception.hxx>
00011 
00012 /**
00013  * Declares an exception inheriting from a supplied class.
00014  *
00015  * @note Due to technical limitations, it is not possible
00016  * to use LIBSEX_DECLARE to declare a class in global
00017  * scope. However, in a truly modular system that would be
00018  * bad practice anyways, so I don't care.
00019  *
00020  * @param parent Parent class (incl. scope).
00021  * @param scope Non-global scope of class to be defined.
00022  * @param name Name of class to be defined.
00023  * @see LIBSEX_DEFINE
00024  */
00025 #define LIBSEX_DECLARE(parent, scope, name) \
00026 class scope::name : public parent\
00027 {\
00028 public:\
00029         static const char* const TEMPLATE;\
00030         name(const char* const errorMessage);\
00031         name(\
00032                 const char* const errorMessage,\
00033                 const libsex::Exception& previous);\
00034 };
00035 
00036 #endif
 All Classes Files Functions Variables Defines