1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
10
// OpenWalnut is free software: you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
15
// OpenWalnut is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU Lesser General Public License for more details.
20
// You should have received a copy of the GNU Lesser General Public License
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
23
//---------------------------------------------------------------------------
29
#include "../common/WCondition.h"
31
#include "WProgress.h"
33
WProgress::WProgress( std::string name, unsigned int count )
47
WProgress::~WProgress()
52
void WProgress::update()
54
// This updates the internal state. But as this class updates its state directly -> do nothing here
57
void WProgress::finish()
63
WProgress& WProgress::operator++()
68
float WProgress::getProgress()
70
return isDetermined() ? 100.0 * ( static_cast< float >( m_count ) / static_cast< float >( m_max ) ) : 0.0;
73
bool WProgress::isPending()
78
std::string WProgress::getName() const
83
bool WProgress::isDetermined()
88
WProgress& WProgress::operator+( unsigned int steps )
92
m_count = std::min( m_max, m_count + steps );