1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _XCEPTION_HXX_ 25 #define _XCEPTION_HXX_ 26 27 #include <vos/object.hxx> 28 #include <vos/vosdllapi.h> 29 30 #ifdef _MSC_VER 31 #pragma warning( disable : 4290 ) 32 #endif 33 34 namespace vos 35 { 36 37 /* avoid clashes with <vos/exception.hxx> */ 38 #define OException OBaseException 39 40 /* 41 * Macros for true try/catch based Exception Handling (public) 42 * based on true rtti type checking 43 */ 44 45 #define THROW_AGAIN throw; 46 #define THROW( Constructor ) throw Constructor; 47 48 /* 49 * declaration of the exceptions that may be thrown by a function 50 * (e.g.) void myfunction(sal_Int32 a) throw ( std::bad_alloc ); 51 * is not fully supported by all compilers 52 */ 53 54 #define THROWS( ARG ) throw ARG 55 56 /* 57 * just a base class for further exceptions 58 */ 59 60 class VOS_DLLPUBLIC OException : public OObject 61 { 62 VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OException, vos)); 63 64 public: 65 virtual ~OException(); OException()66 OException() {} OException(const OException &)67 OException( const OException & ) : OObject() {} 68 operator =(const OException &)69 OException& SAL_CALL operator=(const OException&) 70 { return *this; } 71 }; 72 73 } 74 75 #endif /* _XCEPTION_HXX_ */ 76 77