diff options
Diffstat (limited to 'connectivity/source/inc/FDatabaseMetaDataResultSet.hxx')
-rw-r--r-- | connectivity/source/inc/FDatabaseMetaDataResultSet.hxx | 74 |
1 files changed, 39 insertions, 35 deletions
diff --git a/connectivity/source/inc/FDatabaseMetaDataResultSet.hxx b/connectivity/source/inc/FDatabaseMetaDataResultSet.hxx index f8327e308e65..6dcd7a199daf 100644 --- a/connectivity/source/inc/FDatabaseMetaDataResultSet.hxx +++ b/connectivity/source/inc/FDatabaseMetaDataResultSet.hxx @@ -32,16 +32,17 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/sdbc/XWarningsSupplier.hpp> -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/basemutex.hxx> #include <comphelper/proparrhlp.hxx> -#include <comphelper/propertycontainer.hxx> +#include <comphelper/propertycontainer2.hxx> #include <connectivity/FValue.hxx> #include <connectivity/dbtoolsdllapi.hxx> +#include <comphelper/compbase.hxx> namespace connectivity { - typedef ::cppu::WeakComponentImplHelper< css::sdbc::XResultSet, + class ODatabaseMetaDataResultSetMetaData; + + typedef ::comphelper::WeakComponentImplHelper< css::sdbc::XResultSet, css::sdbc::XRow, css::sdbc::XResultSetMetaDataSupplier, css::util::XCancellable, @@ -54,11 +55,10 @@ namespace connectivity // typedef ORefVector<ORowSetValue> ORow; // typedef ORefVector<ORow> ORows; - class OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataResultSet : - public cppu::BaseMutex, - public ODatabaseMetaDataResultSet_BASE, - public ::comphelper::OPropertyContainer, - public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet> + class SAL_DLLPUBLIC_RTTI ODatabaseMetaDataResultSet : + public ODatabaseMetaDataResultSet_BASE, + public ::comphelper::OPropertyContainer2, + public ::comphelper::OPropertyArrayUsageHelper<ODatabaseMetaDataResultSet> { public: @@ -107,8 +107,7 @@ namespace connectivity private: ORowSetValue m_aEmptyValue; - css::uno::WeakReferenceHelper m_aStatement; - css::uno::Reference< css::sdbc::XResultSetMetaData> m_xMetaData; + rtl::Reference< ODatabaseMetaDataResultSetMetaData> m_xMetaData; sal_Int32 m_nColPos; sal_Int32 m_nFetchSize; @@ -118,8 +117,9 @@ namespace connectivity void construct(); /// @throws css::sdbc::SQLException - void checkIndex(sal_Int32 columnIndex ); + void checkIndex(std::unique_lock<std::mutex>& rGuard, sal_Int32 columnIndex ); void setType(MetaDataResultSetType _eType); + css::uno::Reference< css::sdbc::XResultSetMetaData > getMetaData( std::unique_lock<std::mutex>& ); protected: ORows m_aRows; @@ -130,22 +130,26 @@ namespace connectivity virtual const ORowSetValue& getValue(sal_Int32 columnIndex); // OPropertyArrayUsageHelper - virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override; + OOO_DLLPUBLIC_DBTOOLS virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override; // OPropertySetHelper - virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override; + OOO_DLLPUBLIC_DBTOOLS virtual ::cppu::IPropertyArrayHelper & getInfoHelper() override; + + bool next(std::unique_lock<std::mutex>& ); + bool isBeforeFirst(std::unique_lock<std::mutex>& ); + bool isAfterLast(std::unique_lock<std::mutex>& ); virtual ~ODatabaseMetaDataResultSet() override; public: - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + OOO_DLLPUBLIC_DBTOOLS virtual void SAL_CALL acquire() noexcept override; + OOO_DLLPUBLIC_DBTOOLS virtual void SAL_CALL release() noexcept override; /// default construction ODatabaseMetaDataResultSet(); /// construction of a pre-defined result set type - ODatabaseMetaDataResultSet( MetaDataResultSetType _eType ); + OOO_DLLPUBLIC_DBTOOLS ODatabaseMetaDataResultSet( MetaDataResultSetType _eType ); - void setRows(const ORows& _rRows); + OOO_DLLPUBLIC_DBTOOLS void setRows(ORows&& _rRows); // XServiceInfo @@ -153,14 +157,14 @@ namespace connectivity virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - // ::cppu::OComponentHelper - virtual void SAL_CALL disposing() override; + // ::comphelper::WeakComponentImplHelper + virtual void disposing(std::unique_lock<std::mutex>&) override; // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; + OOO_DLLPUBLIC_DBTOOLS virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; // XPropertySet - virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; + OOO_DLLPUBLIC_DBTOOLS virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; // XResultSet virtual sal_Bool SAL_CALL next( ) override; virtual sal_Bool SAL_CALL isBeforeFirst( ) override; @@ -238,31 +242,31 @@ namespace connectivity // some methods to get already defined ORowSetValues // this increase the reuse of ORowSetValues /// return an empty ORowSetValueDecorator - static ORowSetValueDecoratorRef const & getEmptyValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getEmptyValue(); /// return an ORowSetValueDecorator with 0 as value - static ORowSetValueDecoratorRef const & get0Value(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & get0Value(); /// return an ORowSetValueDecorator with 1 as value - static ORowSetValueDecoratorRef const & get1Value(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & get1Value(); /// return an ORowSetValueDecorator with ColumnSearch::BASIC as value - static ORowSetValueDecoratorRef const & getBasicValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getBasicValue(); /// return an ORowSetValueDecorator with string SELECT as value - static ORowSetValueDecoratorRef const & getSelectValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getSelectValue(); /// return an ORowSetValueDecorator with string INSERT as value - static ORowSetValueDecoratorRef const & getInsertValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getInsertValue(); /// return an ORowSetValueDecorator with string DELETE as value - static ORowSetValueDecoratorRef const & getDeleteValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getDeleteValue(); /// return an ORowSetValueDecorator with string UPDATE as value - static ORowSetValueDecoratorRef const & getUpdateValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getUpdateValue(); /// return an ORowSetValueDecorator with string CREATE as value - static ORowSetValueDecoratorRef const & getCreateValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getCreateValue(); /// return an ORowSetValueDecorator with string READ as value - static ORowSetValueDecoratorRef const & getReadValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getReadValue(); /// return an ORowSetValueDecorator with string ALTER as value - static ORowSetValueDecoratorRef const & getAlterValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getAlterValue(); /// return an ORowSetValueDecorator with string DROP as value - static ORowSetValueDecoratorRef const & getDropValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getDropValue(); /// return an ORowSetValueDecorator with string ' as value - static ORowSetValueDecoratorRef const & getQuoteValue(); + OOO_DLLPUBLIC_DBTOOLS static ORowSetValueDecoratorRef const & getQuoteValue(); }; } |