simplify factory class to not rely on singleton + cleanups

This commit is contained in:
artemp
2014-11-14 12:23:27 +01:00
parent e3adc4664b
commit 761b2ba583
3 changed files with 17 additions and 29 deletions

View File

@@ -43,25 +43,10 @@ image_reader* get_image_reader(char const* data, size_t size)
boost::optional<std::string> type = type_from_bytes(data,size);
if (type)
{
return factory<image_reader,std::string,char const*,size_t>::instance().create_object(*type, data,size);
return factory<image_reader,std::string,char const*,size_t>::create_object(*type, data,size);
}
else
throw image_reader_exception("image_reader: can't determine type from input data");
}
//image_reader* get_image_reader(std::string const& filename,std::string const& type)
//{
// return factory<image_reader,std::string,std::string const&>::instance().create_object(type,filename);
//}
//image_reader* get_image_reader(std::string const& filename)
//{
//boost::optional<std::string> type = type_from_filename(filename);
//if (type)
//{
// return factory<image_reader,std::string,std::string const&>::instance().create_object(*type,filename);
//}
// return 0;
//}
}}