OpenWalnut
1.4.0
|
Class for loading many datasets. More...
#include <WBatchLoader.h>
Public Types | |
typedef boost::shared_ptr < WBatchLoader > | SPtr |
Shared ptr abbreviation. | |
typedef boost::shared_ptr < const WBatchLoader > | ConstSPtr |
Const shared ptr abbreviation. | |
typedef WSharedSequenceContainer < std::vector < WDataModule::SPtr > > | DataModuleList |
The type is used to store the list of data modules. | |
Public Member Functions | |
WBatchLoader (std::vector< std::string > filenames, boost::shared_ptr< WModuleContainer > targetContainer) | |
Initializes the batchloader but does not start it. | |
virtual | ~WBatchLoader () |
Destructor. | |
virtual void | run () |
Run thread and load the data. | |
DataModuleList::ReadTicket | getDataModuleList () const |
Returns a ticket to the list of data modules that have been added so far. | |
void | setSuppressColormaps (bool suppress=true) |
Allows suppression of colormap registration in data modules. | |
bool | getSuppressColormaps () const |
Checks whether suppression of colormaps is active. | |
Protected Member Functions | |
virtual void | threadMain () |
Function that has to be overwritten for execution. | |
Protected Attributes | |
std::vector< std::string > | m_filenamesToLoad |
List of files to load. | |
boost::shared_ptr < WModuleContainer > | m_targetContainer |
The container which later will contain the loaded datasets. | |
DataModuleList | m_dataModules |
The list of modules that have been added. | |
bool | m_suppressColormaps |
If true, data modules are instructed to suppress colormap registration. |
Class for loading many datasets.
It runs in a separate thread.
Definition at line 46 of file WBatchLoader.h.
typedef boost::shared_ptr< const WBatchLoader > WBatchLoader::ConstSPtr |
Const shared ptr abbreviation.
Definition at line 58 of file WBatchLoader.h.
typedef WSharedSequenceContainer< std::vector< WDataModule::SPtr > > WBatchLoader::DataModuleList |
The type is used to store the list of data modules.
Definition at line 63 of file WBatchLoader.h.
typedef boost::shared_ptr< WBatchLoader > WBatchLoader::SPtr |
Shared ptr abbreviation.
Definition at line 53 of file WBatchLoader.h.
WBatchLoader::WBatchLoader | ( | std::vector< std::string > | filenames, |
boost::shared_ptr< WModuleContainer > | targetContainer | ||
) |
Initializes the batchloader but does not start it.
Use run().
filenames | the files to load. |
targetContainer | the container to which the data modules should be added. |
Definition at line 34 of file WBatchLoader.cpp.
WBatchLoader::~WBatchLoader | ( | ) | [virtual] |
Destructor.
Definition at line 44 of file WBatchLoader.cpp.
Returns a ticket to the list of data modules that have been added so far.
Definition at line 84 of file WBatchLoader.cpp.
References WSharedObject< T >::getReadTicket(), and m_dataModules.
bool WBatchLoader::getSuppressColormaps | ( | ) | const |
Checks whether suppression of colormaps is active.
Definition at line 94 of file WBatchLoader.cpp.
References m_suppressColormaps.
void WBatchLoader::run | ( | ) | [virtual] |
Run thread and load the data.
Reimplemented from WThreadedRunner.
Definition at line 49 of file WBatchLoader.cpp.
References m_targetContainer.
void WBatchLoader::setSuppressColormaps | ( | bool | suppress = true | ) |
Allows suppression of colormap registration in data modules.
This can be handy if you use data modules in a container to construct more complex data sets from multiple input files.
suppress | true if suppress |
Definition at line 89 of file WBatchLoader.cpp.
References m_suppressColormaps.
void WBatchLoader::threadMain | ( | ) | [protected, virtual] |
Function that has to be overwritten for execution.
It gets executed in a separate thread after run() has been called.
Reimplemented from WThreadedRunner.
Definition at line 58 of file WBatchLoader.cpp.
References WModuleFactory::getModuleFactory(), m_dataModules, m_filenamesToLoad, m_suppressColormaps, m_targetContainer, WSharedSequenceContainer< S >::push_back(), and WDataModule::setSuppressColormaps().
DataModuleList WBatchLoader::m_dataModules [protected] |
The list of modules that have been added.
Definition at line 127 of file WBatchLoader.h.
Referenced by getDataModuleList(), and threadMain().
std::vector< std::string > WBatchLoader::m_filenamesToLoad [protected] |
bool WBatchLoader::m_suppressColormaps [protected] |
If true, data modules are instructed to suppress colormap registration.
Definition at line 132 of file WBatchLoader.h.
Referenced by getSuppressColormaps(), setSuppressColormaps(), and threadMain().
boost::shared_ptr< WModuleContainer > WBatchLoader::m_targetContainer [protected] |
The container which later will contain the loaded datasets.
Definition at line 122 of file WBatchLoader.h.
Referenced by run(), and threadMain().