Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
kome::core::DisplayProgress Class Reference

showing progress with display class More...

#include <DisplayProgress.h>

Inheritance diagram for kome::core::DisplayProgress:
Inheritance graph
[legend]
Collaboration diagram for kome::core::DisplayProgress:
Collaboration graph
[legend]

Public Member Functions

 DisplayProgress (const char *title)
 constructor More...
 
virtual ~DisplayProgress ()
 destructor
 
- Public Member Functions inherited from kome::core::Progress
 Progress (const char *title=NULL)
 constructor More...
 
virtual ~Progress ()
 destructor
 
void setRange (const int start, const int end)
 sets progress range More...
 
void setPosition (const int pos, const bool bForced=false)
 sets progress position More...
 
void setStatus (const char *status, const bool bForced=false)
 sets status More...
 
bool isStopped ()
 judges whether it has to finish More...
 
void fill ()
 sets end position
 
int getRelativePosition ()
 gets relative position More...
 
TimercreateTimer (const char *name)
 creates timer More...
 
unsigned int getNumberOfTimers ()
 gets the number of timers More...
 
const char * getTimerName (const unsigned int index)
 gets timer name More...
 
TimergetTimer (const unsigned int index)
 gets timer More...
 
void createSubProgresses (const unsigned int num)
 creates sub progresses More...
 
unsigned int getNumberOfSubProgresses ()
 gets the number of sub progresses More...
 
ProgressgetSubProgress (const unsigned int idx)
 gets subprogress More...
 

Protected Member Functions

virtual void onSetRange (const int start, const int end)
 This method is called by setRange method. (override method) More...
 
virtual void onSetPosition (const int pos, const int prevPos)
 This method is called by setPosition method. (override method) More...
 
virtual void onSetStatus (const char *status, const bool bForced=false)
 This method is called by setStatus method. (override method) More...
 
virtual bool onIsStopped ()
 This method is called by isStopped method. (override method) More...
 
virtual void onFill (void)
 This method is called by fill method. (override method)
 

Protected Attributes

boost::progress_display * m_progress
 
- Protected Attributes inherited from kome::core::Progress
std::vector< Progress * > m_subProgresses
 
int m_start
 
int m_end
 
int m_pos
 
int m_prevPos
 
int m_relPos
 
std::string m_title
 
Timer m_timer
 
std::vector< std::pair
< std::string, Timer * > > * 
m_timers
 
long long m_llPrevTime
 
std::string m_strStatus
 

Additional Inherited Members

- Static Public Member Functions inherited from kome::core::Progress
static ProgressgetIgnoringProgress ()
 gets progress object. But this object does nothing even if a method is called. More...
 

Detailed Description

showing progress with display class

Definition at line 28 of file DisplayProgress.h.

Constructor & Destructor Documentation

kome::core::DisplayProgress::DisplayProgress ( const char *  title)

constructor

Parameters
[in]titleprogress title

Definition at line 27 of file DisplayProgress.cpp.

27  : Progress( title ) {
28  m_progress = NULL;
29 }
boost::progress_display * m_progress
Progress(const char *title=NULL)
constructor
Definition: Progress.cpp:37
#define NULL
Definition: CoreMacros.h:18

Member Function Documentation

bool kome::core::DisplayProgress::onIsStopped ( )
protectedvirtual

This method is called by isStopped method. (override method)

Returns
If it has to finish, this method returns true

Implements kome::core::Progress.

Definition at line 73 of file DisplayProgress.cpp.

73  {
74  return false;
75 }
void kome::core::DisplayProgress::onSetPosition ( const int  pos,
const int  prevPos 
)
protectedvirtual

This method is called by setPosition method. (override method)

Parameters
[in]posprogress position
[in]prevPosprevious position

Implements kome::core::Progress.

Definition at line 52 of file DisplayProgress.cpp.

52  {
53  // check the member
54  if( m_progress == NULL ) {
55  return;
56  }
57 
58  // add count
59  int count = pos - prevPos;
60  if( m_start > m_end ) {
61  count = - count;
62  }
63  if( count > 0 ) {
64  ( *m_progress ) += count;
65  }
66 }
boost::progress_display * m_progress
#define NULL
Definition: CoreMacros.h:18
void kome::core::DisplayProgress::onSetRange ( const int  start,
const int  end 
)
protectedvirtual

This method is called by setRange method. (override method)

Parameters
[in]startstart position
[in]endend position

Implements kome::core::Progress.

Definition at line 39 of file DisplayProgress.cpp.

39  {
40  // range
41  int range = end - start;
42  range = ABS( range );
43 
44  // create object
45  if( m_progress != NULL ) {
46  delete m_progress;
47  }
48  m_progress = new boost::progress_display( range );
49 }
boost::progress_display * m_progress
#define NULL
Definition: CoreMacros.h:18
#define ABS(v)
Definition: CoreMacros.h:38
void kome::core::DisplayProgress::onSetStatus ( const char *  status,
const bool  bForced = false 
)
protectedvirtual

This method is called by setStatus method. (override method)

Parameters
[in]statusstatus
[in]bForcedflag for drawing forced

Implements kome::core::Progress.

Definition at line 69 of file DisplayProgress.cpp.

69  {
70 }

Member Data Documentation

boost::progress_display* kome::core::DisplayProgress::m_progress
protected

progress

Definition at line 45 of file DisplayProgress.h.


The documentation for this class was generated from the following files: