OpenWalnut  1.4.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
WBatchLoader Class Reference

Class for loading many datasets. More...

#include <WBatchLoader.h>

+ Inheritance diagram for WBatchLoader:

List of all members.

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.

Detailed Description

Class for loading many datasets.

It runs in a separate thread.

Definition at line 46 of file WBatchLoader.h.


Member Typedef Documentation

typedef boost::shared_ptr< const WBatchLoader > WBatchLoader::ConstSPtr

Const shared ptr abbreviation.

Definition at line 58 of file WBatchLoader.h.

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.


Constructor & Destructor Documentation

WBatchLoader::WBatchLoader ( std::vector< std::string >  filenames,
boost::shared_ptr< WModuleContainer targetContainer 
)

Initializes the batchloader but does not start it.

Use run().

Parameters:
filenamesthe files to load.
targetContainerthe container to which the data modules should be added.

Definition at line 34 of file WBatchLoader.cpp.

Destructor.

Definition at line 44 of file WBatchLoader.cpp.


Member Function Documentation

Returns a ticket to the list of data modules that have been added so far.

Returns:
the ticket

Definition at line 84 of file WBatchLoader.cpp.

References WSharedObject< T >::getReadTicket(), and m_dataModules.

Checks whether suppression of colormaps is active.

Returns:
true if colormaps are suppressed.

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.

Notes:
call this before run().
Parameters:
suppresstrue 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().


Member Data Documentation

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]

List of files to load.

Definition at line 117 of file WBatchLoader.h.

Referenced by threadMain().

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().


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