xref: /aoo4110/main/vos/inc/vos/xception.hxx (revision b1cdbd2c)
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 
29 #ifdef _MSC_VER
30 #pragma warning( disable : 4290 )
31 #endif
32 
33 namespace vos
34 {
35 
36 /* avoid clashes with <vos/exception.hxx> */
37 #define OException OBaseException
38 
39 /*
40  * Macros for true try/catch based Exception Handling (public)
41  * based on true rtti type checking
42  */
43 
44 #define THROW_AGAIN                     throw;
45 #define THROW( Constructor )            throw Constructor;
46 
47 /*
48  * declaration of the exceptions that may be thrown by a function
49  * (e.g.) void myfunction(sal_Int32 a) throw ( std::bad_alloc );
50  * is not fully supported by all compilers
51  */
52 
53 #define THROWS( ARG ) throw ARG
54 
55 /*
56  * just a base class for further exceptions
57  */
58 
59 class OException : public OObject
60 {
61 	VOS_DECLARE_CLASSINFO(VOS_NAMESPACE(OException, vos));
62 
63 public:
64 	virtual ~OException();
OException()65 	OException() {}
OException(const OException &)66 	OException( const OException & ) : OObject() {}
67 
operator =(const OException &)68 	OException& SAL_CALL operator=(const OException&)
69 		{ return *this; }
70 };
71 
72 }
73 
74 #endif /* _XCEPTION_HXX_ */
75 
76