1*9877b273SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9877b273SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9877b273SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9877b273SAndrew Rist  * distributed with this work for additional information
6*9877b273SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9877b273SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9877b273SAndrew Rist  * "License"); you may not use this file except in compliance
9*9877b273SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9877b273SAndrew Rist  *
11*9877b273SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9877b273SAndrew Rist  *
13*9877b273SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9877b273SAndrew Rist  * software distributed under the License is distributed on an
15*9877b273SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9877b273SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9877b273SAndrew Rist  * specific language governing permissions and limitations
18*9877b273SAndrew Rist  * under the License.
19*9877b273SAndrew Rist  *
20*9877b273SAndrew Rist  *************************************************************/
21*9877b273SAndrew Rist 
22*9877b273SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _COMPHELPER_BROADCASTHELPER_HXX_
25cdf0e10cSrcweir #define _COMPHELPER_BROADCASTHELPER_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <osl/mutex.hxx>
28cdf0e10cSrcweir #include <cppuhelper/interfacecontainer.h>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir //... namespace comphelper .......................................................
31cdf0e10cSrcweir namespace comphelper
32cdf0e10cSrcweir {
33cdf0e10cSrcweir //.........................................................................
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 	//==================================================================================
36cdf0e10cSrcweir 	//= OMutexAndBroadcastHelper - a class which holds a Mutex and a OBroadcastHelper;
37cdf0e10cSrcweir 	//=					needed because when deriving from OPropertySetHelper,
38cdf0e10cSrcweir 	//=					the OBroadcastHelper has to be initialized before
39cdf0e10cSrcweir 	//=					the OPropertySetHelper
40cdf0e10cSrcweir 	//==================================================================================
41cdf0e10cSrcweir 	class OMutexAndBroadcastHelper
42cdf0e10cSrcweir 	{
43cdf0e10cSrcweir 	protected:
44cdf0e10cSrcweir 		::osl::Mutex				m_aMutex;
45cdf0e10cSrcweir 		::cppu::OBroadcastHelper	m_aBHelper;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 	public:
OMutexAndBroadcastHelper()48cdf0e10cSrcweir 		OMutexAndBroadcastHelper() : m_aBHelper( m_aMutex ) { }
49cdf0e10cSrcweir 
GetMutex()50cdf0e10cSrcweir 		::osl::Mutex&					GetMutex()					{ return m_aMutex; }
GetBroadcastHelper()51cdf0e10cSrcweir 		::cppu::OBroadcastHelper&		GetBroadcastHelper()		{ return m_aBHelper; }
GetBroadcastHelper() const52cdf0e10cSrcweir 		const ::cppu::OBroadcastHelper&	GetBroadcastHelper() const	{ return m_aBHelper; }
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	};
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	// base class for all classes who are derived from OPropertySet and from OComponent
57cdf0e10cSrcweir 	// @deprecated, you should use cppu::BaseMutex instead (cppuhelper/basemutex.hxx)
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	class OBaseMutex
60cdf0e10cSrcweir 	{
61cdf0e10cSrcweir 	protected:
62cdf0e10cSrcweir 		mutable ::osl::Mutex m_aMutex;
63cdf0e10cSrcweir 	};
64cdf0e10cSrcweir }
65cdf0e10cSrcweir #endif // _COMPHELPER_BROADCASTHELPER_HXX_
66