fw4spl
ImageIOFactoryRegistrar.hxx
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 
8 #ifndef __FWITKIO_IMAGEIOFACTORYREGISTRAR_HXX__
9 #define __FWITKIO_IMAGEIOFACTORYREGISTRAR_HXX__
10 
11 #include <itkObjectFactoryBase.h>
12 
13 namespace fwItkIO
14 {
15 
22 template< class ConcreteImageIOFactory >
24 {
25 public:
27  {
28  ::itk::ObjectFactoryBase::RegisterFactory( ConcreteImageIOFactory::New() );
29  }
30 };
31 
32 }
33 
38 #define REGISTER_IMAGEIOFACTORY( ConcreteImageIOFactory ) static ::fwItkIO::ImageIOFactoryRegistrar< \
39  ConcreteImageIOFactory > registrar;
40 
41 #endif //__FWITKIO_IMAGEIOFACTORYREGISTRAR_HXX__
The namespace fwItkIO contains reader, writer and helper for itk image.
The purpose of this class is to automatically register a Concrete ImageIOFactory in the factory datab...