Quellcode-Bibliothek cachedcontentresultsetstub.cxx
Sprache: C
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
*/
CachedContentResultSetStub::CachedContentResultSetStub( Reference< XResultSet > const & xOrigin )
: ContentResultSetWrapper( xOrigin )
, m_nColumnCount( 0 )
, m_bColumnCountCached( false )
, m_bNeedToPropagateFetchSize( true )
, m_bFirstFetchSizePropagationDone( false )
, m_nLastFetchSize( 1 )//this value is not important at all
, m_bLastFetchDirection( true )//this value is not important at all
, m_aPropertyNameForFetchSize( u"FetchSize"_ustr )
, m_aPropertyNameForFetchDirection( u"FetchDirection"_ustr )
{
impl_init();
}
//virtual, only called from ContentResultSetWrapperListener void CachedContentResultSetStub
::impl_propertyChange( const PropertyChangeEvent& rEvt )
{
std::unique_lock aGuard(m_aMutex);
impl_EnsureNotDisposed(aGuard);
//don't notify events on fetchsize and fetchdirection to the above CachedContentResultSet //because it will ignore them anyway and we can save this remote calls if( rEvt.PropertyName == m_aPropertyNameForFetchSize
|| rEvt.PropertyName == m_aPropertyNameForFetchDirection ) return;
//virtual, only called from ContentResultSetWrapperListener void CachedContentResultSetStub
::impl_vetoableChange( const PropertyChangeEvent& rEvt )
{
std::unique_lock aGuard(m_aMutex);
impl_EnsureNotDisposed(aGuard);
//don't notify events on fetchsize and fetchdirection to the above CachedContentResultSet //because it will ignore them anyway and we can save this remote calls if( rEvt.PropertyName == m_aPropertyNameForFetchSize
|| rEvt.PropertyName == m_aPropertyNameForFetchDirection ) return;
Sequence< Any > aContent( nCount ); auto aContentRange = asNonConstRange(aContent); for( sal_Int32 nN = 1; nN <= nCount; nN++ )
{
aContentRange[nN-1] = xRow->getObject( nN, nullptr );
}
rRowContent <<= aContent;
}
void CachedContentResultSetStub
::impl_propagateFetchSizeAndDirection( std::unique_lock<std::mutex>& rGuard, sal_Int32 nFetchSize, bool bFetchDirection )
{ //this is done only for the case, that there is another CachedContentResultSet in the chain of underlying ResultSets
//we do not propagate the property 'FetchSize' or 'FetchDirection' via 'setPropertyValue' from the above CachedContentResultSet to save remote calls
//if the underlying ResultSet has a property FetchSize and FetchDirection, //we will set these properties, if the new given parameters are different from the last ones
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.2Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.