fw4spl
ProgressAdviser.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwTools/ProgressAdviser.hpp"
8 
9 namespace fwTools
10 {
11 
12 ProgressAdviser::ProgressAdviser()
13 {
14 }
15 
16 ProgressAdviser::~ProgressAdviser()
17 {
18 }
19 
20 void ProgressAdviser::addHandler(const ProgessHandler &handler)
21 {
22  // append a new ProgressHandler
23  m_progressSignal.connect(handler);
24 }
25 
26 void ProgressAdviser::notifyProgress(float percent, const std::string& msg) const
27 {
28  m_progressSignal(percent, msg);
29 }
30 
31 }
The namespace fwTools contains several tools like UUID, factory, dispatche, stringizer, macros, helper.
ProgessSignal::slot_type ProgessHandler
define the ProgessHandler type
ProgessSignal m_progressSignal
to notify progress simply use m_progressSignal( percent,msg ) to notify to Handler ...
FWTOOLS_API void notifyProgress(float percent, const std::string &msg="") const
notify modification for all handler