#include "modulecomm_shm.h" #include "procsm_if.h" #include "procsm.h" #include namespace iv { modulecomm_shm::modulecomm_shm() { } void modulecomm_shm::RegisterSend(const char *strcommname, const unsigned int nBufSize, const unsigned int nMsgBufCount) { procsm_if * pif = new procsm_if(strcommname,nBufSize,nMsgBufCount,procsm::ModeWrite); mpif = pif; } void modulecomm_shm::RegisterRecv(const char *strcommname, SMCallBack pCall) { procsm_if * pif = new procsm_if(strcommname,0,0,procsm::ModeRead); pif->listenmsg(pCall); mpif = pif; } void modulecomm_shm::RegisterRecvPlus(const char *strcommname, ModuleFun xFun) { procsm_if * pif = new procsm_if(strcommname,0,0,procsm::ModeRead); pif->listenmsg(xFun); mpif = (void *)pif; } void modulecomm_shm::ModuleSendMsg(const char *strdata, const unsigned int nDataLen) { procsm_if * pif = (procsm_if *)mpif; pif->writemsg(strdata,nDataLen); } void modulecomm_shm::PauseComm() { procsm_if * pif = (procsm_if *)mpif; pif->pausecomm(); } void modulecomm_shm::ContintuComm() { procsm_if * pif = (procsm_if *)mpif; pif->continuecomm(); } void modulecomm_shm::Unregister() { procsm_if * pif = (procsm_if *)mpif; delete pif; mpif =0; } }