Vault  4.1
Public Member Functions
VMainThread Class Reference

The VMainThread is a special case that is intended to be declared and called by the application's main function as follows: int main(int argc, char** argv) { VMainThread mainThread; return mainThread.execute(argc, argv); } This allows Vault to have a VThread object to represent the main thread, even though it is not a VThread-launched thread. More...

#include <vthread.h>

Inheritance diagram for VMainThread:
VThread

List of all members.

Public Member Functions

virtual void start ()
 Starts the thread by creating whatever OS-specific resources are necessary, and invoking the thread main, resulting in the VThread subclass' run() method being called.
virtual void run ()
 Override required in each VThread subclass, run() does whatever the thread is designed to do, and returns when the thread has completed its task or detects that isRunning() returns false.
int execute (int argc, char **argv)

Detailed Description

The VMainThread is a special case that is intended to be declared and called by the application's main function as follows: int main(int argc, char** argv) { VMainThread mainThread; return mainThread.execute(argc, argv); } This allows Vault to have a VThread object to represent the main thread, even though it is not a VThread-launched thread.

Therefore you can call VThread::getCurrentThread() from the main thread and it will return the VMainThread object. You must not "start" the VMainThread, because it is not a real VThread. If you do, its start() method will throw. VMainThread's execute() method simply calls VThread::userMain() which is defined by the application as always.

Definition at line 447 of file vthread.h.


Member Function Documentation

virtual void VMainThread::run ( ) [inline, virtual]

Override required in each VThread subclass, run() does whatever the thread is designed to do, and returns when the thread has completed its task or detects that isRunning() returns false.

If the thread is designed to be stoppable from another thread, then its run() method must check the isRunning() property periodically and return when the property becomes false.

Implements VThread.

Definition at line 453 of file vthread.h.


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

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.