move exception.hxx from arnieclient into i2ncommon
authorGerd von Egidy <gerd.von.egidy@intra2net.com>
Fri, 15 Jan 2010 16:05:44 +0000 (17:05 +0100)
committerGerd von Egidy <gerd.von.egidy@intra2net.com>
Fri, 15 Jan 2010 16:05:44 +0000 (17:05 +0100)
it is used within i2ncommon so we have circular dependencies. this move fixes it.

src/Makefile.am
src/exception.hxx [new file with mode: 0644]

index 4042fea..c71d02c 100644 (file)
@@ -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 (file)
index 0000000..cd4f441
--- /dev/null
@@ -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 <stdexcept>
+#include <string>
+
+#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