summaryrefslogtreecommitdiff
path: root/stoc/source/tdmanager
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2002-11-11 07:35:49 +0000
committerKai Sommerfeld <kso@openoffice.org>2002-11-11 07:35:49 +0000
commit970e23ab9d50ebdf82351c959d1daaaf36065ff2 (patch)
treee77ca196d773292b68440e645a6967ee8578a55d /stoc/source/tdmanager
parentf14c1f894317f7e814780e9eade40c929e04b26d (diff)
#104677# - Introduced/modified for Type Description Manager/Provider Enumeration
Interface.
Diffstat (limited to 'stoc/source/tdmanager')
-rw-r--r--stoc/source/tdmanager/makefile.mk7
-rw-r--r--stoc/source/tdmanager/tdmgr.cxx118
-rw-r--r--stoc/source/tdmanager/tdmgr_common.hxx75
-rw-r--r--stoc/source/tdmanager/tdmgr_tdenumeration.cxx223
-rw-r--r--stoc/source/tdmanager/tdmgr_tdenumeration.hxx132
5 files changed, 503 insertions, 52 deletions
diff --git a/stoc/source/tdmanager/makefile.mk b/stoc/source/tdmanager/makefile.mk
index 7a8331e1588c..e49c63cd2903 100644
--- a/stoc/source/tdmanager/makefile.mk
+++ b/stoc/source/tdmanager/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.7 $
+# $Revision: 1.8 $
#
-# last change: $Author: jbu $ $Date: 2001-06-22 16:21:01 $
+# last change: $Author: kso $ $Date: 2002-11-11 08:33:38 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -78,7 +78,8 @@ COMP1TYPELIST=$(TARGET)
.INCLUDE : ..$/cppumaker.mk
SLOFILES= \
- $(SLO)$/tdmgr.obj
+ $(SLO)$/tdmgr.obj \
+ $(SLO)$/tdmgr_tdenumeration.obj
SHL1TARGET= $(TARGET)
diff --git a/stoc/source/tdmanager/tdmgr.cxx b/stoc/source/tdmanager/tdmgr.cxx
index a08a4a0007c2..a929fbc4d848 100644
--- a/stoc/source/tdmanager/tdmgr.cxx
+++ b/stoc/source/tdmanager/tdmgr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tdmgr.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: dbo $ $Date: 2001-10-11 14:53:51 $
+ * last change: $Author: kso $ $Date: 2002-11-11 08:33:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,8 +69,8 @@
#ifndef _CPPUHELPER_FACTORY_HXX_
#include <cppuhelper/factory.hxx>
#endif
-#ifndef _CPPUHELPER_IMPLBASE4_HXX_
-#include <cppuhelper/compbase4.hxx>
+#ifndef _CPPUHELPER_IMPLBASE5_HXX_
+#include <cppuhelper/compbase5.hxx>
#endif
#ifndef _CPPUHELPER_IMPLBASE1_HXX_
#include <cppuhelper/implbase1.hxx>
@@ -79,6 +79,12 @@
#include <cppuhelper/implementationentry.hxx>
#endif
+#ifndef _STOC_TDMGR_COMMON_HXX
+#include "tdmgr_common.hxx"
+#endif
+#ifndef _STOC_TDMGR_TDENUMERATION_HXX
+#include "tdmgr_tdenumeration.hxx"
+#endif
#include "lrucache.hxx"
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -94,6 +100,7 @@
#include <com/sun/star/reflection/XArrayTypeDescription.hpp>
#include <com/sun/star/reflection/XIndirectTypeDescription.hpp>
#include <com/sun/star/reflection/XInterfaceTypeDescription.hpp>
+#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <algorithm>
@@ -119,7 +126,8 @@ static const sal_Int32 CACHE_SIZE = 512;
#define IMPLNAME "com.sun.star.comp.stoc.TypeDescriptionManager"
//--------------------------------------------------------------------------------------------------
-static rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
+// exported via tdmgr_common.hxx
+rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT;
static Sequence< OUString > tdmgr_getSupportedServiceNames()
{
@@ -185,7 +193,11 @@ EventListenerImpl::~EventListenerImpl()
//==================================================================================================
class ManagerImpl
- : public WeakComponentImplHelper4< XServiceInfo, XSet, XHierarchicalNameAccess, XInitialization >
+ : public WeakComponentImplHelper5< XServiceInfo,
+ XSet,
+ XHierarchicalNameAccess,
+ XTypeDescriptionEnumerationAccess,
+ XInitialization >
{
friend EnumerationImpl;
friend EventListenerImpl;
@@ -199,9 +211,7 @@ class ManagerImpl
LRU_CacheAnyByOUString _aElements;
// provider chain
ProviderVector _aProviders;
- sal_Bool _bProviderInit;
- inline void initProviders();
inline Any getSimpleType( const OUString & rName );
protected:
@@ -234,6 +244,18 @@ public:
// XHierarchicalNameAccess
virtual Any SAL_CALL getByHierarchicalName( const OUString & rName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasByHierarchicalName( const OUString & rName ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XTypeDescriptionEnumerationAccess
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::reflection::XTypeDescriptionEnumeration > SAL_CALL
+ createTypeDescriptionEnumeration(
+ const ::rtl::OUString& moduleName,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::TypeClass >& types,
+ ::com::sun::star::reflection::TypeDescriptionSearchDepth depth )
+ throw ( ::com::sun::star::reflection::NoSuchTypeNameException,
+ ::com::sun::star::reflection::InvalidTypeNameException,
+ ::com::sun::star::uno::RuntimeException );
};
//==================================================================================================
@@ -316,13 +338,13 @@ Any EnumerationImpl::nextElement()
//__________________________________________________________________________________________________
ManagerImpl::ManagerImpl(
Reference< XComponentContext > const & xContext, sal_Int32 nCacheSize )
- : WeakComponentImplHelper4<
- XServiceInfo, XSet, XHierarchicalNameAccess, XInitialization >( _aComponentMutex )
+ : WeakComponentImplHelper5<
+ XServiceInfo, XSet, XHierarchicalNameAccess,
+ XTypeDescriptionEnumerationAccess, XInitialization >( _aComponentMutex )
, _xContext( xContext )
, _aEventListener( this )
, _bCaching( sal_True )
, _aElements( nCacheSize )
- , _bProviderInit( sal_False )
{
g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
}
@@ -342,38 +364,6 @@ void ManagerImpl::disposing()
_xContext.clear();
_aProviders.clear();
}
-//__________________________________________________________________________________________________
-inline void ManagerImpl::initProviders()
-{
- // looking up context for additional providers
- Sequence< OUString > add_providers;
- if (_xContext->getValueByName( OUString(
- RTL_CONSTASCII_USTRINGPARAM("/services/" SERVICENAME "/providers") ) ) >>= add_providers)
- {
- Reference< XMultiComponentFactory > xMgr( _xContext->getServiceManager() );
- OUString const * pNames = add_providers.getConstArray();
- for ( sal_Int32 nPos = add_providers.getLength(); nPos--; )
- {
- Reference< XHierarchicalNameAccess > xHA(
- xMgr->createInstanceWithContext( pNames[ nPos ], _xContext ), UNO_QUERY );
- OSL_ENSURE( xHA.is(), "### no td provider!" );
-
- if (xHA.is())
- {
- try
- {
- insert( makeAny( xHA ) );
- }
- catch (IllegalArgumentException &)
- {
- }
- catch (ElementExistException &)
- {
- }
- }
- }
- }
-}
// XInitialization
//__________________________________________________________________________________________________
@@ -521,6 +511,42 @@ void SAL_CALL ManagerImpl::remove( const Any & rElement )
xComp->removeEventListener( &_aEventListener );
}
+// XTypeDescriptionEnumerationAccess
+//__________________________________________________________________________________________________
+// virtual
+Reference< XTypeDescriptionEnumeration > SAL_CALL
+ManagerImpl::createTypeDescriptionEnumeration(
+ const OUString & moduleName,
+ const Sequence< TypeClass > & types,
+ TypeDescriptionSearchDepth depth )
+ throw ( NoSuchTypeNameException,
+ InvalidTypeNameException,
+ RuntimeException )
+{
+ MutexGuard aGuard( _aComponentMutex );
+
+ TDEnumerationAccessStack aStack;
+ ProviderVector::const_iterator it = _aProviders.begin();
+ const ProviderVector::const_iterator end = _aProviders.end();
+ while ( it != end )
+ {
+ Reference< XTypeDescriptionEnumerationAccess >xEnumAccess(
+ (*it), UNO_QUERY );
+ OSL_ENSURE( xEnumAccess.is(),
+ "### no XTypeDescriptionEnumerationAccess!" );
+ if ( xEnumAccess.is() )
+ aStack.push( xEnumAccess );
+
+ it++;
+ }
+
+ return Reference< XTypeDescriptionEnumeration >(
+ new TypeDescriptionEnumerationImpl( moduleName,
+ types,
+ depth,
+ aStack ) );
+}
+
//##################################################################################################
//##################################################################################################
@@ -830,12 +856,6 @@ Any ManagerImpl::getByHierarchicalName( const OUString & rName )
if (! aRet.hasValue())
{
// last, try callback chain
- MutexGuard aGuard( _aComponentMutex );
- if (! _bProviderInit)
- {
- initProviders();
- _bProviderInit = sal_True;
- }
for ( ProviderVector::const_iterator iPos( _aProviders.begin() );
iPos != _aProviders.end(); ++iPos )
{
diff --git a/stoc/source/tdmanager/tdmgr_common.hxx b/stoc/source/tdmanager/tdmgr_common.hxx
new file mode 100644
index 000000000000..5df27080011b
--- /dev/null
+++ b/stoc/source/tdmanager/tdmgr_common.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * $RCSfile: tdmgr_common.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: kso $ $Date: 2002-11-11 08:33:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _STOC_TDMGR_COMMON_HXX
+#define _STOC_TDMGR_COMMON_HXX
+
+#ifndef _RTL_UNLOAD_H_
+#include <rtl/unload.h>
+#endif
+
+namespace stoc_tdmgr
+{
+ extern rtl_StandardModuleCount g_moduleCount;
+
+} // namespace stoc_tdmgr
+
+#endif /* _STOC_TDMGR_COMMON_HXX */
diff --git a/stoc/source/tdmanager/tdmgr_tdenumeration.cxx b/stoc/source/tdmanager/tdmgr_tdenumeration.cxx
new file mode 100644
index 000000000000..f1c6f2657425
--- /dev/null
+++ b/stoc/source/tdmanager/tdmgr_tdenumeration.cxx
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: tdmgr_tdenumeration.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: kso $ $Date: 2002-11-11 08:33:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _STOC_TDMGR_COMMON_HXX
+#include "tdmgr_common.hxx"
+#endif
+#ifndef _STOC_TDMGR_TDENUMERATION_HXX
+#include "tdmgr_tdenumeration.hxx"
+#endif
+
+using namespace com::sun::star;
+
+namespace stoc_tdmgr
+{
+
+//=========================================================================
+//=========================================================================
+//
+// TypeDescriptionEnumerationImpl Implementation.
+//
+//=========================================================================
+//=========================================================================
+
+TypeDescriptionEnumerationImpl::TypeDescriptionEnumerationImpl(
+ const rtl::OUString & rModuleName,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::TypeClass > & rTypes,
+ com::sun::star::reflection::TypeDescriptionSearchDepth eDepth,
+ const TDEnumerationAccessStack & rTDEAS )
+: m_aModuleName( rModuleName ),
+ m_aTypes( rTypes ),
+ m_eDepth( eDepth ),
+ m_aChildren( rTDEAS )
+{
+ g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
+}
+
+//=========================================================================
+// virtual
+TypeDescriptionEnumerationImpl::~TypeDescriptionEnumerationImpl()
+{
+ g_moduleCount.modCnt.release( &g_moduleCount.modCnt );
+}
+
+//=========================================================================
+//
+// XEnumeration (base of XTypeDescriptionEnumeration) methods
+//
+//=========================================================================
+
+// virtual
+sal_Bool SAL_CALL TypeDescriptionEnumerationImpl::hasMoreElements()
+ throw ( uno::RuntimeException )
+{
+ uno::Reference< reflection::XTypeDescriptionEnumeration > xEnum
+ = queryCurrentChildEnumeration();
+ if ( xEnum.is() )
+ return xEnum->hasMoreElements();
+
+ return sal_False;
+}
+
+//=========================================================================
+// virtual
+uno::Any SAL_CALL TypeDescriptionEnumerationImpl::nextElement()
+ throw ( container::NoSuchElementException,
+ lang::WrappedTargetException,
+ uno::RuntimeException )
+{
+ uno::Reference< reflection::XTypeDescriptionEnumeration > xEnum
+ = queryCurrentChildEnumeration();
+ if ( xEnum.is() )
+ return xEnum->nextElement();
+
+ throw container::NoSuchElementException(
+ rtl::OUString::createFromAscii(
+ "No further elements in enumeration!" ),
+ static_cast< cppu::OWeakObject * >( this ) );
+}
+
+//=========================================================================
+//
+// XTypeDescriptionEnumeration methods
+//
+//=========================================================================
+
+// virtual
+uno::Reference< reflection::XTypeDescription > SAL_CALL
+TypeDescriptionEnumerationImpl::nextTypeDescription()
+ throw ( container::NoSuchElementException,
+ uno::RuntimeException )
+{
+ uno::Reference< reflection::XTypeDescriptionEnumeration > xEnum
+ = queryCurrentChildEnumeration();
+ if ( xEnum.is() )
+ return xEnum->nextTypeDescription();
+
+ throw container::NoSuchElementException(
+ rtl::OUString::createFromAscii(
+ "No further elements in enumeration!" ),
+ static_cast< cppu::OWeakObject * >( this ) );
+}
+
+//=========================================================================
+uno::Reference< reflection::XTypeDescriptionEnumeration >
+TypeDescriptionEnumerationImpl::queryCurrentChildEnumeration()
+{
+ osl::MutexGuard aGuard( m_aMutex );
+
+ for (;;)
+ {
+ if ( m_xEnum.is() )
+ {
+ if ( m_xEnum->hasMoreElements() )
+ {
+ return m_xEnum;
+ }
+ else
+ {
+ // Forget about enumeration without further elements. Try next.
+ m_xEnum.clear();
+ }
+ }
+
+ // Note: m_xEnum is always null here.
+
+ if ( m_aChildren.empty() )
+ {
+ // No child enumerations left.
+ return m_xEnum;
+ }
+
+ try
+ {
+ m_xEnum =
+ m_aChildren.top()->createTypeDescriptionEnumeration(
+ m_aModuleName, m_aTypes, m_eDepth );
+ }
+ catch ( reflection::NoSuchTypeNameException const & )
+ {
+ OSL_ENSURE( sal_False,
+ "TypeDescriptionEnumerationImpl::queryCurrentChildEnumeration "
+ "- Caught NoSuchTypeNameException!" );
+ }
+ catch ( reflection::InvalidTypeNameException const & )
+ {
+ OSL_ENSURE( sal_False,
+ "TypeDescriptionEnumerationImpl::queryCurrentChildEnumeration "
+ "- Caught InvalidTypeNameException!" );
+ }
+
+ // We're done with this enumeration access in any case (Either
+ // enumeration was successfully created or creation failed for some
+ // reason).
+ m_aChildren.pop();
+ }
+
+ // unreachable
+}
+
+} // namespace stoc_tdmgr
+
diff --git a/stoc/source/tdmanager/tdmgr_tdenumeration.hxx b/stoc/source/tdmanager/tdmgr_tdenumeration.hxx
new file mode 100644
index 000000000000..cff0eabc8902
--- /dev/null
+++ b/stoc/source/tdmanager/tdmgr_tdenumeration.hxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: tdmgr_tdenumeration.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: kso $ $Date: 2002-11-11 08:33:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _STOC_TDMGR_TDENUMERATION_HXX
+#define _STOC_TDMGR_TDENUMERATION_HXX
+
+#include <stack>
+
+#ifndef _OSL_MUTEX_HXX_
+#include <osl/mutex.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REFLECTION_XTYPEDESCRIPTIONENUMERATION_HPP_
+#include <com/sun/star/reflection/XTypeDescriptionEnumeration.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REFLECTION_XTYPEDESCRIPTIONENUMERATIONACCESS_HPP_
+#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+
+namespace stoc_tdmgr
+{
+
+typedef std::stack< com::sun::star::uno::Reference<
+ com::sun::star::reflection::XTypeDescriptionEnumerationAccess > >
+ TDEnumerationAccessStack;
+
+class TypeDescriptionEnumerationImpl
+ : public cppu::WeakImplHelper1<
+ com::sun::star::reflection::XTypeDescriptionEnumeration >
+{
+public:
+ TypeDescriptionEnumerationImpl(
+ const rtl::OUString & rModuleName,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::TypeClass > & rTypes,
+ com::sun::star::reflection::TypeDescriptionSearchDepth eDepth,
+ const TDEnumerationAccessStack & rTDEAS );
+ virtual ~TypeDescriptionEnumerationImpl();
+
+ // XEnumeration (base of XTypeDescriptionEnumeration)
+ virtual sal_Bool SAL_CALL hasMoreElements()
+ throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL nextElement()
+ throw ( ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // XTypeDescriptionEnumeration
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::reflection::XTypeDescription > SAL_CALL
+ nextTypeDescription()
+ throw ( ::com::sun::star::container::NoSuchElementException,
+ ::com::sun::star::uno::RuntimeException );
+
+private:
+ com::sun::star::uno::Reference<
+ com::sun::star::reflection::XTypeDescriptionEnumeration >
+ queryCurrentChildEnumeration();
+
+ osl::Mutex m_aMutex;
+ rtl::OUString m_aModuleName;
+ com::sun::star::uno::Sequence< com::sun::star::uno::TypeClass > m_aTypes;
+ com::sun::star::reflection::TypeDescriptionSearchDepth m_eDepth;
+ TDEnumerationAccessStack m_aChildren;
+ com::sun::star::uno::Reference<
+ com::sun::star::reflection::XTypeDescriptionEnumeration > m_xEnum;
+};
+
+} // namespace stoc_tdmgr
+
+#endif /* _STOC_TDMGR_TDENUMERATION_HXX */
+