12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #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;
- }
- }
|