00001 00002 #include "thread.h" 00003 00004 00005 thread::thread() 00006 : m_PC(0) 00007 , m_terminated(true) 00008 { 00009 } 00010 00011 00012 thread::thread(address PC) 00013 : m_PC(PC) 00014 , m_terminated(false) 00015 { 00016 } 00017 00018 00019 thread::~thread() 00020 { 00021 } 00022 00023 00024 void thread::spawn(const address& PC) 00025 { 00026 m_PC = PC; 00027 m_terminated = false; 00028 } 00029 00030 00031 address thread::getAddress() 00032 { 00033 return m_PC; 00034 } 00035 00036 00037 bool thread::isTerminated() 00038 { 00039 return m_terminated; 00040 } 00041 00042 00043 thread& thread::operator++() 00044 { 00045 ++m_PC; 00046 return *this; 00047 } 00048 00049 00050 thread& thread::operator+=(const int& i) 00051 { 00052 m_PC+=i; 00053 return *this; 00054 } 00055 00056 00057 thread& thread::operator%=(const int& i) 00058 { 00059 m_PC%=i; 00060 return *this; 00061 } 00062 00063 00064 thread& thread::operator=(const address& addr) 00065 { 00066 m_PC = addr; 00067 return *this; 00068 } 00069 00070 00071 thread::operator address() 00072 { 00073 return m_PC; 00074 } 00075