Remoto - VFS
|
A subclass of QThread, which provides an event loop in a different thread. More...
#include <VFS_thread.h>
Signals | |
void | creationFailed () |
If _node creation was not possible, this signal is emitted. More... | |
void | nodeCreated (VFS_node *node) |
Once the _node has been created, this signals back to the owning VFS_thread of its existence. More... | |
Public Member Functions | |
VFS_threadthread (VFS_node *p, QDomElement nodeConfig, QVariantMap env, bool printConfig) | |
~VFS_threadthread () | |
void | run () |
Run the QThread event loop. More... | |
Public Attributes | |
QVariantMap | _env |
The environment. More... | |
VFS_node * | _node |
The root VFS_node running in the new thread. More... | |
QDomElement | _nodeConfig |
XML config node. More... | |
bool | _printConfig |
A debug setting, used to make sure contexts are correct. More... | |
A subclass of QThread, which provides an event loop in a different thread.
This is created by VFS_thread, and receives configuration data passed from a config file.
Definition at line 10 of file VFS_thread.h.
|
explicit |
p | The owning VFS_thread |
nodeConfig | The XML configuration node |
env | The current environment |
printConfig | A debug setting, used to make sure contexts are correct |
Create the VFS_threadthread, but don't run it yet. The VFS_node for this thread will not be created until VFS_threadthread::run() is called.
Definition at line 344 of file VFS_thread.cpp.
VFS_threadthread::~VFS_threadthread | ( | ) |
Definition at line 353 of file VFS_thread.cpp.
|
signal |
If _node creation was not possible, this signal is emitted.
|
signal |
Once the _node has been created, this signals back to the owning VFS_thread of its existence.
void VFS_threadthread::run | ( | ) |
Run the QThread event loop.
The lifetime of this function is the lifetime of the thread.
VFS_creator::constructNode() is called with the config data to attempt to create the _node. If creation is successful, the _node is mount()ed and the thread blocks until the VFS_creator::outstanding semaphore has synchronized. QThread::exec() is called to start the event loop, and the method blocks until the thread completes.
If _node creation was not possible, the error is logged and creationFailed() is emitted. The event loop does not start, run() will finish, and therefore the QThread will emit finished() and trigger deletion of the VFS_thread. Semaphores are released so initialization can continue.
Note that the thread
attribute is removed from the config line to prevent an infinite loop on thread creation.
Definition at line 380 of file VFS_thread.cpp.
QVariantMap VFS_threadthread::_env |
The environment.
Definition at line 21 of file VFS_thread.h.
VFS_node* VFS_threadthread::_node |
The root VFS_node running in the new thread.
Definition at line 24 of file VFS_thread.h.
QDomElement VFS_threadthread::_nodeConfig |
XML config node.
Definition at line 20 of file VFS_thread.h.
bool VFS_threadthread::_printConfig |
A debug setting, used to make sure contexts are correct.
Definition at line 22 of file VFS_thread.h.