Line data Source code
1 : #ifndef INCLUDED_EXCEPTION2_HPP
2 : #define INCLUDED_EXCEPTION2_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "Exception2.hdl"
7 :
8 : #include "com/sun/star/uno/Exception.hpp"
9 : #include "com/sun/star/uno/Type.hxx"
10 : #include "cppu/unotype.hxx"
11 : #include "osl/mutex.hxx"
12 : #include "rtl/instance.hxx"
13 : #include "sal/types.h"
14 :
15 :
16 : inline Exception2::Exception2() SAL_THROW(())
17 : : css::uno::Exception()
18 : , member(0)
19 : {
20 : ::cppu::UnoType< Exception2 >::get();
21 : }
22 :
23 4 : inline Exception2::Exception2(const ::rtl::OUString& Message_, const ::com::sun::star::uno::Reference< css::uno::XInterface >& Context_, const ::sal_Int32& member_) SAL_THROW(())
24 : : css::uno::Exception(Message_, Context_)
25 4 : , member(member_)
26 : {
27 4 : ::cppu::UnoType< Exception2 >::get();
28 4 : }
29 :
30 : Exception2::Exception2(Exception2 const & the_other): css::uno::Exception(the_other), member(the_other.member) {}
31 :
32 4 : Exception2::~Exception2() {}
33 :
34 : Exception2 & Exception2::operator =(Exception2 const & the_other) {
35 : //TODO: Just like its implicitly-defined counterpart, this function definition is not exception-safe
36 : css::uno::Exception::operator =(the_other);
37 : member = the_other.member;
38 : return *this;
39 : }
40 :
41 :
42 : namespace detail {
43 :
44 : struct theException2Type : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theException2Type >
45 : {
46 1 : ::com::sun::star::uno::Type * operator()() const
47 : {
48 1 : ::rtl::OUString sTypeName( "Exception2" );
49 :
50 : // Start inline typedescription generation
51 1 : typelib_TypeDescription * pTD = 0;
52 1 : const ::com::sun::star::uno::Type& rSuperType = ::cppu::UnoType< css::uno::Exception >::get();
53 :
54 : typelib_CompoundMember_Init aMembers[1];
55 1 : ::rtl::OUString sMemberType0( "long" );
56 1 : ::rtl::OUString sMemberName0( "member" );
57 1 : aMembers[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_LONG;
58 1 : aMembers[0].pTypeName = sMemberType0.pData;
59 1 : aMembers[0].pMemberName = sMemberName0.pData;
60 :
61 : typelib_typedescription_new(
62 : &pTD,
63 : (typelib_TypeClass)::com::sun::star::uno::TypeClass_EXCEPTION, sTypeName.pData,
64 : rSuperType.getTypeLibType(),
65 : 1,
66 1 : aMembers );
67 :
68 1 : typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
69 :
70 1 : typelib_typedescription_release( pTD );
71 : // End inline typedescription generation
72 :
73 1 : return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_EXCEPTION, sTypeName ); // leaked
74 : }
75 : };
76 :
77 : }
78 :
79 6 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER Exception2 const *) {
80 6 : return *detail::theException2Type::get();
81 : }
82 :
83 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER Exception2 const *) SAL_THROW(()) {
84 : return ::cppu::UnoType< Exception2 >::get();
85 : }
86 :
87 : #endif // INCLUDED_EXCEPTION2_HPP
|