diff options
Diffstat (limited to 'connectivity/source/cpool/ZConnectionPool.cxx')
-rw-r--r-- | connectivity/source/cpool/ZConnectionPool.cxx | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/connectivity/source/cpool/ZConnectionPool.cxx b/connectivity/source/cpool/ZConnectionPool.cxx index d9c02b74c1..b8d8e2a04e 100644 --- a/connectivity/source/cpool/ZConnectionPool.cxx +++ b/connectivity/source/cpool/ZConnectionPool.cxx @@ -1,10 +1,11 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * - * OpenOffice.org - a multi-platform office productivity suite + * Copyright 2000, 2010 Oracle and/or its affiliates. * * This file is part of OpenOffice.org. * @@ -37,13 +38,9 @@ #include <com/sun/star/lang/XComponent.hpp> #include "ZPooledConnection.hxx" #include "ZPoolCollection.hxx" -#ifndef _CONNECTIVITY_CONNECTIONWRAPPER_HXX_ #include "connectivity/ConnectionWrapper.hxx" -#endif #include <com/sun/star/beans/XPropertySet.hpp> -#ifndef _CONNECTIVITY_CONNECTIONWRAPPER_HXX_ #include "connectivity/ConnectionWrapper.hxx" -#endif using namespace ::com::sun::star::uno; @@ -68,10 +65,10 @@ namespace //-------------------------------------------------------------------- static const ::rtl::OUString& getTimeoutNodeName() { - static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("Timeout"); + static ::rtl::OUString s_sNodeName( RTL_CONSTASCII_USTRINGPARAM( "Timeout" )); return s_sNodeName; } - + } //========================================================================== //= OConnectionPool @@ -97,8 +94,8 @@ OConnectionPool::OConnectionPool(const Reference< XDriver >& _xDriver, OPoolCollection::getNodeValue(getTimeoutNodeName(),m_xDriverNode) >>= m_nALiveCount; calculateTimeOuts(); - - m_xInvalidator = new OPoolTimer(this,::vos::TTimeValue(m_nTimeOut,0)); + + m_xInvalidator = new OPoolTimer(this,::salhelper::TTimeValue(m_nTimeOut,0)); m_xInvalidator->start(); } // ----------------------------------------------------------------------------- @@ -113,7 +110,7 @@ struct TRemoveEventListenerFunctor : ::std::unary_function<TPooledConnections::v OConnectionPool* m_pConnectionPool; sal_Bool m_bDispose; - TRemoveEventListenerFunctor(OConnectionPool* _pConnectionPool,sal_Bool _bDispose = sal_False) + TRemoveEventListenerFunctor(OConnectionPool* _pConnectionPool,sal_Bool _bDispose = sal_False) : m_pConnectionPool(_pConnectionPool) ,m_bDispose(_bDispose) { @@ -147,7 +144,7 @@ struct TConnectionPoolFunctor : ::std::unary_function<TConnectionMap::value_type { OConnectionPool* m_pConnectionPool; - TConnectionPoolFunctor(OConnectionPool* _pConnectionPool) + TConnectionPoolFunctor(OConnectionPool* _pConnectionPool) : m_pConnectionPool(_pConnectionPool) { OSL_ENSURE(m_pConnectionPool,"No connection pool!"); @@ -199,7 +196,7 @@ Reference< XConnection > SAL_CALL OConnectionPool::getConnectionWithInfo( const if ( !xConnection.is() ) xConnection = createNewConnection(_rURL,_rInfo); - + return xConnection; } //-------------------------------------------------------------------------- @@ -242,7 +239,7 @@ Reference< XConnection> OConnectionPool::createNewConnection(const ::rtl::OUStri TConnectionMap::key_type nId; OConnectionWrapper::createUniqueId(_rURL,aInfo,nId.m_pBuffer); TConnectionPool aPack; - + // insert the new connection and struct into the active connection map aPack.nALiveCount = m_nALiveCount; TActiveConnectionInfo aActiveInfo; @@ -263,7 +260,7 @@ void OConnectionPool::invalidatePooledConnections() TConnectionMap::iterator aIter = m_aPool.begin(); for (; aIter != m_aPool.end(); ) { - if(!(--(aIter->second.nALiveCount))) // connections are invalid + if(!(--(aIter->second.nALiveCount))) // connections are invalid { ::std::for_each(aIter->second.aConnections.begin(),aIter->second.aConnections.end(),TRemoveEventListenerFunctor(this,sal_True)); @@ -306,7 +303,7 @@ Reference< XConnection> OConnectionPool::getPooledConnection(TConnectionMap::ite Reference< XComponent > xComponent(xConnection, UNO_QUERY); if (xComponent.is()) xComponent->addEventListener(this); - + TActiveConnectionInfo aActiveInfo; aActiveInfo.aPos = _rIter; aActiveInfo.xPooledConnection = xPooledConnection; @@ -334,3 +331,5 @@ void OConnectionPool::calculateTimeOuts() m_nALiveCount = m_nALiveCount / m_nTimeOut; } // ----------------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |