Update ooo320-m1
[ooovba.git] / bridges / source / remote / urp / urp_bridgeimpl.hxx
blobd0219596bfac161334cc5a285eef70c8f995d136
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: urp_bridgeimpl.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _URP_BRIDGEIMPL_HXX_
31 #define _URP_BRIDGEIMPL_HXX_
33 #include <stdio.h>
34 #include <osl/mutex.hxx>
35 #include <osl/conditn.hxx>
36 #include <rtl/ustring.hxx>
37 #include <rtl/byteseq.hxx>
39 #ifndef _UNO_THREADPOOL_H_
40 #include <uno/threadpool.h>
41 #endif
42 #include <bridges/remote/bridgeimpl.hxx>
44 #ifndef _URP_CACHE_HXX_
45 #include "urp_cache.hxx"
46 #endif
47 #include "urp_marshal_decl.hxx"
49 #ifndef _URP_REPLYCONTAINER_HXX_
50 #include "urp_replycontainer.hxx"
51 #endif
52 #include "urp_property.hxx"
55 namespace bridges_urp
58 class PropertyObject;
60 struct equalOUString
62 sal_Int32 operator() ( const ::rtl::OUString &s1, const ::rtl::OUString &s2 ) const
64 return s1 == s2;
68 struct equalType
70 sal_Int32 operator() ( const ::com::sun::star::uno::Type &t1,
71 const ::com::sun::star::uno::Type &t2 ) const
73 return t1 == t2;
77 class OWriterThread;
78 class OReaderThread;
80 struct urp_BridgeImpl :
81 public remote_BridgeImpl
83 urp_BridgeImpl( sal_Int32 nCacheSize , sal_uInt32 nInitialMarshalerSize );
84 ~urp_BridgeImpl();
86 void applyProtocolChanges( const Properties & );
88 void startBlockBridge();
89 void stopBlockBridge();
90 void addError( char const *pError );
91 void addError( const ::rtl::OUString &anError );
92 void dumpErrors( FILE *f );
93 ::rtl::OUString getErrorsAsString();
95 ::osl::Mutex m_marshalingMutex;
96 ::osl::Mutex m_disposingMutex;
97 ::osl::Mutex m_errorListMutex;
98 Marshal m_blockMarshaler;
99 sal_Int32 m_nMarshaledMessages;
101 // Caches for vars, that go from local process to the remote process
102 Cache < ::rtl::OUString , equalOUString > m_oidCacheOut;
103 Cache < ::rtl::ByteSequence , EqualThreadId > m_tidCacheOut;
104 Cache < ::com::sun::star::uno::Type , equalType > m_typeCacheOut;
106 ::com::sun::star::uno::Type m_lastOutType;
107 ::rtl::ByteSequence m_lastOutTid;
108 ::rtl::OUString m_lastOutOid;
110 // Caches for vars, that come from the remote process to the local process
111 ::rtl::OUString *m_pOidIn;
112 ::rtl::ByteSequence *m_pTidIn;
113 ::com::sun::star::uno::Type *m_pTypeIn;
115 ::com::sun::star::uno::Type m_lastInType;
116 ::rtl::ByteSequence m_lastInTid;
117 ::rtl::OUString m_lastInOid;
119 urp_ClientJobContainer m_clientJobContainer;
121 OWriterThread *m_pWriter;
122 OReaderThread *m_pReader;
123 ::rtl::OString m_sLogFileName;
124 FILE *m_pLogFile;
125 ::osl::Condition m_initialized;
126 ::osl::Condition m_cndWaitForThreads;
128 struct Properties m_properties;
129 class PropertyObject *m_pPropertyObject;
130 ::std::list< ::rtl::OUString > m_lstErrors;
131 uno_ThreadPool m_hThreadPool;
136 #endif