From: Gerd von Egidy Date: Fri, 15 Jan 2010 16:05:44 +0000 (+0100) Subject: move exception.hxx from arnieclient into i2ncommon X-Git-Tag: v2.6~112^2~19 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=9e16d607c0b4e5ff1f1b7fc9b9013007e78be7ed;p=libi2ncommon move exception.hxx from arnieclient into i2ncommon it is used within i2ncommon so we have circular dependencies. this move fixes it. --- diff --git a/src/Makefile.am b/src/Makefile.am index 4042fea..c71d02c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ include_HEADERS = week.hpp cron.hpp daemonfunc.hpp filefunc.hxx \ i2n_configdata.hpp i2n_configfile.hpp insocketstream.hxx ip_type.hxx ipfunc.hxx \ log_macros.hpp logfunc.hpp logread.hxx oftmpstream.hxx pidfile.hpp pipestream.hxx \ pointer_func.hpp source_track_basics.hpp stringfunc.hxx timefunc.hxx \ - tracefunc.hpp userfunc.hpp + tracefunc.hpp userfunc.hpp exception.hxx libi2ncommon_la_SOURCES = week.cpp cron.cpp daemonfunc.cpp \ filefunc.cpp i2n_configfile.cpp ipfunc.cpp logfunc.cpp logread.cpp oftmpstream.cpp \ diff --git a/src/exception.hxx b/src/exception.hxx new file mode 100644 index 0000000..cd4f441 --- /dev/null +++ b/src/exception.hxx @@ -0,0 +1,202 @@ +/*************************************************************************** + exception.hxx - exception classes + ------------------- + begin : Sat Oct 30 1999 + copyright : (C) 1999 by STYLETEC + email : service@styletec.de + ***************************************************************************/ + +#ifndef __EXCEPTION +#define __EXCEPTION + +#include +#include + +#define EXCEPTION(xname,xarg) xname(xarg,__LINE__,__FILE__,__DATE__ " " __TIME__) +#define EXCEPTION2(xname,xarg,xarg2) xname(xarg,xarg2,__LINE__,__FILE__,__DATE__ " " __TIME__) + +class source_info_exception +{ + public: + const int line; + const char* const file; + const char* const timestamp; + + source_info_exception(const int l, const char* f, const char* t) + : line(l), file(f), timestamp(t) + {} +}; + +class runtime_error_src : public std::runtime_error, public source_info_exception +{ + public: + runtime_error_src(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error(__arg), source_info_exception(l,f,t) {} +}; + +class network_error : public runtime_error_src +{ + public: + network_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class network_server_error : public network_error +{ + public: + network_server_error(const std::string& __arg,const int l, const char* f, const char* t) + : network_error(__arg,l,f,t) {} +}; + +class CONNECTION_SOCKET; + +class network_client_error : public network_error +{ + public: + CONNECTION_SOCKET *con; + + network_client_error(const std::string& __arg,CONNECTION_SOCKET *c, const int l, const char* f, const char* t) + : network_error(__arg,l,f,t), con(c) {} +}; + +class database_error : public runtime_error_src +{ + public: + database_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class database_query_error : public database_error +{ + public: + database_query_error(const std::string& __arg,const int l, const char* f, const char* t) + : database_error(__arg,l,f,t) {} +}; + +class signal_error : public runtime_error_src +{ + public: + signal_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class pipestream_error : public runtime_error_src +{ + public: + pipestream_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class insocketstream_error : public runtime_error_src +{ + public: + insocketstream_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class variable_data_error : public runtime_error_src +{ + public: + variable_data_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class variable_range_error : public variable_data_error +{ + public: + variable_range_error(const std::string& __arg,const int l, const char* f, const char* t) + : variable_data_error(__arg,l,f,t) {} +}; + +class variable_double_error : public variable_data_error +{ + public: + variable_double_error(const std::string& __arg,const int l, const char* f, const char* t) + : variable_data_error(__arg,l,f,t) {} +}; + +class variable_ip_error : public variable_data_error +{ + public: + variable_ip_error(const std::string& __arg,const int l, const char* f, const char* t) + : variable_data_error(__arg,l,f,t) {} +}; + +class variable_integrity_error : public variable_data_error +{ + public: + variable_integrity_error(const std::string& __arg,const int l, const char* f, const char* t) + : variable_data_error(__arg,l,f,t) {} +}; + +class variable_instance_error : public variable_data_error +{ + public: + variable_instance_error(const std::string& __arg,const int l, const char* f, const char* t) + : variable_data_error(__arg,l,f,t) {} +}; + +class variable_child_error : public variable_data_error +{ + public: + variable_child_error(const std::string& __arg,const int l, const char* f, const char* t) + : variable_data_error(__arg,l,f,t) {} +}; + +class variable_notfound_error : public variable_data_error +{ + public: + variable_notfound_error(const std::string& __arg,const int l, const char* f, const char* t) + : variable_data_error(__arg,l,f,t) {} +}; + +class autoupdate_error : public runtime_error_src +{ + public: + autoupdate_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class scheduler_dir_error : public runtime_error_src +{ + public: + scheduler_dir_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class scheduler_prog_error : public runtime_error_src +{ + public: + scheduler_prog_error(const std::string& __arg,const int l, const char* f, const char* t) + : runtime_error_src(__arg,l,f,t) {} +}; + +class logic_error_src : public std::logic_error, public source_info_exception +{ + public: + logic_error_src(const std::string& __arg,const int l, const char* f, const char* t) + : logic_error(__arg), source_info_exception(l,f,t) {} +}; + +class argument_error : public logic_error_src +{ + public: + argument_error(const std::string& __arg,const int l, const char* f, const char* t) + : logic_error_src(__arg,l,f,t) {} +}; + +class message_error : public logic_error_src +{ + public: + message_error(const std::string& __arg,const int l, const char* f, const char* t) + : logic_error_src(__arg,l,f,t) {} +}; + +class variable_error : public logic_error_src +{ + public: + variable_error(const std::string& __arg,const int l, const char* f, const char* t) + : logic_error_src(__arg,l,f,t) {} +}; + +#endif