Fennel: Thread Class Reference (original) (raw)
Thread is a wrapper around boost::thread which allows for the thread object to be created before it is actually started. More...
#include <[Thread.h](Thread%5F8h-source.html)>
Inheritance diagram for Thread:

| Public Member Functions | |
|---|---|
| Thread (std::string const &description="anonymous thread") | |
| virtual | ~Thread () |
| virtual void | start () |
| Spawns the OS thread. | |
| void | join () |
| Waits for the OS thread to terminate. | |
| bool | isStarted () const |
| **Returns:**true if start has been called (and subsequent join has not completed) | |
| bool | isStopped () const |
| **Returns:**opposite of isStarted() | |
| boost::thread & | getBoostThread () |
| Accesses the underlying boost::thread, e.g. | |
| std::string | getName () |
| void | setName (std::string const &s) |
| Protected Member Functions | |
| void | initAndRun () |
| virtual void | run ()=0 |
| virtual void | beforeRun () |
| virtual void | afterRun () |
| Protected Attributes | |
| boost::thread * | pBoostThread |
| bool | bRunning |
| std::string | name |
Detailed Description
Thread is a wrapper around boost::thread which allows for the thread object to be created before it is actually started.
Definition at line 41 of file Thread.h.
Constructor & Destructor Documentation
| Thread::Thread | ( | std::string const & | description = "anonymous thread" | ) | [explicit] |
|---|
| Thread::~Thread | ( | | ) | [virtual] | | ---------------- | - | | - | ----------- |
Member Function Documentation
| void Thread::initAndRun | ( | | ) | [protected] | | ----------------------- | - | | - | ------------- |
| virtual void Thread::run | ( | | ) | [protected, pure virtual] | | ------------------------ | - | | - | --------------------------- |
| void Thread::beforeRun | ( | | ) | [protected, virtual] | | ---------------------- | - | | - | ---------------------- |
| void Thread::afterRun | ( | | ) | [protected, virtual] | | --------------------- | - | | - | ---------------------- |
| void Thread::start | ( | | ) | [virtual] | | ------------------ | - | | - | ----------- |
| bool Thread::isStarted | ( | | ) | const [inline] | | ---------------------- | - | | - | ---------------- |
| bool Thread::isStopped | ( | | ) | const [inline] | | ---------------------- | - | | - | ---------------- |
| boost::thread& Thread::getBoostThread | ( | | ) | [inline] | | ------------------------------------- | - | | - | ---------- |
Accesses the underlying boost::thread, e.g.
for use in a boost::thread_group. This thread must already be started.
Returns:
the underlying boost::thread
Definition at line 90 of file Thread.h.
| std::string Thread::getName | ( | | ) | [inline] | | --------------------------- | - | | - | ---------- |
Definition at line 96 of file Thread.h.
00097 { 00098 return name; 00099 }
| void Thread::setName | ( | std::string const & | s | ) | [inline] |
|---|
Member Data Documentation
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/synch/Thread.h
- /home/pub/open/dev/fennel/synch/Thread.cpp
