29 #include "WBatchLoader.h"
30 #include "WDataModuleInputFile.h"
32 #include "WModuleContainer.h"
33 #include "WModuleFactory.h"
38 m_filenamesToLoad( filenames ),
39 m_targetContainer( targetContainer ),
40 m_suppressColormaps( false )
72 if( dataModules.empty() )
74 wlog::warn(
"WBatchLoader" ) <<
"File type of " << *iter <<
" not supported. Ignoring.";
85 dmod->setInput( input );
88 dmod->isReadyOrCrashed().wait();
Class for loading many datasets.
virtual void run()
Run thread and load the data.
DataModuleList m_dataModules
The list of modules that have been added.
virtual void threadMain()
Function that has to be overwritten for execution.
DataModuleList::ReadTicket getDataModuleList() const
Returns a ticket to the list of data modules that have been added so far.
std::vector< std::string > m_filenamesToLoad
List of files to load.
bool m_suppressColormaps
If true, data modules are instructed to suppress colormap registration.
virtual ~WBatchLoader()
Destructor.
std::shared_ptr< WModuleContainer > m_targetContainer
The container which later will contain the loaded datasets.
WBatchLoader(std::vector< std::string > filenames, std::shared_ptr< WModuleContainer > targetContainer)
Initializes the batchloader but does not start it.
void setSuppressColormaps(bool suppress=true)
Allows suppression of colormap registration in data modules.
bool getSuppressColormaps() const
Checks whether suppression of colormaps is active.
std::shared_ptr< WDataModule > SPtr
Convenience typedef for a std::shared_ptr< WDataModule >.
static SPtr getModuleFactory()
Returns instance of the module factory to use to create modules.
std::shared_ptr< WSharedObjectTicketRead< T > > ReadTicket
Type for read tickets.
ReadTicket getReadTicket() const
Returns a ticket to get read access to the contained data.
void push_back(const typename S::value_type &x)
Adds a new element at the end of the container.
Base class for all classes needing to be executed in a separate thread.
virtual void run()
Run thread.
WStreamedLogger warn(const std::string &source)
Logging a warning message.