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