21#ifndef ph_IOhandler_hh
22#define ph_IOhandler_hh
49 typedef typename I::Data
Data;
52 typedef typename std::shared_ptr<Data >
PData;
61 typedef std::multimap<std::string, std::string>
CSuffixmap;
93 bool save(
const std::string& fname,
const Data& data)
const;
136 void do_initialise();
142 std::set<std::string> m_compress_sfx;
146 void do_print_help(std::ostream& os)
const;
148 std::string get_handler_type_string_and_help(std::ostream& os)
const;
149 std::string do_get_handler_type_string()
const;
150 bool do_validate_parameter_string(
const std::string& s)
const;
152 virtual void check_file_exists(
const std::string& fname)
const;
162 PData do_load(
const std::string& fname)
const;
163 bool do_save(
const std::string& fname,
164 const typename Interface::Data& data)
const;
165 const std::string do_get_descr()
const;
166 const std::string do_get_preferred_suffix()
const;
169 std::shared_ptr<Interface> m_pool_plugin;
176#define EXPLICITE_INSTANCEIATE_IO_HANDLER(IOTYPE) \
177 template class TIOPlugin<IOTYPE>; \
178 template class THandlerSingleton<TIOPluginHandler<TIOPlugin<IOTYPE>>>; \
179 template class TIOPluginHandler<TIOPlugin<IOTYPE>>; \
180 template class TPluginHandler<TIOPlugin<IOTYPE>> \
184template <
typename Data>
196 static_assert(
sizeof(T) == 0,
"The call to load_image must be resolved to a template specialization");
A parameter proxy object with a key to identify it.
the singleton that a plug-in handler really is
Template for all plug-in handlers that are responsible for data IO.
DataKey load_to_pool(const std::string &fname) const
TPluginHandler< I >::const_iterator const_iterator
an iterator over the available plug-ins
const CSuffixmap & get_supported_filetype_map() const
TPluginHandler< I >::Interface Interface
the IO interface provided by this handler
bool save(const std::string &fname, const Data &data) const
const std::string get_supported_suffixes() const
@ returns a string containing the supported file type suffixes
std::multimap< std::string, std::string > CSuffixmap
The map that maps file name suffixes to IO plug-ins.
std::string get_preferred_suffix(const std::string &type) const
PData load(const std::string &fname) const
TDelayedParameter< PData > DataKey
The type of the key used for the CDatapool access.
const std::set< std::string > get_supported_suffix_set() const
@ returns a saet containing the supported file type suffixes
I::Data Data
Data type handled by this plug-in.
std::shared_ptr< Data > PData
Shared pointer to the data hadnled by this plug-in.
const Interface & preferred_plugin(const std::string &fname) const
const Interface * preferred_plugin_ptr(const std::string &fname) const
The basic template of all plugin handlers.
CPluginMap::const_iterator const_iterator
the iterator to walk over the available plug-ins
I Interface
typedef for the plug-in interface provided by the class
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
#define NS_MIA_END
conveniance define to end the mia namespace
T load_image(const std::string &filename)
THandlerSingleton< TIOPluginHandler< TIOPlugin< Data > > > type