[Libreoffice-commits] core.git: framework/inc

Michael Stahl mstahl at redhat.com
Wed May 13 13:41:21 PDT 2015


 framework/inc/threadhelp/gate.hxx |   20 ++++---------
 framework/inc/threadhelp/igate.h  |   55 --------------------------------------
 2 files changed, 6 insertions(+), 69 deletions(-)

New commits:
commit bd4f62dfcefa2dad749431f80a1e6c00c28751ca
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 13 22:34:11 2015 +0200

    framework: remove pointless IGate interface and de-virtualize
    
    Change-Id: I43080ab6a4d9530a5cd4e3b8fa7806df41467e51

diff --git a/framework/inc/threadhelp/gate.hxx b/framework/inc/threadhelp/gate.hxx
index aee6a47..5917d3f 100644
--- a/framework/inc/threadhelp/gate.hxx
+++ b/framework/inc/threadhelp/gate.hxx
@@ -20,9 +20,8 @@
 #ifndef INCLUDED_FRAMEWORK_INC_THREADHELP_GATE_HXX
 #define INCLUDED_FRAMEWORK_INC_THREADHELP_GATE_HXX
 
-#include <threadhelp/igate.h>
-
 #include <boost/noncopyable.hpp>
+#include <osl/time.h>
 #include <osl/mutex.hxx>
 #include <osl/conditn.hxx>
 
@@ -36,13 +35,9 @@ namespace framework{
 
     @attention      To prevent us against wrong using, the default ctor, copy ctor and the =operator are marked private!
 
-    @implements     IGate
-    @base           IGate
-
     @devstatus      ready to use
 *//*-*************************************************************************************************************/
-class Gate : public  IGate
-           , private boost::noncopyable
+class Gate : private boost::noncopyable
 {
 
     //  public methods
@@ -65,19 +60,18 @@ class Gate : public  IGate
                         blocked threads can running ... but I don't know
                         if it's right - we are destroyed yet!?
         *//*-*****************************************************************************************************/
-        inline virtual ~Gate()
+        inline ~Gate()
         {
             open();
         }
 
         /*-****************************************************************************************************
-            @interface  IGate
             @short      open the gate
             @descr      A wait() call will not block then.
 
             @seealso    method close()
         *//*-*****************************************************************************************************/
-        virtual void open() SAL_OVERRIDE
+        void open()
         {
             // We must safe access to our internal member!
             ::osl::MutexGuard aLock( m_aAccessLock );
@@ -89,13 +83,12 @@ class Gate : public  IGate
         }
 
         /*-****************************************************************************************************
-            @interface  IGate
             @short      close the gate
             @descr      A wait() call will block then.
 
             @seealso    method open()
         *//*-*****************************************************************************************************/
-        virtual void close() SAL_OVERRIDE
+        void close()
         {
             // We must safe access to our internal member!
             ::osl::MutexGuard aLock( m_aAccessLock );
@@ -107,7 +100,6 @@ class Gate : public  IGate
         }
 
         /*-****************************************************************************************************
-            @interface  IGate
             @short      must be called to pass the gate
             @descr      If gate "open"   => wait() will not block.
                         If gate "closed" => wait() will block till somewhere open it again.
@@ -121,7 +113,7 @@ class Gate : public  IGate
 
             @onerror    We return false.
         *//*-*****************************************************************************************************/
-        virtual bool wait( const TimeValue* pTimeOut = NULL ) SAL_OVERRIDE
+        bool wait(const TimeValue* pTimeOut = nullptr)
         {
             // We must safe access to our internal member!
             ::osl::ClearableMutexGuard aLock( m_aAccessLock );
diff --git a/framework/inc/threadhelp/igate.h b/framework/inc/threadhelp/igate.h
deleted file mode 100644
index 5e0018c..0000000
--- a/framework/inc/threadhelp/igate.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- 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 .
- */
-
-#ifndef INCLUDED_FRAMEWORK_INC_THREADHELP_IGATE_H
-#define INCLUDED_FRAMEWORK_INC_THREADHELP_IGATE_H
-
-#include <osl/time.h>
-
-namespace framework{
-
-/*-************************************************************************************************************
-    @descr          We need this interface to support using of different gate implementations in a generic way.
-*//*-*************************************************************************************************************/
-class IGate
-{
-
-    //  public methods
-
-    public:
-
-        /*-****************************************************************************************************
-            @descr      These functions must be supported by a derived class!
-                            open()      -open access for all waiting threads
-                            close()     -close access for all further coming threads
-                            wait()      -must be called to pass the gate
-        *//*-*****************************************************************************************************/
-        virtual void     open    (                                   ) = 0;
-        virtual void     close   (                                   ) = 0;
-        virtual bool wait    ( const TimeValue* pTimeOut = NULL  ) = 0;
-
-    protected:
-        ~IGate() {}
-};      //  class IGate
-
-}       //  namespace framework
-
-#endif // INCLUDED_FRAMEWORK_INC_THREADHELP_IGATE_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list