Public Types | Public Member Functions | Protected Member Functions
TIOPlugin< D > Class Template Referenceabstract

The templatex basis class of all IO plug-ins. More...

#include <mia/core/ioplugin.hh>

Inheritance diagram for TIOPlugin< D >:
TPlugin< D, io_plugin_type > CPluginBase

Public Types

typedef D::type Data
 type of the data handled by this plug-in More...
 
typedef std::shared_ptr< DataPData
 shared pointer of the data handled by this plug-in More...
 
typedef std::set< EPixelTypePixelTypeSet
 the type for the supported pixel types of this IO handler More...
 
typedef std::set< std::string > SuffixSet
 
- Public Types inherited from TPlugin< D, io_plugin_type >
typedef D PlugData
 Typedef for the data type descriptor handled by this plug-in. More...
 
typedef io_plugin_type PlugType
 Typedef for the plugin type descriptor handled by this plug-in. More...
 

Public Member Functions

void add_suffixes (std::multimap< std::string, std::string > &map) const
 
std::string get_preferred_suffix () const
 
PData load (const std::string &fname) const
 
bool save (const std::string &fname, const Data &data) const
 
const PixelTypeSetsupported_pixel_types () const
 
 TIOPlugin (const char *name)
 
- Public Member Functions inherited from TPlugin< D, io_plugin_type >
virtual void get_help (std::ostream &os) const
 
const std::string get_long_name () const
 
 TPlugin (const char *name)
 
- Public Member Functions inherited from CPluginBase
void add_dependend_handlers (HandlerHelpMap &handler_map)
 
void add_parameter (const std::string &name, CParameter *param)
 
void append_interface (CPluginBase *plugin)
 
void check_parameters ()
 
 CPluginBase (const char *name)
 
const std::string get_descr () const
 
void get_help_xml (xmlpp::Element &root) const
 
PPluginModule get_module () const
 
const char * get_name () const
 
void get_short_help (std::ostream &os) const
 
bool has_property (const char *property) const
 
CPluginBasenext_interface ()
 
void set_module (const PPluginModule &module)
 
void set_parameters (const CParsedOptions &options)
 
virtual ~CPluginBase ()
 

Protected Member Functions

void add_suffix (const std::string &suffix)
 
void add_supported_type (EPixelType t)
 add pixel type t to the list of supported types More...
 
const SuffixSetget_suffixes () const
 

Additional Inherited Members

- Static Public Member Functions inherited from TPlugin< D, io_plugin_type >
::boost::filesystem::path search_path ()
 

Detailed Description

template<typename D>
class TIOPlugin< D >

The templatex basis class of all IO plug-ins.

The basis of all IO plug-ins. The type D must provied a typedef type the referes to the data type to be handled and it must provied a string value that describes the type of the io data and also corresponds to the last part of the directory name, where the plug-in will be located after installation of the package. The type D must be derived from CIOData, to supply functions to store and acquire the file format used to load the data.

Template Parameters
Dthe data type for witch the IO is implemented

Definition at line 57 of file ioplugin.hh.

Member Typedef Documentation

template<typename D>
typedef D::type TIOPlugin< D >::Data

type of the data handled by this plug-in

Definition at line 61 of file ioplugin.hh.

template<typename D>
typedef std::shared_ptr<Data > TIOPlugin< D >::PData

shared pointer of the data handled by this plug-in

Definition at line 64 of file ioplugin.hh.

template<typename D>
typedef std::set<EPixelType> TIOPlugin< D >::PixelTypeSet

the type for the supported pixel types of this IO handler

Definition at line 67 of file ioplugin.hh.

template<typename D>
typedef std::set<std::string> TIOPlugin< D >::SuffixSet

Definition at line 69 of file ioplugin.hh.

Constructor & Destructor Documentation

template<typename D>
TIOPlugin< D >::TIOPlugin ( const char *  name)

Constructor of the Plugin

Parameters
namethe name of the plug-in, should correnspond to the file type

Member Function Documentation

template<typename D>
void TIOPlugin< D >::add_suffix ( const std::string &  suffix)
protected
template<typename D>
void TIOPlugin< D >::add_suffixes ( std::multimap< std::string, std::string > &  map) const

Adds file suffixes supported by this plug-in to a map to improve loading of files.

Parameters
mapthe map, the suffixes will be added to.
template<typename D>
void TIOPlugin< D >::add_supported_type ( EPixelType  t)
protected

add pixel type t to the list of supported types

template<typename D>
std::string TIOPlugin< D >::get_preferred_suffix ( ) const

Translate the file type decriptor to the file suffix.

Returns
preferred suffix of the file type
Remarks
in most cases this is just a pass-through
template<typename D>
const SuffixSet& TIOPlugin< D >::get_suffixes ( ) const
protected
template<typename D>
PData TIOPlugin< D >::load ( const std::string &  fname) const

the load function, the actual implementation of the loading is implemented in do_load, which has to be implemented in the according plug-in

Parameters
fnamethe file name to be loaded
Returns
a shared pointer to the loaded data, or an empty shared pointer, if no data could be loaded.
template<typename D>
bool TIOPlugin< D >::save ( const std::string &  fname,
const Data data 
) const

The save function. Saves the data to file fname. The actual save function is implemented in do_save and needs to be provied in th eaccording IO plug-in.

Parameters
fnamefile name
datadata to be stored.
Returns
true if the saving was succesfull, false otherwise
template<typename D>
const PixelTypeSet& TIOPlugin< D >::supported_pixel_types ( ) const
Returns
a set of thepixel types, supported by this IO plug-in

The documentation for this class was generated from the following file: