StdAir Logo  0.45.1
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
ProgressStatus.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // StdAir
00008 #include <stdair/stdair_exceptions.hpp>
00009 #include <stdair/basic/BasConst_Event.hpp>
00010 #include <stdair/basic/ProgressStatus.hpp>
00011 
00012 namespace stdair {
00013   
00014   // //////////////////////////////////////////////////////////////////////
00015   ProgressStatus::ProgressStatus (const Count_T& iCurrentNb,
00016                                   const Count_T& iExpectedNb,
00017                                   const Count_T& iActualNb)
00018     : _currentNb (iCurrentNb),
00019       _expectedNb (iExpectedNb), _actualNb (iActualNb) {
00020   }
00021   
00022   // //////////////////////////////////////////////////////////////////////
00023   ProgressStatus::ProgressStatus (const Count_T& iExpectedNb,
00024                                   const Count_T& iActualNb)
00025     : _currentNb (DEFAULT_PROGRESS_STATUS),
00026       _expectedNb (iExpectedNb), _actualNb (iActualNb) {
00027   }
00028 
00029   // //////////////////////////////////////////////////////////////////////
00030   ProgressStatus::ProgressStatus (const Count_T& iActualNb)
00031     : _currentNb (DEFAULT_PROGRESS_STATUS),
00032       _expectedNb (iActualNb), _actualNb (DEFAULT_PROGRESS_STATUS) {
00033   }
00034 
00035   // //////////////////////////////////////////////////////////////////////
00036   ProgressStatus::ProgressStatus()
00037     : _currentNb (DEFAULT_PROGRESS_STATUS),
00038       _expectedNb (DEFAULT_PROGRESS_STATUS),
00039       _actualNb (DEFAULT_PROGRESS_STATUS) {
00040   }
00041 
00042   // //////////////////////////////////////////////////////////////////////
00043   ProgressStatus::ProgressStatus (const ProgressStatus& iProgressStatus)
00044     : _currentNb (iProgressStatus._currentNb),
00045       _expectedNb (iProgressStatus._expectedNb),
00046       _actualNb (iProgressStatus._actualNb) {
00047   }
00048   
00049   // //////////////////////////////////////////////////////////////////////
00050   void ProgressStatus::reset() {
00051     _currentNb = DEFAULT_PROGRESS_STATUS;
00052     _actualNb = DEFAULT_PROGRESS_STATUS;
00053   }
00054 
00055   // //////////////////////////////////////////////////////////////////////
00056   const std::string ProgressStatus::describe() const {
00057     std::ostringstream oStr;
00058     oStr << _currentNb << " / {" << _expectedNb << ", " << _actualNb << "}";
00059     return oStr.str();
00060   }
00061   
00062 }