Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkCreateObjectFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkCreateObjectFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-01-26 14:28:44 $
00007   Version:   $Revision: 1.24 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkCreateObjectFunction_h
00018 #define __itkCreateObjectFunction_h
00019 
00020 #include "itkObject.h"
00021 
00022 namespace itk
00023 {
00024 
00030 class CreateObjectFunctionBase: public Object
00031 {
00032 public:
00034   typedef CreateObjectFunctionBase  Self;
00035   typedef Object                    Superclass;
00036   typedef SmartPointer<Self>        Pointer;
00037   typedef SmartPointer<const Self>  ConstPointer;
00038 
00041   virtual SmartPointer<LightObject> CreateObject() = 0;
00042 
00043 protected:
00044   CreateObjectFunctionBase() {}
00045   ~CreateObjectFunctionBase() {}
00046   
00047 private:
00048   CreateObjectFunctionBase(const Self&); //purposely not implemented
00049   void operator=(const Self&); //purposely not implemented  
00050 };
00051 
00052 
00059 template <class T>
00060 class CreateObjectFunction : public CreateObjectFunctionBase
00061 {
00062 public:
00064   typedef CreateObjectFunction  Self;
00065   typedef SmartPointer<Self>    Pointer;
00066 
00068   itkFactorylessNewMacro(Self);
00069   LightObject::Pointer CreateObject() { return T::New().GetPointer(); }
00071 
00072 protected:
00073   CreateObjectFunction() {}
00074   ~CreateObjectFunction() {}
00075   
00076 private:
00077   CreateObjectFunction(const Self&); //purposely not implemented
00078   void operator=(const Self&); //purposely not implemented
00079 };
00080 
00081 } // end namespace itk
00082 
00083 #endif
00084 

Generated at Mon Jul 12 2010 18:09:33 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000