diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-05-13 22:34:11 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-05-13 22:34:46 +0200 |
commit | bd4f62dfcefa2dad749431f80a1e6c00c28751ca (patch) | |
tree | d8cbc2e4afcd1433d585fbd30151e1c3a7e6fa88 /framework | |
parent | cfade6de8ea417a8b6b94bf6c320ac2d4c15e256 (diff) |
framework: remove pointless IGate interface and de-virtualize
Change-Id: I43080ab6a4d9530a5cd4e3b8fa7806df41467e51
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/threadhelp/gate.hxx | 20 | ||||
-rw-r--r-- | framework/inc/threadhelp/igate.h | 55 |
2 files changed, 6 insertions, 69 deletions
diff --git a/framework/inc/threadhelp/gate.hxx b/framework/inc/threadhelp/gate.hxx index aee6a47e9508..5917d3fa2748 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 5e0018c34184..000000000000 --- 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: */ |