17 #define _USE_INTERVAL_
19 #define DRAW_INTERVAL ( 100 ) // unit:msec
20 #define FILL_INTERVAL ( 500 ) // unit:msec
21 #include <boost/thread.hpp>
25 using namespace kome::core;
30 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__ )
31 #define malloc( s ) _malloc_dbg( s, _NORMAL_BLOCK, __FILE__, __LINE__ )
52 m_timers =
new std::vector< std::pair< std::string, Timer* > >();
71 for(
unsigned int i = 0; i <
m_timers->size(); i++ ) {
72 delete ( *m_timers )[ i ].second;
106 #ifdef _USE_INTERVAL_
107 if (
false == bForced )
111 if ( DRAW_INTERVAL > llPassed )
133 #ifndef _USE_INTERVAL_
163 #ifndef _USE_INTERVAL_
169 if ( (
const char *)
NULL == status )
178 if (
false == bForced )
214 #ifdef _USE_INTERVAL_
233 #ifdef _USE_INTERVAL_
234 boost::this_thread::sleep( boost::posix_time::milliseconds( FILL_INTERVAL ) );
259 for(
unsigned int i = 0; i <
m_timers->size(); i++ ) {
260 if( ( *
m_timers )[ i ].first.compare( name ) == 0 ) {
286 return ( *
m_timers )[ index ].first.c_str();
295 return ( *
m_timers )[ index ].second;
310 for(
unsigned int i = 0; i < num; i++ ) {
virtual void onSetPosition(const int pos, const int prevPos)
This method is called by setPosition method. (override method)
virtual ~SubProgress()
destructor
virtual void onSetStatus(const char *status, const bool bForced=false)
This method is called by setStatus method. (override method)
static Progress & getIgnoringProgress()
gets progress object. But this object does nothing even if a method is called.
void fill()
sets end position
Progress * getSubProgress(const unsigned int idx)
gets subprogress
std::vector< std::pair< std::string, Timer * > > * m_timers
Progress object. Even if a method is called, it disgards it.
virtual void onFill(void)
This method is called by fill method. (override method)
virtual bool onIsStopped()=0
This method is called by isStopped method. (abstract method)
Timer * createTimer(const char *name)
creates timer
bool isStopped()
judges whether it has to finish
interfaces of Progress class
std::vector< Progress * > m_subProgresses
int roundnum(const double v)
gets the closest integer to the argument
progress display abstract class
Progress(const char *title=NULL)
constructor
virtual bool onIsStopped()
This method is called by isStopped method. (override method)
void setPosition(const int pos, const bool bForced=false)
sets progress position
Timer * getTimer(const unsigned int index)
gets timer
virtual void onSetStatus(const char *, const bool bForced=false)
This method is called by setStatus method. (override method)
#define NVL(checkVal, replaceVal)
int getRelativePosition()
gets relative position
virtual ~Progress()
destructor
unsigned int getNumberOfSubProgresses()
gets the number of sub progresses
virtual void onSetRange(const int start, const int end)
This method is called by setRange method. (override method)
double getTotalTime()
gets total time
IgnoringProgress()
constructor
unsigned int getNumberOfTimers()
gets the number of timers
virtual void onSetPosition(const int pos, const int prevPos)=0
This method is called by setPosition method. (abstract method)
void createSubProgresses(const unsigned int num)
creates sub progresses
SubProgress(Progress &parent)
constructor
virtual void onFill(void)=0
This method is called by fill method. (abstract method)
virtual ~IgnoringProgress()
destructor
long long getcurrenttime()
gets current time in miliseconds
void setStatus(const char *status, const bool bForced=false)
sets status
const char * getTimerName(const unsigned int index)
gets timer name
virtual void onSetPosition(const int, const int)
This method is called by setPosition method. (override method)
virtual bool onIsStopped()
This method is called by isStopped method. (override method)
virtual void onSetStatus(const char *status, const bool bForced)=0
This method is called by setStatus method. (abstract method)
void setRange(const int start, const int end)
sets progress range
virtual void onFill(void)
This method is called by fill method. (override method)
virtual void onSetRange(const int start, const int end)=0
This method is called by setRange method. (abstract method)
virtual void onSetRange(const int, const int)
This method is called by setRange method. (override method)