diff --git a/Modules/Core/Common/src/otbFilterWatcherBase.cxx b/Modules/Core/Common/src/otbFilterWatcherBase.cxx index 2e4f9644bba448954ffa458622593cac7afa9f6c..bbb564b02cc7b535e5d7c3cd88563531bb745203 100644 --- a/Modules/Core/Common/src/otbFilterWatcherBase.cxx +++ b/Modules/Core/Common/src/otbFilterWatcherBase.cxx @@ -159,6 +159,7 @@ FilterWatcherBase FilterWatcherBase ::~FilterWatcherBase() { + std::cout<<"A FilterWatcherBase is deleted... Description was "<<m_Comment<<std::endl; // Remove any observers we have on the old process object if (m_Process) { diff --git a/Modules/Core/Common/src/otbStandardOneLineFilterWatcher.cxx b/Modules/Core/Common/src/otbStandardOneLineFilterWatcher.cxx index 77e350402fa99e890d4c53f274b567ea99a83873..84c67d05c946b0f45adea34c79681657f71bcd79 100644 --- a/Modules/Core/Common/src/otbStandardOneLineFilterWatcher.cxx +++ b/Modules/Core/Common/src/otbStandardOneLineFilterWatcher.cxx @@ -29,6 +29,7 @@ StandardOneLineFilterWatcher : m_StarsCount(50), m_CurrentNbStars(-1) { + std::cout<<"A StandardOneLineFilterWatcher is created (default)"<<std::endl; } StandardOneLineFilterWatcher @@ -38,6 +39,7 @@ StandardOneLineFilterWatcher m_StarsCount(50), m_CurrentNbStars(-1) { + std::cout<<"A StandardOneLineFilterWatcher is created with description "<<comment<<std::endl; } StandardOneLineFilterWatcher @@ -47,6 +49,7 @@ StandardOneLineFilterWatcher m_StarsCount(50), m_CurrentNbStars(-1) { + std::cout<<"A StandardOneLineFilterWatcher is created with description "<<comment<<std::endl; } void diff --git a/Modules/Core/ImageBase/include/otbImage.h b/Modules/Core/ImageBase/include/otbImage.h index 53462952afd9754e9468bcd154b3465a311f2165..4eb2ec9388729eb7098640363a393064aee6e875 100644 --- a/Modules/Core/ImageBase/include/otbImage.h +++ b/Modules/Core/ImageBase/include/otbImage.h @@ -179,7 +179,7 @@ public: // { // return AccessorType(); // } - + static int m_Instance; /** Return the NeighborhoodAccessor functor */ NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() { @@ -254,6 +254,8 @@ protected: Image(); ~Image() ITK_OVERRIDE { std::cout<<"An image is deleted"<<std::endl; + m_Instance--; + std::cout<<m_Instance<<" image(s) still live(s)"<<std::endl; } private: diff --git a/Modules/Core/ImageBase/include/otbImage.txx b/Modules/Core/ImageBase/include/otbImage.txx index 01b6fc366941bad6905fdf2dbd184f2e37bea28a..6127e6b48db03cee0a946ddc15a9b8c1a0250eb9 100644 --- a/Modules/Core/ImageBase/include/otbImage.txx +++ b/Modules/Core/ImageBase/include/otbImage.txx @@ -29,10 +29,15 @@ namespace otb { +template <class TPixel, unsigned int VImageDimension> +int Image<TPixel, VImageDimension>::m_Instance = 0; + template <class TPixel, unsigned int VImageDimension> Image<TPixel, VImageDimension>::Image() { std::cout<<"An image is created"<<std::endl; + m_Instance++; + std::cout<<m_Instance<<" image(s) live(s)"<<std::endl; } template <class TPixel, unsigned int VImageDimension> diff --git a/Modules/Core/ImageBase/include/otbVectorImage.h b/Modules/Core/ImageBase/include/otbVectorImage.h index 9e948ec5c914a1fd71162bf18cbf72137c76e2d5..edd3b267c9170a6151e5f4a53e6a6e08d4a8ce14 100644 --- a/Modules/Core/ImageBase/include/otbVectorImage.h +++ b/Modules/Core/ImageBase/include/otbVectorImage.h @@ -179,7 +179,7 @@ public: // { // return AccessorType( this->GetNumberOfComponentsPerPixel() ); // } - + static int m_Instance; /** Return the NeighborhoodAccessor functor */ NeighborhoodAccessorFunctorType GetNeighborhoodAccessor() { @@ -196,6 +196,8 @@ protected: VectorImage(); ~VectorImage() ITK_OVERRIDE { std::cout<<"A vector image is deleted"<<std::endl; + m_Instance--; + std::cout<<m_Instance<<" vector image(s) still live(s)"<<std::endl; } private: diff --git a/Modules/Core/ImageBase/include/otbVectorImage.txx b/Modules/Core/ImageBase/include/otbVectorImage.txx index 83c3f0f6e71dc0b95b90784c9efa7679d95e951a..0d95d4c6e972055086b2ea3fb4dc2a31f86814d6 100644 --- a/Modules/Core/ImageBase/include/otbVectorImage.txx +++ b/Modules/Core/ImageBase/include/otbVectorImage.txx @@ -29,11 +29,15 @@ namespace otb { +template <class TPixel, unsigned int VImageDimension> +int VectorImage<TPixel, VImageDimension>::m_Instance = 0; template <class TPixel, unsigned int VImageDimension> VectorImage<TPixel, VImageDimension>::VectorImage() { std::cout<<"A vector image is created"<<std::endl; + m_Instance++; + std::cout<<m_Instance<<" vector image(s) live(s)"<<std::endl; } template <class TPixel, unsigned int VImageDimension> diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperAddProcessToWatchEvent.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperAddProcessToWatchEvent.h index 3cf9114c81a09c5c329913a69971acb59389bfce..129e1e74ead27906516c18e7b8da61380fc8287c 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperAddProcessToWatchEvent.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperAddProcessToWatchEvent.h @@ -44,9 +44,13 @@ public: typedef AddProcessToWatchEvent Self; typedef itk::EventObject Superclass; - AddProcessToWatchEvent(){} + AddProcessToWatchEvent(){ + std::cout<<"A new AddProcessToWatchEvent is created"<<std::endl; + } AddProcessToWatchEvent(const Self& s) :itk::EventObject(s){}; - ~AddProcessToWatchEvent() ITK_OVERRIDE {} + ~AddProcessToWatchEvent() ITK_OVERRIDE { + std::cout<<"The AddProcessToWatchEvent is deleted... Description was : "<<m_ProcessDescription<<std::endl; + } /** Set/Get the process to watch */ virtual void SetProcess(itk::ProcessObject * process) diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 988f9f72433cacc54a54cfe27c14064fa926c763..89fca70c59c39ca00cbb67bfa515bee32f303403 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -410,6 +410,7 @@ int Application::Execute() int Application::ExecuteAndWriteOutput() { + std::cout<<"Executing..."<<std::endl; m_Chrono.Restart(); int status = this->Execute(); @@ -465,6 +466,7 @@ int Application::ExecuteAndWriteOutput() } std::ostringstream progressId; progressId << "Writing " << outputParam->GetFileName() << "..."; + std::cout<<"Add Process and write"<<std::endl; AddProcess(outputParam->GetWriter(), progressId.str()); outputParam->Write(); }