[vlmc-devel] Remove unused Toggleable class

Hugo Beauzée-Luyssen git at videolan.org
Tue Aug 2 01:00:17 CEST 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Jul 18 19:28:41 2016 +0200| [5f55ab7568c39c63f67f6b0cec3576fd11380f4a] | committer: Hugo Beauzée-Luyssen

Remove unused Toggleable class

> https://code.videolan.org/videolan/vlmc/commit/5f55ab7568c39c63f67f6b0cec3576fd11380f4a
---

 src/Tools/Toggleable.hpp    | 76 ---------------------------------------------
 src/Workflow/MainWorkflow.h |  1 -
 2 files changed, 77 deletions(-)

diff --git a/src/Tools/Toggleable.hpp b/src/Tools/Toggleable.hpp
deleted file mode 100644
index 0f4aff9..0000000
--- a/src/Tools/Toggleable.hpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*****************************************************************************
- * Toggleable.hpp : Represents a generic container for toglleable values
- *****************************************************************************
- * Copyright (C) 2008-2016 VideoLAN
- *
- * Authors: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef TOGGLEABLE_HPP
-#define TOGGLEABLE_HPP
-
-/**
- *  This class represents a generic toggleable value container.
- */
-template <typename T>
-class   Toggleable
-{
-    public:
-        Toggleable() : m_ptr( nullptr ), m_activated( true )
-        {
-        }
-        void    setPtr( T ptr )
-        {
-            Q_ASSERT( m_ptr == nullptr );
-            m_ptr = ptr;
-        }
-        operator T()
-        {
-            return m_ptr;
-        }
-        T   operator->()
-        {
-//            Q_ASSERT_X( m_activated == true, "Toggleable<T>::operator->", "Pointer is deactivated" );
-            return m_ptr;
-        }
-        T   operator->() const
-        {
-//            Q_ASSERT_X( m_activated == true, "Toggleable<T>::operator->", "Pointer is deactivated" );
-            return m_ptr;
-        }
-        bool    activated() const
-        {
-            return m_activated;
-        }
-        bool    deactivated() const
-        {
-            return !m_activated;
-        }
-        void    activate()
-        {
-            m_activated = true;
-        }
-        void    deactivate()
-        {
-            m_activated = false;
-        }
-    private:
-        T           m_ptr;
-        bool        m_activated;
-};
-
-#endif // TOGGLEABLE_HPP
diff --git a/src/Workflow/MainWorkflow.h b/src/Workflow/MainWorkflow.h
index e6bd868..a6b5d17 100644
--- a/src/Workflow/MainWorkflow.h
+++ b/src/Workflow/MainWorkflow.h
@@ -26,7 +26,6 @@
 #define MAINWORKFLOW_H
 
 #include "Types.h"
-#include "Tools/Toggleable.hpp"
 #include <QJsonObject>
 
 #include <memory>



More information about the Vlmc-devel mailing list