OpenWalnut
1.2.5
|
Class loading project files. More...
#include <WProjectFile.h>
Public Member Functions | |
WProjectFile (boost::filesystem::path project) | |
Default constructor. | |
virtual | ~WProjectFile () |
Destructor. | |
virtual void | load () |
Parses the project file and applies it. | |
virtual void | save () |
Saves the current state to the file specified in the constructor. | |
virtual void | save (const std::vector< boost::shared_ptr< WProjectFileIO > > &writer) |
Saves the current state to the file specified in the constructor. | |
![]() | |
WThreadedRunner () | |
Default constructor. | |
virtual | ~WThreadedRunner () |
Destructor. | |
virtual void | run () |
Run thread. | |
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. |
Static Public Member Functions | |
static boost::shared_ptr < WProjectFileIO > | getCameraWriter () |
Returns an instance of the Camera writer. | |
static boost::shared_ptr < WProjectFileIO > | getModuleWriter () |
Returns an instance of the module writer. | |
static boost::shared_ptr < WProjectFileIO > | getROIWriter () |
Returns an instance of the ROI writer. |
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 | |
boost::filesystem::path | m_project |
The project file to parse. | |
std::vector< boost::shared_ptr < WProjectFileIO > > | m_parsers |
The parser instances. | |
![]() | |
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 loading project files.
This class opens an file and reads it line by line. It delegates the actual parsing to each of the known WProjectFileIO instances which then do their job.
Definition at line 45 of file WProjectFile.h.
|
explicit |
Default constructor.
It does NOT parse the file. Parsing is done by apply().
project | the project file to load. |
Definition at line 40 of file WProjectFile.cpp.
References m_parsers.
|
virtual |
|
static |
Returns an instance of the Camera writer.
Definition at line 63 of file WProjectFile.cpp.
|
static |
Returns an instance of the module writer.
Definition at line 68 of file WProjectFile.cpp.
|
static |
Returns an instance of the ROI writer.
Definition at line 73 of file WProjectFile.cpp.
|
virtual |
Parses the project file and applies it.
It applies the project file asynchronously!
Definition at line 78 of file WProjectFile.cpp.
References WKernel::getRootContainer(), WKernel::getRunningKernel(), and WThreadedRunner::run().
|
virtual |
Saves the current state to the file specified in the constructor.
Definition at line 109 of file WProjectFile.cpp.
References m_parsers.
|
virtual |
Saves the current state to the file specified in the constructor.
This also supports a custom list of writers. This is useful to only write some parts of the state.
writer | the list of writers to use. |
Definition at line 87 of file WProjectFile.cpp.
References wlog::info(), and m_project.
|
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 114 of file WProjectFile.cpp.
References wlog::error(), WKernel::getRootContainer(), WKernel::getRunningKernel(), wlog::info(), m_parsers, m_project, and wlog::warn().
|
protected |
The parser instances.
They are used to parse the file.
Definition at line 117 of file WProjectFile.h.
Referenced by save(), threadMain(), WProjectFile(), and ~WProjectFile().
|
protected |
The project file to parse.
Definition at line 112 of file WProjectFile.h.
Referenced by save(), and threadMain().