1ed2f6d3bSAndrew Rist /**************************************************************
2*a6cd7a72Smseidel  *
3ed2f6d3bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4ed2f6d3bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5ed2f6d3bSAndrew Rist  * distributed with this work for additional information
6ed2f6d3bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7ed2f6d3bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8ed2f6d3bSAndrew Rist  * "License"); you may not use this file except in compliance
9ed2f6d3bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*a6cd7a72Smseidel  *
11ed2f6d3bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*a6cd7a72Smseidel  *
13ed2f6d3bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14ed2f6d3bSAndrew Rist  * software distributed under the License is distributed on an
15ed2f6d3bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ed2f6d3bSAndrew Rist  * KIND, either express or implied.  See the License for the
17ed2f6d3bSAndrew Rist  * specific language governing permissions and limitations
18ed2f6d3bSAndrew Rist  * under the License.
19*a6cd7a72Smseidel  *
20ed2f6d3bSAndrew Rist  *************************************************************/
21ed2f6d3bSAndrew Rist 
22ed2f6d3bSAndrew Rist 
23*a6cd7a72Smseidel 
24cdf0e10cSrcweir #ifndef CLASSFACTORY_HXX_INCLUDED
25cdf0e10cSrcweir #define CLASSFACTORY_HXX_INCLUDED
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #if defined _MSC_VER
28cdf0e10cSrcweir #pragma warning(push, 1)
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #include <objidl.h>
31cdf0e10cSrcweir #if defined _MSC_VER
32cdf0e10cSrcweir #pragma warning(pop)
33*a6cd7a72Smseidel #endif
34cdf0e10cSrcweir 
35*a6cd7a72Smseidel class CClassFactory : public IClassFactory
36cdf0e10cSrcweir {
37cdf0e10cSrcweir public:
38cdf0e10cSrcweir 	CClassFactory(const CLSID& clsid);
39cdf0e10cSrcweir 	virtual ~CClassFactory();
40cdf0e10cSrcweir 
41cdf0e10cSrcweir 	//-----------------------------
42cdf0e10cSrcweir 	// IUnknown methods
43cdf0e10cSrcweir 	//-----------------------------
44cdf0e10cSrcweir 
45*a6cd7a72Smseidel 	virtual HRESULT STDMETHODCALLTYPE QueryInterface(
46*a6cd7a72Smseidel 			REFIID riid,
47*a6cd7a72Smseidel 			void __RPC_FAR *__RPC_FAR *ppvObject);
48*a6cd7a72Smseidel 
49*a6cd7a72Smseidel 	virtual ULONG STDMETHODCALLTYPE AddRef(void);
50*a6cd7a72Smseidel 
51*a6cd7a72Smseidel 	virtual ULONG STDMETHODCALLTYPE Release(void);
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 	//-----------------------------
54cdf0e10cSrcweir 	// IClassFactory methods
55cdf0e10cSrcweir 	//-----------------------------
56cdf0e10cSrcweir 
57*a6cd7a72Smseidel 	virtual HRESULT STDMETHODCALLTYPE CreateInstance(
58*a6cd7a72Smseidel 			IUnknown __RPC_FAR *pUnkOuter,
59*a6cd7a72Smseidel 			REFIID riid,
60*a6cd7a72Smseidel 			void __RPC_FAR *__RPC_FAR *ppvObject);
61*a6cd7a72Smseidel 
62*a6cd7a72Smseidel 	virtual HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock);
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	static bool IsLocked();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir private:
67*a6cd7a72Smseidel 	long  m_RefCnt;
68cdf0e10cSrcweir 	CLSID m_Clsid;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	static long  s_ServerLocks;
71cdf0e10cSrcweir };
72cdf0e10cSrcweir 
73cdf0e10cSrcweir #endif
74*a6cd7a72Smseidel 
75*a6cd7a72Smseidel /* vim: set noet sw=4 ts=4: */
76