OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 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.
- Public Member Functions inherited from WThreadedRunner
 WThreadedRunner ()
 Default constructor.
virtual ~WThreadedRunner ()
 Destructor.
void run (THREADFUNCTION f)
 Run thread.
void wait (bool requestFinish=false)
 Wait for the thread to be finished.
virtual void requestStop ()
 This method's purpose is to request a stop without waiting for it.

Protected Member Functions

virtual void threadMain ()
 Function that has to be overwritten for execution.
- Protected Member Functions inherited from WThreadedRunner
virtual void notifyStop ()
 Gets called when the thread should be stopped.
void yield () const
 Give remaining execution timeslice to another thread.
void sleep (const int32_t t) const
 Sets thread asleep.
void msleep (const int32_t t) const
 Sets thread asleep.
void waitForStop ()
 Let the thread sleep until a stop request was given.

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.
- Protected Attributes inherited from WThreadedRunner
boost::thread m_thread
 Thread instance.
WBoolFlag m_shutdownFlag
 Condition getting fired whenever the thread should quit.

Additional Inherited Members

- Public Types inherited from WThreadedRunner
typedef boost::function< void(void) > THREADFUNCTION
 Type used for simple thread functions.

Detailed Description

Class for loading many datasets.

It runs in a separate thread.

Definition at line 43 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 35 of file WBatchLoader.cpp.

WBatchLoader::~WBatchLoader ( )
virtual

Destructor.

Definition at line 44 of file WBatchLoader.cpp.


Member Function Documentation

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::threadMain ( )
protectedvirtual

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_fileNamesToLoad, and m_targetContainer.


Member Data Documentation

std::vector< std::string > WBatchLoader::m_fileNamesToLoad
protected

List of files to load.

Definition at line 77 of file WBatchLoader.h.

Referenced by threadMain().

boost::shared_ptr< WModuleContainer > WBatchLoader::m_targetContainer
protected

The container which later will contain the loaded datasets.

Definition at line 82 of file WBatchLoader.h.

Referenced by run(), and threadMain().


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