/usr/share/cruisecontrol-bin-2.6.1/projects/qpid-trunk/cpp/src/qpid/amqp_0_10/Exception.h

00001 #ifndef QPID_AMQP_0_10_EXCEPTION_H
00002 #define QPID_AMQP_0_10_EXCEPTION_H
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  * 
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  * 
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include "qpid/Exception.h"
00026 #include "qpid/amqp_0_10/specification_fwd.h"
00027 
00028 namespace qpid {
00029 namespace amqp_0_10 {
00030 
00035 struct ConnectionException : public qpid::ConnectionException {
00036     // FIXME aconway 2008-04-04: Merge qpid::ConnectionException
00037     // into this when the old code is removed.
00038     typedef connection::CloseCode Code;
00039     ConnectionException(Code c, const std::string m)
00040         : qpid::ConnectionException(c,m), code(c) {}
00041     Code code;
00042 };
00043 
00048 struct SessionException : public qpid::SessionException  {
00049     // FIXME aconway 2008-04-04: should not have a code at this level.
00050     // Leave in place till old preview code is gone.
00051     SessionException(int code, const std::string& msg) : qpid::SessionException(code, msg) {} 
00052 };
00053 
00055 struct SessionDestroyedException : public SessionException {
00056     // FIXME aconway 2008-04-04: should not have a code at this level.
00057     // Leave in place till old preview code is gone.
00058     SessionDestroyedException(int code, const std::string& msg) : SessionException(code, msg){} 
00059 };
00060 
00062 struct SessionAbortedException : public SessionDestroyedException {
00063     typedef execution::ErrorCode Code;
00064     SessionAbortedException(Code c, const std::string m)
00065         : SessionDestroyedException(c, m), code(c) {}
00066     Code code;
00067 };
00068 
00073 struct SessionExpiredException : public SessionDestroyedException {
00074     typedef session::DetachCode Code;
00075     SessionExpiredException(Code c, const std::string m)
00076         : SessionDestroyedException(c, m), code(c) {}
00077     Code code;
00078 };
00079 
00087 struct SessionDetachedException : public SessionException {
00088     typedef session::DetachCode Code;
00089     SessionDetachedException(Code c, const std::string m)
00090         : SessionException(c, m), code(c) {}
00091     Code code;
00092 };
00093     
00094 }} // namespace qpid::amqp_0_10
00095 
00096 #endif  
00097 #ifndef QPID_AMQP_0_10_EXCEPTION_H
00098 #define QPID_AMQP_0_10_EXCEPTION_H
00099 
00100 /*
00101  *
00102  * Licensed to the Apache Software Foundation (ASF) under one
00103  * or more contributor license agreements.  See the NOTICE file
00104  * distributed with this work for additional information
00105  * regarding copyright ownership.  The ASF licenses this file
00106  * to you under the Apache License, Version 2.0 (the
00107  * "License"); you may not use this file except in compliance
00108  * with the License.  You may obtain a copy of the License at
00109  * 
00110  *   http://www.apache.org/licenses/LICENSE-2.0
00111  * 
00112  * Unless required by applicable law or agreed to in writing,
00113  * software distributed under the License is distributed on an
00114  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00115  * KIND, either express or implied.  See the License for the
00116  * specific language governing permissions and limitations
00117  * under the License.
00118  *
00119  */
00120 
00121 #include "qpid/Exception.h"
00122 #include "qpid/amqp_0_10/specification_fwd.h"
00123 
00124 namespace qpid {
00125 namespace amqp_0_10 {
00126 
00131 struct ConnectionException : public Exception {
00132     typedef connection::CloseCode Code;
00133     ConnectionException(Code c, const std::string m)
00134         : Exception(m), code(c) {}
00135     Code code;
00136 };
00137 
00142 struct SessionException : public Exception {
00143     SessionException(const std::string& msg) : Exception(msg) {} 
00144 };
00145 
00147 struct SessionDestroyedException : public SessionException {
00148     SessionDestroyedException(const std::string& msg) : SessionException(msg){} 
00149 };
00150 
00152 struct SessionAbortedException : public SessionDestroyedException {
00153     typedef execution::ErrorCode Code;
00154     SessionAbortedException(Code c, const std::string m)
00155         : SessionDestroyedException(m), code(c) {}
00156     Code code;
00157 };
00158 
00163 struct SessionExpiredException : public SessionDestroyedException {
00164     typedef session::DetachCode Code;
00165     SessionExpiredException(Code c, const std::string m)
00166         : SessionDestroyedException(m), code(c) {}
00167     Code code;
00168 };
00169 
00177 struct SessionDetachedException : public SessionException {
00178     typedef session::DetachCode Code;
00179     SessionDetachedException(Code c, const std::string m)
00180         : SessionException(m), code(c) {}
00181     Code code;
00182 };
00183     
00184 }} // namespace qpid::amqp_0_10
00185 
00186 #endif  

Generated on Thu Apr 10 11:08:17 2008 for Qpid by  doxygen 1.4.7