From 283fd795b2c1d6f43de7ff88ef27167b24e46974 Mon Sep 17 00:00:00 2001
From: Otmane Lahlou <otmane.lahlou@c-s.fr>
Date: Wed, 21 Sep 2011 14:51:42 +0200
Subject: [PATCH] ADD : Class implementing an Event storing a pointer to a
 itk::ProcessObject and a string describing it.

---
 .../otbWrapperAddProcessToWatchEvent.h        | 89 +++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100644 Code/ApplicationEngine/otbWrapperAddProcessToWatchEvent.h

diff --git a/Code/ApplicationEngine/otbWrapperAddProcessToWatchEvent.h b/Code/ApplicationEngine/otbWrapperAddProcessToWatchEvent.h
new file mode 100644
index 0000000000..4bd85a5376
--- /dev/null
+++ b/Code/ApplicationEngine/otbWrapperAddProcessToWatchEvent.h
@@ -0,0 +1,89 @@
+/*=========================================================================
+
+  Program:   ORFEO Toolbox
+  Language:  C++
+  Date:      $Date$
+  Version:   $Revision$
+
+
+  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
+  See OTBCopyright.txt for details.
+
+
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+#ifndef __otbWrapperAddProcessToWatchEvent_h
+#define __otbWrapperAddProcessToWatchEvent_h
+
+#include "itkEventObject.h"
+#include "itkProcessObject.h"
+
+namespace otb
+{
+namespace Wrapper
+{
+
+/** \class AddProcessToWatchEvent
+ *  \brief This class implements an event storing a pointer to
+ *  itk::ProcessObject and a string describing the process.
+ * 
+ */
+class ITK_EXPORT AddProcessToWatchEvent: public itk::EventObject
+{
+public:
+ 
+  typedef AddProcessToWatchEvent Self; 
+  typedef itk::EventObject       Superclass; 
+
+  AddProcessToWatchEvent(){}
+  AddProcessToWatchEvent(const Self& s) :itk::EventObject(s){};
+  virtual ~AddProcessToWatchEvent() {}
+
+  /** Set/Get the process to watch */
+  virtual void SetProcess(itk::ProcessObject * process)
+  {
+    m_Process = process;
+  }
+  virtual itk::ProcessObject * GetProcess() const
+  {
+    return m_Process;
+  }
+
+  /** Set/Get the process description */
+  virtual void SetProcessDescription(const std::string desc)
+  {
+    m_ProcessDescription = desc;
+  }
+
+  virtual  std::string GetProcessDescription() const
+  {
+    return m_ProcessDescription;
+  }
+
+  /** Virtual pure method to implement */
+  virtual itk::EventObject* MakeObject() const
+  {
+    return new Self;    
+  }
+  
+  virtual const char* GetEventName() const
+  {
+    return "AddProcess";
+  }
+  virtual bool CheckEvent(const itk::EventObject* e) const
+  {
+    return dynamic_cast<const Self*>(e); 
+  }
+
+private:
+  itk::ProcessObject::Pointer m_Process;
+  std::string                 m_ProcessDescription;
+};
+
+}
+}
+
+#endif
-- 
GitLab