LCOV - code coverage report
Current view: top level - ucb/source/ucp/webdav - NeonLockStore.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 7 0.0 %
Date: 2012-08-25 Functions: 0 6 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #ifndef INCLUDED_NEONLOCKSTORE_HXX
      29                 :            : #define INCLUDED_NEONLOCKSTORE_HXX
      30                 :            : 
      31                 :            : #include <map>
      32                 :            : #include "warnings_guard_ne_locks.h"
      33                 :            : #include "osl/mutex.hxx"
      34                 :            : #include "rtl/ref.hxx"
      35                 :            : #include "NeonTypes.hxx"
      36                 :            : 
      37                 :            : namespace webdav_ucp
      38                 :            : {
      39                 :            : 
      40                 :            : class TickerThread;
      41                 :            : class NeonSession;
      42                 :            : 
      43                 :            : struct ltptr
      44                 :            : {
      45                 :          0 :     bool operator()( const NeonLock * p1, const NeonLock * p2 ) const
      46                 :            :     {
      47                 :          0 :         return p1 < p2;
      48                 :            :     }
      49                 :            : };
      50                 :            : 
      51                 :          0 : typedef struct _LockInfo
      52                 :            : {
      53                 :            :     rtl::Reference< NeonSession > xSession;
      54                 :            :     sal_Int32 nLastChanceToSendRefreshRequest;
      55                 :            : 
      56                 :          0 :     _LockInfo()
      57                 :          0 :         : nLastChanceToSendRefreshRequest( -1 ) {}
      58                 :            : 
      59                 :          0 :     _LockInfo( rtl::Reference< NeonSession > const & _xSession,
      60                 :            :               sal_Int32 _nLastChanceToSendRefreshRequest )
      61                 :            :     : xSession( _xSession ),
      62                 :          0 :       nLastChanceToSendRefreshRequest( _nLastChanceToSendRefreshRequest ) {}
      63                 :            : 
      64                 :            : } LockInfo;
      65                 :            : 
      66                 :            : typedef std::map< NeonLock *, LockInfo, ltptr > LockInfoMap;
      67                 :            : 
      68                 :            : class NeonLockStore
      69                 :            : {
      70                 :            :     osl::Mutex         m_aMutex;
      71                 :            :     ne_lock_store    * m_pNeonLockStore;
      72                 :            :     rtl::Reference< TickerThread > m_pTickerThread;
      73                 :            :     LockInfoMap        m_aLockInfoMap;
      74                 :            : 
      75                 :            : public:
      76                 :            :     NeonLockStore();
      77                 :            :     ~NeonLockStore();
      78                 :            : 
      79                 :            :     void registerSession( HttpSession * pHttpSession );
      80                 :            : 
      81                 :            :     NeonLock * findByUri( rtl::OUString const & rUri );
      82                 :            : 
      83                 :            :     void addLock( NeonLock * pLock,
      84                 :            :                   rtl::Reference< NeonSession > const & xSession,
      85                 :            :                   // time in seconds since Jan 1 1970
      86                 :            :                   // -1: infinite lock, no refresh
      87                 :            :                   sal_Int32 nLastChanceToSendRefreshRequest );
      88                 :            : 
      89                 :            :     void updateLock( NeonLock * pLock,
      90                 :            :                      sal_Int32 nLastChanceToSendRefreshRequest );
      91                 :            : 
      92                 :            :     void removeLock( NeonLock * pLock );
      93                 :            : 
      94                 :            :     void refreshLocks();
      95                 :            : 
      96                 :            : private:
      97                 :            :     void startTicker();
      98                 :            :     void stopTicker();
      99                 :            : };
     100                 :            : 
     101                 :            : } // namespace webdav_ucp
     102                 :            : 
     103                 :            : #endif // INCLUDED_NEONLOCKSTORE_HXX
     104                 :            : 
     105                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10