#define MSGEXCP(excpname) class excpname: public exception {\ public: excpname(std::string _msg): exception(_msg) {};\ } #define MSGEXCPS(excpname, superclass) class excpname: public superclass {\ public: excpname(std::string _msg): superclass(_msg) {};\ } namespace excp { class exception { protected: std::string c_message; public: exception(std::string _msg): c_message(_msg) {}; std::string getmessage() {return c_message;}; }; // mutex exceptions MSGEXCP(mutex); MSGEXCPS(mutex_noinit, mutex); MSGEXCPS(mutex_lock, mutex); // memory alllocations MSGEXCP(memory); MSGEXCPS(memory_enomem, memory); // config files MSGEXCP(config); MSGEXCPS(config_file_open, config); MSGEXCPS(config_file_stat, config_file_open); MSGEXCPS(config_file_size, config_file_open); MSGEXCPS(config_file_read, config); MSGEXCPS(config_option_dup, config); MSGEXCPS(config_option_nosuch, config); MSGEXCPS(config_parse_error, config); MSGEXCPS(config_parse_invalid_order, config); // modules MSGEXCP(module); MSGEXCPS(module_duplicate, module); MSGEXCPS(module_nosuch, module); // logger MSGEXCP(logger); MSGEXCPS(logger_nosuchlevel, logger); MSGEXCPS(logger_nosuchmodule, logger);