00001 #pragma once 00002 00003 #include <string> 00004 00005 namespace mycq 00006 { 00007 using namespace std; 00008 00010 class MyCQException 00011 { 00012 public: 00014 static const int CLIENT_CONNECTION = 1001; 00015 00017 static const int CLIENT_LOGIN = 1002; 00018 00020 static const int UM_FAILED = 2001; 00021 00023 static const int UM_USERNAME = 2002; 00024 00026 static const int UM_PASSWORD = 2003; 00027 00029 static const int UM_USERTYPE = 2004; 00030 00031 00033 static const int QM_FAILED = 3001; 00034 00036 static const int QM_QUEUE_NAME = 3002; 00037 00039 static const int QM_QUEUE_SCHEMA = 3003; 00040 00042 static const int QM_QUEUE_COLUMN = 3004; 00043 00045 static const int QM_QUEUE_SIZE = 3005; 00046 00047 00049 static const int CQM_FAILED = 5001; 00050 00052 static const int CQM_CQ_NAME = 5002; 00053 00055 static const int CQM_CQ_STATEMENT = 5003; 00056 00058 static const int CQM_QUEUE_NAME = 5004; 00059 00061 static const int CQM_HEART_BEAT = 5005; 00062 00064 static const int CQM_CQ_RESULT_QUEUE_SIZE = 5006; 00065 00066 00068 static const int QUEUE_INVALID_QUEUE = 7001; 00069 00071 static const int QUEUE_INVALID_MESSAGE = 7002; 00072 00074 static const int QUEUE_PUT_FAILED = 7003; 00075 00077 static const int QUEUE_GET_FAILED = 7004; 00078 00080 static const int QUEUE_GET_START = 7005; 00081 00083 static const int QUEUE_GET_STOP = 7006; 00084 00085 00087 static const int QUEUE_SCHEMA_INVALID_COLUMN_NAME = 7501; 00088 00090 static const int QUEUE_SCHEMA_INVALID_COLUMN_SIZE = 7502; 00091 00092 00094 static const int MSG_COLUMN_NAME = 9001; 00095 00097 static const int MSG_COLUMN_INDEX = 9002; 00098 00100 static const int MSG_COLUMN_DATE = 9003; 00101 00103 static const int MSG_COLUMN_TIME = 9004; 00104 00106 static const int MSG_COLUMN_DATETIME = 9005; 00107 00109 static const int MSG_COLUMN_VALUE = 9006; 00110 00112 static const int MSG_READ_ONLY = 9007; 00113 00114 private: 00115 int code; 00116 string message; 00117 00118 public: 00120 int getCode() const; 00121 00123 string getMessage() const; 00124 00125 public: 00127 MyCQException(int code, string message); 00128 00130 ~MyCQException(void); 00131 }; 00132 }