📄 genghis.inc
字号:
//BEGIN Genghis.inc (systemc)//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~extern int errors;Genghis::Genghis() // Constructor: m_valid(false), m_id('a'){}//end Genghis::Genghisvoid Genghis::put(const char ID,int val) { checkid(ID); if (m_valid) wait(m_changed); m_value = val; m_valid = true; m_changed.notify();}//end Genghis::putint Genghis::get(const char ID) { checkid(ID); if (!m_valid) wait(m_changed); m_valid = false; m_changed.notify(); return m_value;}//end Genghis::getbool Genghis::nb_put(const char ID, int val) { checkid(ID); if (m_valid) return false; m_value = val; m_valid = true; m_changed.notify(); return true;}//end Genghis::nb_putbool Genghis::nb_get(const char ID, int& val) { checkid(ID); if (!m_valid) return false; val = m_value; m_valid = false; m_changed.notify(); return true;}//end Genghis::nb_getinline bool Genghis::empty(const char ID) { return !m_valid; }inline bool Genghis::full(const char ID) { return m_valid; }inline void Genghis::checkid(const char ID) { if (ID == m_id) return; cout << "ERROR(" << name() << "): ID mismatch" << endl; errors++;}//end Genghis::checkid//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//END $Id: Genghis.inc,v 1.1 2004/01/16 17:57:04 dcblack Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -