52 #ifndef __PCL_StatusMonitor_h
53 #define __PCL_StatusMonitor_h
66 class PCL_CLASS StatusMonitor;
339 ++m_initDisableCount;
353 --m_initDisableCount;
365 return m_initDisableCount <= 0;
376 return m_initialized;
416 if ( m_callback !=
nullptr )
417 m_callback->InfoUpdated( *
this );
436 if ( ++m_count == m_total || m_needsUpdate )
450 if ( m_count > m_total )
452 if ( m_needsUpdate || m_count == m_total )
502 m_callback = callback;
571 return s_msRefreshRate;
594 void* m_thread =
nullptr;
595 bool m_initialized =
false;
596 bool m_completed =
false;
597 bool m_aborted =
false;
598 bool m_needsUpdate =
false;
599 int m_initDisableCount = 0;
605 static unsigned s_msRefreshRate;
612 friend class MonitorDispatcherThread;
Automatic recovery of status monitoring callbacks.
Provides status monitoring callback functions.
virtual int Updated(const StatusMonitor &monitor) const =0
StatusCallback(const StatusCallback &)=default
virtual int Initialized(const StatusMonitor &monitor) const =0
virtual ~StatusCallback()
virtual void InfoUpdated(const StatusMonitor &monitor) const =0
virtual int Completed(const StatusMonitor &monitor) const =0
StatusCallback(StatusCallback &&)=default
An asynchronous status monitoring system.
static void SetRefreshRate(unsigned ms)
void EnableInitialization()
void SetCallback(StatusCallback *callback)
StatusMonitor(const StatusMonitor &x)
const StatusCallback * Callback() const
static unsigned RefreshRate()
void Initialize(const String &info, size_type count=0)
StatusCallback * Callback()
bool IsInitialized() const
void DisableInitialization()
bool IsInitializationEnabled() const
void SetInfo(const String &s)