OTB  9.0.0
Orfeo Toolbox
Public Member Functions | 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

 StandardOneLineFilterWatcher ()
 
 StandardOneLineFilterWatcher (itk::ProcessObject *process, const char *comment="")
 
 StandardOneLineFilterWatcher (itk::ProcessObject *process, const std::string &comment="")
 
 ~StandardOneLineFilterWatcher () override=default
 
- Public Member Functions inherited from otb::FilterWatcherBase
 FilterWatcherBase ()
 
 FilterWatcherBase (const FilterWatcherBase &)
 
 FilterWatcherBase (itk::ProcessObject *process, const char *comment="")
 
std::string GetComment ()
 
const char * GetNameOfClass ()
 
itk::ProcessObject * GetProcess ()
 
otb::StopwatchGetStopwatch ()
 
void operator= (const FilterWatcherBase &)
 
virtual ~FilterWatcherBase ()
 
int m_StarsCount
 
int m_CurrentNbStars
 
std::string m_Buffer
 
PrintCallbackType * m_Callback
 
std::shared_ptr< PrintCallbackType > m_DefaultCallback
 
void SetStars (int count)
 
const int & GetStars () const
 
void SetCallback (PrintCallbackType *callback)
 
void ShowProgress () override
 
void StartFilter () override
 
void EndFilter () override
 

Additional Inherited Members

- Protected Types inherited from otb::FilterWatcherBase
typedef itk::SimpleMemberCommand< FilterWatcherBaseCommandType
 
- Protected Member Functions inherited from otb::FilterWatcherBase
virtual void ShowProgressCallback ()
 
virtual void StartFilterCallback ()
 
virtual void EndFilterCallback ()
 
- Protected Attributes inherited from otb::FilterWatcherBase
otb::Stopwatch m_Stopwatch
 
std::string m_Comment
 
itk::ProcessObject::Pointer m_Process
 
CommandType::Pointer m_StartFilterCommand
 
CommandType::Pointer m_EndFilterCommand
 
CommandType::Pointer m_ProgressFilterCommand
 
unsigned long m_StartTag
 
unsigned long m_EndTag
 
unsigned long m_ProgressTag
 
bool m_Started
 
bool m_Ended
 

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:

typedef itk::BinaryThresholdImageFilter<ImageType> FilterType;
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

◆ StandardOneLineFilterWatcher() [1/3]

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 42 of file otbStandardOneLineFilterWatcher.hxx.

◆ StandardOneLineFilterWatcher() [2/3]

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

Definition at line 50 of file otbStandardOneLineFilterWatcher.hxx.

◆ StandardOneLineFilterWatcher() [3/3]

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

Default constructor

Definition at line 35 of file otbStandardOneLineFilterWatcher.hxx.

◆ ~StandardOneLineFilterWatcher()

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

Destrucotr

Member Function Documentation

◆ EndFilter()

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

Callback method to show the EndEvent

Implements otb::FilterWatcherBase.

Definition at line 109 of file otbStandardOneLineFilterWatcher.hxx.

◆ GetStars()

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

Stars counting

Definition at line 78 of file otbStandardOneLineFilterWatcher.h.

◆ SetCallback()

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

Set the callback class

Definition at line 85 of file otbStandardOneLineFilterWatcher.h.

◆ SetStars()

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

Get/Set number of stars

Definition at line 74 of file otbStandardOneLineFilterWatcher.h.

◆ ShowProgress()

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

Callback method to show the ProgressEvent

Implements otb::FilterWatcherBase.

Definition at line 58 of file otbStandardOneLineFilterWatcher.hxx.

◆ StartFilter()

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

Callback method to show the StartEvent

Implements otb::FilterWatcherBase.

Definition at line 103 of file otbStandardOneLineFilterWatcher.hxx.

Member Data Documentation

◆ m_Buffer

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 110 of file otbStandardOneLineFilterWatcher.h.

◆ m_Callback

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 115 of file otbStandardOneLineFilterWatcher.h.

◆ m_CurrentNbStars

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 106 of file otbStandardOneLineFilterWatcher.h.

◆ m_DefaultCallback

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 119 of file otbStandardOneLineFilterWatcher.h.

◆ m_StarsCount

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

Stars counting

Definition at line 102 of file otbStandardOneLineFilterWatcher.h.


The documentation for this class was generated from the following files:
otb::StandardOneLineFilterWatcher::StandardOneLineFilterWatcher
StandardOneLineFilterWatcher()
Definition: otbStandardOneLineFilterWatcher.hxx:35