OpenWalnut
1.2.5
|
Class for loading many datasets. More...
#include <WBatchLoader.h>
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. | |
![]() | |
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. | |
![]() | |
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. | |
![]() | |
boost::thread | m_thread |
Thread instance. | |
WBoolFlag | m_shutdownFlag |
Condition getting fired whenever the thread should quit. |
Additional Inherited Members | |
![]() | |
typedef boost::function< void(void) > | THREADFUNCTION |
Type used for simple thread functions. |
Class for loading many datasets.
It runs in a separate thread.
Definition at line 43 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 35 of file WBatchLoader.cpp.
|
virtual |
Destructor.
Definition at line 44 of file WBatchLoader.cpp.
|
virtual |
Run thread and load the data.
Reimplemented from WThreadedRunner.
Definition at line 49 of file WBatchLoader.cpp.
References m_targetContainer.
|
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.
|
protected |
|
protected |
The container which later will contain the loaded datasets.
Definition at line 82 of file WBatchLoader.h.
Referenced by run(), and threadMain().