1.00.0
C++ Standard Airline IT Object Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
ProgressStatus.hpp
Go to the documentation of this file.
1
#ifndef __STDAIR_BAS_PROGRESSSTATUS_HPP
2
#define __STDAIR_BAS_PROGRESSSTATUS_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <string>
9
// Boost Progress
10
#include <boost/progress.hpp>
11
// StdAir
12
#include <
stdair/basic/BasConst_Event.hpp
>
13
#include <
stdair/stdair_basic_types.hpp
>
14
#include <
stdair/basic/StructAbstract.hpp
>
15
#include <
stdair/service/Logger.hpp
>
16
17
namespace
stdair {
18
27
struct
ProgressStatus
:
public
StructAbstract
{
28
public
:
29
// //////////////// Getters /////////////////
31
const
Count_T
&
count
()
const
{
32
return
_currentNb;
33
}
34
36
const
Count_T
&
getCurrentNb
()
const
{
37
return
_currentNb;
38
}
39
41
const
Count_T
&
getExpectedNb
()
const
{
42
return
_expectedNb;
43
}
44
46
const
Count_T
&
getActualNb
()
const
{
47
return
_actualNb;
48
}
49
51
const
ProgressPercentage_T
progress
()
const
{
52
if
(_actualNb == 0) {
53
return
0;
54
}
55
Percentage_T
lPercentage =
56
(
static_cast<
Percentage_T
>
(_currentNb)
57
/ static_cast<Percentage_T> (_actualNb));
58
lPercentage *=
MAXIMUM_PROGRESS_STATUS
;
59
return
lPercentage;
60
}
61
62
63
// //////////////// Setters /////////////////
65
void
setCurrentNb
(
const
Count_T
& iCurrentNb) {
66
_currentNb = iCurrentNb;
67
}
68
70
void
setExpectedNb
(
const
Count_T
& iExpectedNb) {
71
_expectedNb = iExpectedNb;
72
}
73
75
void
setActualNb
(
const
Count_T
& iActualNb) {
76
_actualNb = iActualNb;
77
}
78
80
void
reset
();
81
83
Count_T
operator+=
(
Count_T
iIncrement) {
84
_currentNb += iIncrement;
85
return
_currentNb;
86
}
87
89
Count_T
operator++
() {
90
++_currentNb;
91
return
_currentNb;
92
}
93
94
95
public
:
96
// //////////////// Display Support Methods /////////////////
98
const
std::string
describe
()
const
;
99
101
const
std::string
toString
()
const
;
102
103
104
public
:
112
ProgressStatus
(
const
Count_T
& iCurrentNb,
const
Count_T
& iExpectedNb,
113
const
Count_T
& iActualNb);
114
123
ProgressStatus
(
const
Count_T
& iExpectedNb,
const
Count_T
& iActualNb);
124
133
ProgressStatus
(
const
Count_T
& iActualNb);
134
140
ProgressStatus
();
141
145
ProgressStatus
(
const
ProgressStatus
&);
146
147
private
:
148
// //////////////// Attributes /////////////////
150
Count_T
_currentNb;
151
153
Count_T
_expectedNb;
154
156
Count_T
_actualNb;
157
};
158
159
}
160
#endif // __STDAIR_BAS_PROGRESSSTATUS_HPP
Generated on Sat Dec 22 2012 16:51:53 for StdAir by
1.8.1.1