From f34b7ce3aff61b419860345b11a1bccc5ae61abc Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@cnes.fr>
Date: Mon, 19 Nov 2018 13:44:54 +0100
Subject: [PATCH] ENH: replace non const GetFunctor() by GetModifiableFunctor()

---
 .../Functor/include/otbFunctorImageFilter.h   | 23 +++++++++++--------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/Modules/Core/Functor/include/otbFunctorImageFilter.h b/Modules/Core/Functor/include/otbFunctorImageFilter.h
index 2b2be20a40..24dfd5569f 100644
--- a/Modules/Core/Functor/include/otbFunctorImageFilter.h
+++ b/Modules/Core/Functor/include/otbFunctorImageFilter.h
@@ -267,21 +267,24 @@ public:
   /** Run-time type information (and related methods). */
   itkTypeMacro(FunctorImageFilter, ImageToImageFilter);
   
-  
-  /** Get the functor object.  The functor is returned by reference.
-   * (Functors do not have to derive from itk::LightObject, so they do
-   * not necessarily have a reference count. So we cannot return a
-   * SmartPointer.) */
-  FunctorType& GetFunctor()
+  /** Get the functor object.
+   * 
+   *  \return A non-const reference to the Functor in use. Note that
+   *  this call will call the Modified() function of the filter, which
+   *  will trigger a full output computation upon Update(). For
+   *  inspection only, prefer using GetFunctor()
+   */
+  FunctorType& GetModifiableFunctor()
   {
     this->Modified();
     return m_Functor;
   }
 
-  /** Get the functor object.  The functor is returned by reference.
-   * (Functors do not have to derive from itk::LightObject, so they do
-   * not necessarily have a reference count. So we cannot return a
-   * SmartPointer.) */
+  /** Get the functor object.  
+   * 
+   *  \return A const reference to the Functor in use. For a
+   *  modifiable version of the functor, see GetModifiableFunctor().
+   */
   const FunctorType& GetFunctor() const
   {
     return m_Functor;
-- 
GitLab