Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

thread Class Reference

holds the data for an individual thread More...

#include <thread.h>

List of all members.

Public Member Functions

 thread ()
 initialise to terminated state

 thread (address PC)
 initialise to specified address

 ~thread ()
void spawn (const address &PC)
address getAddress ()
 get the current address of the thread

bool isTerminated ()
 test if the thread is terminated

threadoperator++ ()
 move the thread to the next address

threadoperator+= (const int &i)
threadoperator%= (const int &i)
threadoperator= (const address &addr)
 set the address to the specified address

 operator address ()
 implicit conversion to the current address


Protected Attributes

address m_PC
 the current address of the thread

bool m_terminated
 whether the thread is terminated or active


Detailed Description

holds the data for an individual thread

Definition at line 15 of file thread.h.


Constructor & Destructor Documentation

thread::thread  ) 
 

initialise to terminated state

Definition at line 5 of file thread.cpp.

thread::thread address  PC  ) 
 

initialise to specified address

Definition at line 12 of file thread.cpp.

thread::~thread  ) 
 

Definition at line 19 of file thread.cpp.


Member Function Documentation

address thread::getAddress  ) 
 

get the current address of the thread

Definition at line 31 of file thread.cpp.

References address, and m_PC.

bool thread::isTerminated  ) 
 

test if the thread is terminated

Definition at line 37 of file thread.cpp.

References m_terminated.

Referenced by process::getThreadAddress(), and virtualMachine::step().

thread::operator address  ) 
 

implicit conversion to the current address

Definition at line 71 of file thread.cpp.

References m_PC.

thread & thread::operator%= const int &  i  ) 
 

ensure the thread is within the range [0, i[

Definition at line 57 of file thread.cpp.

References m_PC, and operator%=().

Referenced by operator%=().

thread & thread::operator++  ) 
 

move the thread to the next address

Definition at line 43 of file thread.cpp.

References m_PC.

thread & thread::operator+= const int &  i  ) 
 

jump the thread foward by the specified number of memory addresses

Definition at line 50 of file thread.cpp.

References m_PC, and operator+=().

Referenced by operator+=().

thread & thread::operator= const address addr  ) 
 

set the address to the specified address

Definition at line 64 of file thread.cpp.

References m_PC, and operator=().

Referenced by operator=().

void thread::spawn const address PC  ) 
 

set the thread to the specified address and flag as active

Definition at line 24 of file thread.cpp.

References m_PC, m_terminated, and spawn().

Referenced by spawn().


Member Data Documentation

address thread::m_PC [protected]
 

the current address of the thread

Definition at line 57 of file thread.h.

Referenced by getAddress(), operator address(), operator%=(), operator++(), operator+=(), operator=(), and spawn().

bool thread::m_terminated [protected]
 

whether the thread is terminated or active

Definition at line 60 of file thread.h.

Referenced by isTerminated(), and spawn().


The documentation for this class was generated from the following files:
Generated on Sun Mar 6 22:12:36 2005 for virtualMachine03 by doxygen 1.3.7