1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include "modulecomm_shm.h"
- #include "procsm_if.h"
- #include "procsm.h"
- #include <iostream>
- 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;
- }
- }
|