Line data Source code
1 : #ifndef INCLUDED_TEST_CODEMAKER_CPPUMAKER_STRUCT_HPP
2 : #define INCLUDED_TEST_CODEMAKER_CPPUMAKER_STRUCT_HPP
3 :
4 : #include "sal/config.h"
5 :
6 : #include "test/codemaker/cppumaker/Struct.hdl"
7 :
8 : #include "com/sun/star/uno/Any.hxx"
9 : #include "com/sun/star/uno/Sequence.hxx"
10 : #include "com/sun/star/uno/Type.hxx"
11 : #include "cppu/unotype.hxx"
12 : #include "osl/mutex.hxx"
13 : #include "rtl/string.h"
14 : #include "rtl/ustrbuf.hxx"
15 : #include "rtl/ustring.h"
16 : #include "rtl/ustring.hxx"
17 : #include "rtl/instance.hxx"
18 : #include "sal/types.h"
19 : #include "typelib/typeclass.h"
20 : #include "typelib/typedescription.h"
21 :
22 : namespace test { namespace codemaker { namespace cppumaker {
23 :
24 3 : template< typename typeparam_T, typename typeparam_U > inline Struct< typeparam_T, typeparam_U >::Struct() SAL_THROW(())
25 : : member1()
26 3 : , member2()
27 : {
28 3 : }
29 :
30 3 : template< typename typeparam_T, typename typeparam_U > inline Struct< typeparam_T, typeparam_U >::Struct(typeparam_T const & member1_, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& member2_) SAL_THROW(())
31 : : member1(member1_)
32 3 : , member2(member2_)
33 : {
34 3 : }
35 :
36 : template< typename typeparam_T, typename typeparam_U >
37 : inline Struct< typeparam_T, typeparam_U >
38 1 : make_Struct(typeparam_T const & member1_, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& member2_) SAL_THROW(())
39 : {
40 1 : return Struct< typeparam_T, typeparam_U >(member1_, member2_);
41 : }
42 :
43 : } } }
44 :
45 : namespace cppu { namespace detail {
46 :
47 : template< typename typeparam_T, typename typeparam_U > struct theStructType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theStructType< typeparam_T, typeparam_U > >
48 : {
49 2 : ::com::sun::star::uno::Type * operator()() const
50 : {
51 2 : ::rtl::OUStringBuffer the_buffer;
52 2 : the_buffer.append("test.codemaker.cppumaker.Struct<");
53 2 : the_buffer.append(::cppu::getTypeFavourChar(static_cast< typeparam_T * >(0)).getTypeName());
54 2 : the_buffer.append(static_cast< ::sal_Unicode >(','));
55 2 : the_buffer.append(::cppu::getTypeFavourChar(static_cast< typeparam_U * >(0)).getTypeName());
56 2 : the_buffer.append(static_cast< ::sal_Unicode >('>'));
57 4 : ::rtl::OUString the_name(the_buffer.makeStringAndClear());
58 2 : ::com::sun::star::uno::Type const & the_ptype0 = ::cppu::getTypeFavourChar(static_cast< typeparam_T * >(0));
59 2 : ::typelib_TypeClass the_pclass0 = (::typelib_TypeClass) the_ptype0.getTypeClass();
60 4 : ::rtl::OUString the_pname0(the_ptype0.getTypeName());
61 4 : ::rtl::OUString the_name0( "member1" );
62 2 : ::cppu::UnoType< ::cppu::UnoSequenceType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Any > > >::get();
63 4 : ::rtl::OUString the_tname0( "[][]any" );
64 4 : ::rtl::OUString the_name1( "member2" );
65 : ::typelib_StructMember_Init the_members[] = {
66 : { { the_pclass0, the_pname0.pData, the_name0.pData }, true },
67 2 : { { typelib_TypeClass_SEQUENCE, the_tname0.pData, the_name1.pData }, false } };
68 2 : ::typelib_TypeDescription * the_newType = 0;
69 2 : ::typelib_typedescription_newStruct(&the_newType, the_name.pData, 0, 2, the_members);
70 2 : ::typelib_typedescription_register(&the_newType);
71 2 : ::typelib_typedescription_release(the_newType);
72 4 : return new ::com::sun::star::uno::Type(::com::sun::star::uno::TypeClass_STRUCT, the_name); // leaked
73 : }
74 : };
75 : } }
76 :
77 : namespace cppu {
78 :
79 : template< typename typeparam_T, typename typeparam_U > class UnoType< ::test::codemaker::cppumaker::Struct< typeparam_T, typeparam_U > > {
80 : public:
81 2 : static inline ::com::sun::star::uno::Type const & get() {
82 2 : return *detail::theStructType< typeparam_T, typeparam_U >::get();
83 : }
84 :
85 : private:
86 : UnoType(UnoType &); // not defined
87 : ~UnoType(); // not defined
88 : void operator =(UnoType); // not defined
89 : };
90 :
91 : }
92 :
93 : template< typename typeparam_T, typename typeparam_U > inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::test::codemaker::cppumaker::Struct< typeparam_T, typeparam_U > const *) SAL_THROW(()) {
94 : return ::cppu::UnoType< ::test::codemaker::cppumaker::Struct< typeparam_T, typeparam_U > >::get();
95 : }
96 :
97 : #endif // INCLUDED_TEST_CODEMAKER_CPPUMAKER_STRUCT_HPP
|