1.00.16
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
ProgressStatus.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
#include <sstream>
7
// StdAir
8
#include <
stdair/stdair_exceptions.hpp
>
9
#include <
stdair/basic/BasConst_Event.hpp
>
10
#include <
stdair/basic/ProgressStatus.hpp
>
11
12
namespace
stdair
{
13
14
// //////////////////////////////////////////////////////////////////////
15
ProgressStatus::ProgressStatus
(
const
Count_T
& iCurrentNb,
16
const
Count_T
& iExpectedNb,
17
const
Count_T
& iActualNb)
18
: _currentNb (iCurrentNb),
19
_expectedNb (iExpectedNb), _actualNb (iActualNb) {
20
}
21
22
// //////////////////////////////////////////////////////////////////////
23
ProgressStatus::ProgressStatus
(
const
Count_T
& iExpectedNb,
24
const
Count_T
& iActualNb)
25
: _currentNb (
DEFAULT_PROGRESS_STATUS
),
26
_expectedNb (iExpectedNb), _actualNb (iActualNb) {
27
}
28
29
// //////////////////////////////////////////////////////////////////////
30
ProgressStatus::ProgressStatus
(
const
Count_T
& iExpectedNb)
31
: _currentNb (
DEFAULT_PROGRESS_STATUS
),
32
_expectedNb (iExpectedNb), _actualNb (iExpectedNb) {
33
}
34
35
// //////////////////////////////////////////////////////////////////////
36
ProgressStatus::ProgressStatus
()
37
: _currentNb (
DEFAULT_PROGRESS_STATUS
),
38
_expectedNb (
DEFAULT_PROGRESS_STATUS
),
39
_actualNb (
DEFAULT_PROGRESS_STATUS
) {
40
}
41
42
// //////////////////////////////////////////////////////////////////////
43
ProgressStatus::ProgressStatus
(
const
ProgressStatus
& iProgressStatus)
44
: _currentNb (iProgressStatus._currentNb),
45
_expectedNb (iProgressStatus._expectedNb),
46
_actualNb (iProgressStatus._actualNb) {
47
}
48
49
// //////////////////////////////////////////////////////////////////////
50
void
ProgressStatus::reset
() {
51
_currentNb =
DEFAULT_PROGRESS_STATUS
;
52
_actualNb =
DEFAULT_PROGRESS_STATUS
;
53
}
54
55
// //////////////////////////////////////////////////////////////////////
56
const
std::string
ProgressStatus::describe
()
const
{
57
std::ostringstream oStr;
58
oStr << _currentNb <<
" / {"
<< _expectedNb <<
", "
<< _actualNb <<
"}"
;
59
return
oStr.str();
60
}
61
62
// //////////////////////////////////////////////////////////////////////
63
const
std::string
ProgressStatus::toString
()
const
{
64
std::ostringstream oStr;
65
oStr << std::setprecision (3) <<
progress
()
66
<<
"% ("
<< _currentNb <<
"/"
<< _actualNb <<
")"
;
67
return
oStr.str();
68
}
69
70
}
BasConst_Event.hpp
ProgressStatus.hpp
stdair_exceptions.hpp
stdair
Handle on the StdAir library context.
Definition
BasChronometer.cpp:9
stdair::DEFAULT_PROGRESS_STATUS
const Count_T DEFAULT_PROGRESS_STATUS
stdair::Count_T
unsigned int Count_T
Definition
stdair_basic_types.hpp:95
stdair::ProgressStatus
Definition
ProgressStatus.hpp:25
stdair::ProgressStatus::ProgressStatus
ProgressStatus()
Definition
ProgressStatus.cpp:36
stdair::ProgressStatus::toString
const std::string toString() const
Definition
ProgressStatus.cpp:63
stdair::ProgressStatus::reset
void reset()
Definition
ProgressStatus.cpp:50
stdair::ProgressStatus::progress
const ProgressPercentage_T progress() const
Definition
ProgressStatus.hpp:49
stdair::ProgressStatus::describe
const std::string describe() const
Definition
ProgressStatus.cpp:56
Generated for StdAir by
1.12.0