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

Public Types

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

Public Member Functions

bool registerObject (DataWriter *reader)
 
bool unRegisterObject (DataWriter *reader)
 
virtual std::unique_ptr< DataWritercreate (const std::string &key) const
 
virtual std::unique_ptr< DataWritercreate (const FileExtension &key) const override
 
virtual bool hasKey (const std::string &key) const
 
virtual bool hasKey (const FileExtension &key) const override
 
template<typename T >
std::vector< FileExtensiongetExtensionsForType ()
 
template<typename T >
std::unique_ptr< DataWriterType< T > > getWriterForTypeAndExtension (const std::string &ext)
 
template<typename T >
std::unique_ptr< DataWriterType< T > > getWriterForTypeAndExtension (const FileExtension &ext)
 
template<typename T >
std::unique_ptr< DataWriterType< T > > getWriterForTypeAndExtension (const FileExtension &ext, const std::string &fallbackExt)
 
- Public Member Functions inherited from inviwo::Factory< DataWriter, const FileExtension & >
virtual std::unique_ptr< DataWritercreate (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

◆ getWriterForTypeAndExtension()

template<typename T >
std::unique_ptr< DataWriterType< T > > inviwo::DataWriterFactory::getWriterForTypeAndExtension ( const FileExtension ext,
const std::string &  fallbackExt 
)

First look for a writer using the FileExtension ext, and if no writer was found look for a writer 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 written. This way any selected writer will have priority over the file extension.


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