00001 #ifndef ERIS_TYPES_H
00002 #define ERIS_TYPES_H
00003
00004
00005 #include <vector>
00006 #include <string>
00007 #include <list>
00008 #include <set>
00009 #include <deque>
00010
00011 #include <stdexcept>
00012
00013 #include <Atlas/Message/Object.h>
00014 #include <Atlas/Objects/Root.h>
00015
00016 #include <wfmath/vector.h>
00017 #include <wfmath/point.h>
00018 #include <wfmath/quaternion.h>
00019 #include <wfmath/axisbox.h>
00020 #include <wfmath/stream.h>
00021
00022
00023 #include <sigc++/object.h>
00024 #if SIGC_MAJOR_VERSION == 1 && SIGC_MINOR_VERSION == 0
00025 #include <sigc++/basic_signal.h>
00026 #else
00027 #include <sigc++/signal.h>
00028 #endif
00029
00030 namespace Eris
00031 {
00032
00033 typedef std::list<std::string> StringList;
00034 typedef std::set<std::string> StringSet;
00035
00040 class BaseException : public std::runtime_error
00041 {
00042 public:
00043 BaseException(const std::string &m) :
00044 std::runtime_error(m), _msg(m) {;}
00045 virtual ~BaseException() throw() { }
00046 const std::string _msg;
00047 };
00048
00049 class InvalidOperation : public BaseException
00050 {
00051 public:
00052 InvalidOperation(const std::string &m) : BaseException(m) {;}
00053 virtual ~InvalidOperation() throw() { }
00054 };
00055
00057
00058 class IllegalMessage : public BaseException
00059 {
00060 public:
00061 IllegalMessage(const Atlas::Message::Object &m, const std::string &s) :
00062 BaseException(s), what(m) {;}
00063 virtual ~IllegalMessage() throw() { }
00064
00065 Atlas::Message::Object what;
00066 };
00067
00069 class IllegalObject : public BaseException
00070 {
00071 public:
00072 IllegalObject(const Atlas::Objects::Root &o, const std::string &s) :
00073 BaseException(s), what(o) {;}
00074 virtual ~IllegalObject() throw() { }
00075
00076 Atlas::Objects::Root what;
00077 };
00078
00079 class NetworkFailure : public BaseException
00080 {
00081 public:
00082 NetworkFailure(const std::string &s) :
00083 BaseException(s) {;}
00084 virtual ~NetworkFailure() throw() { }
00085 };
00086
00087
00088 typedef std::list<Atlas::Message::Object> MessageList;
00089
00090
00091
00092 class Entity;
00093 typedef Entity* EntityPtr;
00094
00096
00097 #ifdef _WIN32
00098 #include <winsock.h>
00099 typedef SOCKET Socket;
00100 #else
00101 typedef int Socket;
00102 #endif
00103
00104
00105
00106 typedef std::list<Socket> SocketList;
00107
00109
00111 typedef SigC::Signal0<void> Signal;
00112
00122 class OperationBlocked
00123 {
00124 public:
00125 OperationBlocked(Signal &rsig) :
00126 _continue(rsig)
00127 {;}
00128
00129 Signal& _continue;
00130 };
00131
00133
00134 }
00135
00136 #endif