Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
5f55ab75
Commit
5f55ab75
authored
Jul 18, 2016
by
Hugo Beauzée-Luyssen
Browse files
Remove unused Toggleable class
parent
585448e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Tools/Toggleable.hpp
deleted
100644 → 0
View file @
585448e1
/*****************************************************************************
* Toggleable.hpp : Represents a generic container for toglleable values
*****************************************************************************
* Copyright (C) 2008-2016 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@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
src/Workflow/MainWorkflow.h
View file @
5f55ab75
...
...
@@ -26,7 +26,6 @@
#define MAINWORKFLOW_H
#include
"Types.h"
#include
"Tools/Toggleable.hpp"
#include
<QJsonObject>
#include
<memory>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment