]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/ImageWriter.h
Garbage collector added
[cpPlugins.git] / lib / cpPlugins / Plugins / ImageWriter.h
index 57f15db0e36d8d022e0fde1a9d76b209765f0084..1dcd98f5dbaf9534c2634a3160aca1b8cb10d95a 100644 (file)
@@ -2,7 +2,7 @@
 #define __CPPLUGINS__PLUGINS__IMAGEWRITER__H__
 
 #include <cpPlugins/Plugins/cpPlugins_Export.h>
-#include <cpPlugins/Interface/SinkObject.h>
+#include <cpPlugins/Interface/ImageSink.h>
 #include <itkProcessObject.h>
 
 namespace cpPlugins
@@ -12,22 +12,28 @@ namespace cpPlugins
     /**
      */
     class cpPlugins_EXPORT ImageWriter
-      : public cpPlugins::Interface::SinkObject
+      : public cpPlugins::Interface::ImageSink
     {
     public:
-      typedef ImageWriter                      Self;
-      typedef cpPlugins::Interface::SinkObject Superclass;
+      typedef ImageWriter                     Self;
+      typedef cpPlugins::Interface::ImageSink Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
 
       typedef Superclass::TParameter  TParameter;
       typedef Superclass::TParameters TParameters;
 
     public:
-      ImageWriter( );
-      virtual ~ImageWriter( );
+      itkNewMacro( Self );
+      itkTypeMacro( ImageWriter, cpPluginsInterfaceImageSink );
 
+    public:
       virtual std::string GetClassName( ) const;
 
     protected:
+      ImageWriter( );
+      virtual ~ImageWriter( );
+
       virtual std::string _GenerateData( );
 
       template< unsigned int D >
@@ -36,12 +42,17 @@ namespace cpPlugins
       template< class P, unsigned int D >
       std::string _GD1( );
 
-    protected:
-      itk::ProcessObject::Pointer m_Writer;
+    private:
+      // Purposely not implemented
+      ImageWriter( const Self& );
+      Self& operator=( const Self& );
     };
 
     // ---------------------------------------------------------------------
-    PLUMA_INHERIT_PROVIDER( ImageWriter, cpPlugins::Interface::Object );
+    PLUMA_INHERIT_PROVIDER_CPPLUGINS(
+      ImageWriter,
+      cpPlugins::Interface::Object
+      );
 
   } // ecapseman