Inviwo  0.9.10.1
Inviwo documentation
inviwo::DataReaderFactory Class Reference
+ Inheritance diagram for inviwo::DataReaderFactory:

Public Types

using Map = std::unordered_map< FileExtension, DataReader * >
 

Public Member Functions

bool registerObject (DataReader *reader)
 
bool unRegisterObject (DataReader *reader)
 
virtual std::unique_ptr< DataReadercreate (const FileExtension &key) const override
 
virtual std::unique_ptr< DataReadercreate (const std::string &key) const
 
virtual bool hasKey (const std::string &key) const
 
virtual bool hasKey (const FileExtension &key) const override
 
template<typename T >
std::vector< FileExtensiongetExtensionsForType () const
 
template<typename T >
std::unique_ptr< DataReaderType< T > > getReaderForTypeAndExtension (const std::string &ext) const
 
template<typename T >
std::unique_ptr< DataReaderType< T > > getReaderForTypeAndExtension (const FileExtension &ext) const
 
template<typename T >
std::unique_ptr< DataReaderType< T > > getReaderForTypeAndExtension (const FileExtension &ext, const std::string &fallbackExt) const
 
template<typename T >
bool hasReaderForTypeAndExtension (const std::string &ext) const
 
template<typename T >
bool hasReaderForTypeAndExtension (const FileExtension &ext) const
 
- Public Member Functions inherited from inviwo::Factory< DataReader, const FileExtension & >
virtual std::unique_ptr< DataReadercreate (const FileExtension & key, Args... args) const=0
 
- Public Member Functions inherited from inviwo::FactoryBase
 FactoryBase (const FactoryBase &)=delete
 
FactoryBaseoperator= (const FactoryBase &)=delete
 
 FactoryBase (FactoryBase &&)=default
 
FactoryBaseoperator= (FactoryBase &&)=default
 

Protected Attributes

Map map_
 

Member Function Documentation

◆ getReaderForTypeAndExtension()

template<typename T >
std::unique_ptr< DataReaderType< T > > inviwo::DataReaderFactory::getReaderForTypeAndExtension ( const FileExtension ext,
const std::string &  fallbackExt 
) const

First look for a reader using the FileExtension ext, and if no reader was found look for a reader using the fallbackExt. This is often used with a file open dialog, where the dialog will have a selectedFileExtension that will be used as ext, and the fallbackExt is taken from the file to be opened. This way any selected reader will have priority over the file extension.


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