callback.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA 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 3 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 MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_callback_hh
#define mia_callback_hh
#include <string>
#include <mia/core/defines.hh>
NS_MIA_BEGIN
class EXPORT_CORE CProgressCallback
{
public:
virtual ~CProgressCallback();
void set_range(int range);
void update(int step);
void pulse();
private:
virtual void do_update(int step) = 0;
virtual void do_set_range(int range) = 0;
virtual void do_pulse() = 0;
};
class EXPORT_CORE CMsgStreamPrintCallback: public CProgressCallback
{
public:
CMsgStreamPrintCallback(const std::string& format);
virtual ~CMsgStreamPrintCallback();
private:
virtual void do_update(int step);
virtual void do_set_range(int range);
virtual void do_pulse();
struct CMsgStreamPrintCallbackImpl *impl;
};
NS_MIA_END
#endif
CMsgStreamPrintCallback::~CMsgStreamPrintCallback
virtual ~CMsgStreamPrintCallback()
CMsgStreamPrintCallback::CMsgStreamPrintCallback
CMsgStreamPrintCallback(const std::string &format)
CProgressCallback
a class to provide a feedback mechanism to show progress
Definition callback.hh:42
CProgressCallback::pulse
void pulse()
CProgressCallback::set_range
void set_range(int range)
CProgressCallback::update
void update(int step)
CProgressCallback::~CProgressCallback
virtual ~CProgressCallback()
defines.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36