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::SubProgress Class Reference

sub progress object. More...

#include <Progress.h>

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

Public Member Functions

 SubProgress (Progress &parent)
 constructor More...
 
virtual ~SubProgress ()
 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

Progressm_parent
 
- 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

sub progress object.

Definition at line 295 of file Progress.h.

Constructor & Destructor Documentation

kome::core::SubProgress::SubProgress ( Progress parent)

constructor

Parameters
parentparent progress

Definition at line 394 of file Progress.cpp.

394  : Progress( NULL ) {
395  m_parent = &parent;
396 }
Progress(const char *title=NULL)
constructor
Definition: Progress.cpp:37
#define NULL
Definition: CoreMacros.h:18

Member Function Documentation

bool kome::core::SubProgress::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 426 of file Progress.cpp.

426  {
427  return m_parent->isStopped();
428 }
bool isStopped()
judges whether it has to finish
Definition: Progress.cpp:199

Here is the call graph for this function:

void kome::core::SubProgress::onSetPosition ( const int  pos,
const int  prevPos 
)
protectedvirtual

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

Parameters
posprogress position
prevPosprevious position

Implements kome::core::Progress.

Definition at line 408 of file Progress.cpp.

408  {
409  // set parent position
410  int parentPos = 0;
411  for( unsigned int i = 0; i < m_parent->getNumberOfSubProgresses(); i++ ) {
412  // sub progress
413  SubProgress* progress = (SubProgress*)( m_parent->getSubProgress( i ) );
414 
415  parentPos += progress->getRelativePosition();
416  }
417  m_parent->setPosition( parentPos );
418 }
Progress * getSubProgress(const unsigned int idx)
gets subprogress
Definition: Progress.cpp:331
void setPosition(const int pos, const bool bForced=false)
sets progress position
Definition: Progress.cpp:98
int getRelativePosition()
gets relative position
Definition: Progress.cpp:247
unsigned int getNumberOfSubProgresses()
gets the number of sub progresses
Definition: Progress.cpp:323
sub progress object.
Definition: Progress.h:295

Here is the call graph for this function:

void kome::core::SubProgress::onSetRange ( const int  start,
const int  end 
)
protectedvirtual

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

Parameters
startstart position
endend position

Implements kome::core::Progress.

Definition at line 404 of file Progress.cpp.

404  {
405 }
void kome::core::SubProgress::onSetStatus ( const char *  status,
const bool  bForced = false 
)
protectedvirtual

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

Parameters
statusstatus
[in]bForcedflag for drawing forced

Implements kome::core::Progress.

Definition at line 421 of file Progress.cpp.

421  {
422  m_parent->setStatus( status, bForced );
423 }
void setStatus(const char *status, const bool bForced=false)
sets status
Definition: Progress.cpp:160

Here is the call graph for this function:

Member Data Documentation

Progress* kome::core::SubProgress::m_parent
protected

parent progress

Definition at line 312 of file Progress.h.


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