DataDirector API
DDD_ProgressPublisher.h
Go to the documentation of this file.
1 /*! \file DDD_ProgressPublisher.h
2  \brief Publishes progress information to a progress subscriber for purposes of
3  displaying a progress bar to the user
4 
5  \par Copyright Information
6 
7  Copyright (c) 2012 The DiSTI Corporation.<br>
8  11301 Corporate Blvd; Suite 100<br>
9  Orlando, Florida 32817<br>
10  USA<br>
11  <br>
12  All rights reserved.<br>
13 
14  This Software contains proprietary trade secrets of DiSTI and may not be
15 reproduced, in whole or part, in any form, or by any means of electronic,
16 mechanical, or otherwise, without the written permission of DiSTI. Said
17 permission may be derived through the purchase of applicable DiSTI product
18 licenses which detail the distribution rights of this content and any
19 Derivative Works based on this or other copyrighted DiSTI Software.
20 
21  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
22 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
23 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
24 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
25 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
26 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
27 
28  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
29 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
30 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
31 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
32 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
33 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBLITY
34 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
35 EXCEED FIVE DOLLARS (US$5.00).
36 
37  The aforementioned terms and restrictions are governed by the laws of the
38 State of Florida and the United States of America.
39 
40 */
41 
42 #ifndef _DDD_PROGRESS_PUBLISHER_H_
43 #define _DDD_PROGRESS_PUBLISHER_H_
44 
45 
46 #include "DDD_Include.h"
47 
48 
49 namespace disti
50 {
51 
52 /** \brief Progress Callback function
53  * \param percentage Completion percentage from \c 0.0f to \c 100.0f
54  */
55 typedef void (*ProgressCallback)(float);
56 
57 /** \brief Base class used by children of processes requesting periodic status updates.
58  * \remark The \c percentage value is local; this object should start at 0 and finish at 100. Let the parent
59  worry about the relative progress. */
60 class DDD_EXPORT DDD_ProgressPublisher
61 {
62 public:
63  /** Constructor */
65 
66  /** Set a progress callback for notifying parent processes of our current progress level (0.0-100.0%)
67  * \param callback The callback that will be called whenever progress is updated
68  * \note For performance the subscriber may not want to do an action everytime this callback is triggered
69  */
70  void SetProgressCallback(ProgressCallback callback);
71 
72  /** Update the progress value
73  * \param percentage The new progress value (0-100%)
74  */
75  void UpdateProgress(float percentage);
76 
77 protected:
78  ProgressCallback _progressCb; /**< The progress callback */
79  float _currentProgress; /**< The current progress value */
80 };
81 
82 
83 }
84 
85 #endif
86 
Base class used by children of processes requesting periodic status updates.
Definition: DDD_ProgressPublisher.h:60
void(* ProgressCallback)(float)
Progress Callback function.
Definition: DDD_ProgressPublisher.h:55
ProgressCallback _progressCb
Definition: DDD_ProgressPublisher.h:78
float _currentProgress
Definition: DDD_ProgressPublisher.h:79
Definition: AttributeChangedEmitter.h:46