OTB  6.7.0
Orfeo Toolbox
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
otb::StandardOneLineFilterWatcher< PrintCallbackType > Class Template Reference

#include <otbStandardOneLineFilterWatcher.h>

+ Inheritance diagram for otb::StandardOneLineFilterWatcher< PrintCallbackType >:
+ Collaboration diagram for otb::StandardOneLineFilterWatcher< PrintCallbackType >:

Public Member Functions

void SetCallback (PrintCallbackType *callback)
 
 StandardOneLineFilterWatcher (itk::ProcessObject *process, const char *comment="")
 
 StandardOneLineFilterWatcher (itk::ProcessObject *process, const std::string &comment="")
 
 StandardOneLineFilterWatcher ()
 
 ~StandardOneLineFilterWatcher () override=default
 
void SetStars (int count)
 
const int & GetStars () const
 
- Public Member Functions inherited from otb::FilterWatcherBase
 FilterWatcherBase (itk::ProcessObject *process, const char *comment="")
 
 FilterWatcherBase ()
 
 FilterWatcherBase (const FilterWatcherBase &)
 
std::string GetComment ()
 
const char * GetNameOfClass ()
 
itk::ProcessObjectGetProcess ()
 
otb::StopwatchGetStopwatch ()
 
void operator= (const FilterWatcherBase &)
 
virtual ~FilterWatcherBase ()
 

Protected Member Functions

void EndFilter () override
 
void ShowProgress () override
 
void StartFilter () override
 
- Protected Member Functions inherited from otb::FilterWatcherBase
virtual void ShowProgressCallback ()
 
virtual void StartFilterCallback ()
 
virtual void EndFilterCallback ()
 

Private Attributes

std::string m_Buffer
 
PrintCallbackType * m_Callback
 
int m_CurrentNbStars
 
std::shared_ptr
< PrintCallbackType > 
m_DefaultCallback
 
int m_StarsCount
 

Additional Inherited Members

- Protected Types inherited from otb::FilterWatcherBase
typedef
itk::SimpleMemberCommand
< FilterWatcherBase
CommandType
 
- Protected Attributes inherited from otb::FilterWatcherBase
std::string m_Comment
 
bool m_Ended
 
CommandType::Pointer m_EndFilterCommand
 
unsigned long m_EndTag
 
itk::ProcessObject::Pointer m_Process
 
CommandType::Pointer m_ProgressFilterCommand
 
unsigned long m_ProgressTag
 
bool m_Started
 
CommandType::Pointer m_StartFilterCommand
 
unsigned long m_StartTag
 
otb::Stopwatch m_Stopwatch
 

Detailed Description

template<class PrintCallbackType = StandardOutputPrintCallback>
class otb::StandardOneLineFilterWatcher< PrintCallbackType >

This class shows the percentage progress execution of the pipeline filtering process.

This class is based on Observer design patter Abstract class ProcessObject is the subject Event are observers

Usage example:

FilterType::Pointer thresholdFilter = FilterType::New();
StandardOneLineFilterWatcher watcher(thresholdFilter, "Threshold");
See Also
otb::StandardOutputPrintCallback
itk::SimpleFilterWatcher
otb::fltkFilterWatcher

Definition at line 58 of file otbStandardOneLineFilterWatcher.h.

Constructor & Destructor Documentation

template<class PrintCallbackType >
otb::StandardOneLineFilterWatcher< PrintCallbackType >::StandardOneLineFilterWatcher ( itk::ProcessObject process,
const char *  comment = "" 
)

Constructor. Takes a ProcessObject to monitor and an optional comment string that is prepended to each event message.

Definition at line 46 of file otbStandardOneLineFilterWatcher.hxx.

template<class PrintCallbackType >
otb::StandardOneLineFilterWatcher< PrintCallbackType >::StandardOneLineFilterWatcher ( itk::ProcessObject process,
const std::string &  comment = "" 
)

Definition at line 58 of file otbStandardOneLineFilterWatcher.hxx.

template<class PrintCallbackType >
otb::StandardOneLineFilterWatcher< PrintCallbackType >::StandardOneLineFilterWatcher ( )

Default constructor

Definition at line 36 of file otbStandardOneLineFilterWatcher.hxx.

template<class PrintCallbackType = StandardOutputPrintCallback>
otb::StandardOneLineFilterWatcher< PrintCallbackType >::~StandardOneLineFilterWatcher ( )
overridedefault

Destrucotr

Member Function Documentation

template<class PrintCallbackType >
void otb::StandardOneLineFilterWatcher< PrintCallbackType >::EndFilter ( )
overrideprotectedvirtual

Callback method to show the EndEvent

Implements otb::FilterWatcherBase.

Definition at line 128 of file otbStandardOneLineFilterWatcher.hxx.

template<class PrintCallbackType = StandardOutputPrintCallback>
const int& otb::StandardOneLineFilterWatcher< PrintCallbackType >::GetStars ( ) const
inline

Get/Set number of stars

Definition at line 80 of file otbStandardOneLineFilterWatcher.h.

template<class PrintCallbackType = StandardOutputPrintCallback>
void otb::StandardOneLineFilterWatcher< PrintCallbackType >::SetCallback ( PrintCallbackType *  callback)
inline

Set the callback class

Definition at line 87 of file otbStandardOneLineFilterWatcher.h.

template<class PrintCallbackType = StandardOutputPrintCallback>
void otb::StandardOneLineFilterWatcher< PrintCallbackType >::SetStars ( int  count)
inline

Get/Set number of stars

Definition at line 76 of file otbStandardOneLineFilterWatcher.h.

template<class PrintCallbackType >
void otb::StandardOneLineFilterWatcher< PrintCallbackType >::ShowProgress ( )
overrideprotectedvirtual

Callback method to show the ProgressEvent

Implements otb::FilterWatcherBase.

Definition at line 71 of file otbStandardOneLineFilterWatcher.hxx.

template<class PrintCallbackType >
void otb::StandardOneLineFilterWatcher< PrintCallbackType >::StartFilter ( )
overrideprotectedvirtual

Callback method to show the StartEvent

Implements otb::FilterWatcherBase.

Definition at line 120 of file otbStandardOneLineFilterWatcher.hxx.

Member Data Documentation

template<class PrintCallbackType = StandardOutputPrintCallback>
std::string otb::StandardOneLineFilterWatcher< PrintCallbackType >::m_Buffer
private

If the output is not interactive (e.g. it is redirected to a file), it is buffered and only written at the end of the processing

Definition at line 114 of file otbStandardOneLineFilterWatcher.h.

template<class PrintCallbackType = StandardOutputPrintCallback>
PrintCallbackType* otb::StandardOneLineFilterWatcher< PrintCallbackType >::m_Callback
private

The point to the callback used for printing. It is set to the default callback on construction and can be changed later using the setter. Delete will not be called on this pointer.

Definition at line 119 of file otbStandardOneLineFilterWatcher.h.

template<class PrintCallbackType = StandardOutputPrintCallback>
int otb::StandardOneLineFilterWatcher< PrintCallbackType >::m_CurrentNbStars
private

Current number of stars, we keep track of this to avoid reprinting the progress if it hasn't changed

Definition at line 110 of file otbStandardOneLineFilterWatcher.h.

template<class PrintCallbackType = StandardOutputPrintCallback>
std::shared_ptr<PrintCallbackType> otb::StandardOneLineFilterWatcher< PrintCallbackType >::m_DefaultCallback
private

A default callback created in the constructor and deleted in the destructor.

Definition at line 123 of file otbStandardOneLineFilterWatcher.h.

template<class PrintCallbackType = StandardOutputPrintCallback>
int otb::StandardOneLineFilterWatcher< PrintCallbackType >::m_StarsCount
private

Stars counting

Definition at line 106 of file otbStandardOneLineFilterWatcher.h.


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