20 #ifndef MIRTK_ImageReaderFactory_H 21 #define MIRTK_ImageReaderFactory_H 23 #include "mirtk/ObjectFactory.h" 24 #include "mirtk/ImageReader.h" 25 #include "mirtk/List.h" 70 typedef List<ImageReaderCreator> Creators;
94 #define mirtkRegisterImageReaderMacro(type) \ 95 mirtk::ImageReaderFactory::Instance() \ 96 .Register(mirtk::New<mirtk::ImageReader, type>) 100 #ifdef MIRTK_AUTO_REGISTER 101 #define mirtkAutoRegisterImageReaderMacro(type) \ 103 static auto _##type##Registered = \ 104 mirtk::ImageReaderFactory::Instance() \ 105 .Register(mirtk::New<mirtk::ImageReader, type>); \ 107 #else // MIRTK_AUTO_REGISTER 108 #define mirtkAutoRegisterImageReaderMacro(type) 109 #endif // MIRTK_AUTO_REGISTER 114 #endif // MIRTK_ImageReaderFactory_H static ImageReaderFactory & Instance()
ImageReader *(* ImageReaderCreator)()
Type of object creator.
ImageReader * New(const char *fname) const
bool Register(ImageReaderCreator creator)