Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
d7344ce3
Commit
d7344ce3
authored
13 years ago
by
Julien Malik
Browse files
Options
Downloads
Patches
Plain Diff
BUG: fix FilterWatcher to avoid calling the start/end callback several times
parent
d4821622
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbFilterWatcherBase.cxx
+14
-7
14 additions, 7 deletions
Code/Common/otbFilterWatcherBase.cxx
Code/Common/otbFilterWatcherBase.h
+18
-2
18 additions, 2 deletions
Code/Common/otbFilterWatcherBase.h
with
32 additions
and
9 deletions
Code/Common/otbFilterWatcherBase.cxx
+
14
−
7
View file @
d7344ce3
...
...
@@ -25,20 +25,27 @@ namespace otb
FilterWatcherBase
::
FilterWatcherBase
()
:
m_Comment
(
"Not watching an object"
),
m_Process
(
0
),
m_StartTag
(
0
),
m_EndTag
(
0
),
m_ProgressTag
(
0
),
m_Started
(
false
),
m_Ended
(
false
)
{
// Initialize state
m_Comment
=
"Not watching an object"
;
m_Process
=
0
;
}
FilterWatcherBase
::
FilterWatcherBase
(
itk
::
ProcessObject
*
process
,
const
char
*
comment
)
:
m_Comment
(
comment
),
m_Process
(
process
),
m_StartTag
(
0
),
m_EndTag
(
0
),
m_ProgressTag
(
0
),
m_Started
(
false
),
m_Ended
(
false
)
{
// Initialize state
m_Process
=
process
;
m_Comment
=
comment
;
// Create a series of commands
m_StartFilterCommand
=
CommandType
::
New
();
m_EndFilterCommand
=
CommandType
::
New
();
...
...
This diff is collapsed.
Click to expand it.
Code/Common/otbFilterWatcherBase.h
+
18
−
2
View file @
d7344ce3
...
...
@@ -94,13 +94,21 @@ protected:
/** Callback method to show the StartEvent */
virtual
void
StartFilterCallback
()
{
this
->
StartFilter
();
if
(
!
m_Started
)
{
this
->
StartFilter
();
m_Started
=
true
;
}
}
/** Callback method to show the EndEvent */
virtual
void
EndFilterCallback
()
{
this
->
EndFilter
();
if
(
!
m_Ended
)
{
this
->
EndFilter
();
m_Ended
=
true
;
}
}
/** Callback method to show the ProgressEvent */
...
...
@@ -142,6 +150,14 @@ protected:
/** Progress observer */
unsigned
long
m_ProgressTag
;
/** Some filters (for ex. persistents) invoke the StartEvent several times
* Work around this by remembering if it was called or not */
bool
m_Started
;
/** Some filters (for ex. persistents) invoke the EndEvent several times
* Work around this by remembering if it was called or not */
bool
m_Ended
;
private
:
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment