// BusThread.cpp : 定义 DLL 应用程序的导出函数。 // #include "stdafx.h" #include "BusThread.h" #include "Logger.h" #include "CDInterface.h" #include BusThread::BusThread(void) { m_bLocal = true; } BusThread::~BusThread(void) { } //work bool BusThread::Exec() { while (WaitForInQue()) { bool status = true; //pump In&Out que while (status) { ResDataObject Packet; status = false; //check req first if (PopReqDataObject(Packet)) { status = true; //send it to cdi std::cout << "From Ebus" << Packet.encode() << endl; #ifndef TEMP_COMP CDInterface *p = CDInterface::GetCDI(); if (m_bLocal) { p->ReceivedFromLocalBus(Packet); } else { p->ReceivedFromEthBus(Packet); } //p->ReceivedFromBus(Packet); #endif } } } return true; } bool BusThread::OnStartThread(void) { printf("========== BusThread::OnStartThread 0X%08X \n", GetCurrentThreadId()); #ifndef TEMP_COMP TPRINTA_INFO("Bus Thread Begin Entry....."); #endif return true; } bool BusThread::OnEndThread(void) { printf("========== BusThread::OnEndThread 0X%08X \n", GetCurrentThreadId()); #ifndef TEMP_COMP Logger *pLog = (Logger*)m_pThreadLogger; PRINTA_INFO(pLog, "Bus Thread End Exit....."); #endif return true; }