modulecomm_fastrtps_shm.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "modulecomm_fastrtps_shm.h"
  2. #include "modulecomm_impl_shm.h"
  3. namespace iv {
  4. modulecomm_fastrtps_shm::modulecomm_fastrtps_shm()
  5. {
  6. }
  7. void modulecomm_fastrtps_shm::RegisterSend(const char *strcommname, const unsigned int nBufSize, const unsigned int nMsgBufCount)
  8. {
  9. modulecomm_impl_shm * pif = new modulecomm_impl_shm(strcommname,modulecomm_impl_shm::type_send);
  10. // procsm_if * pif = new procsm_if(strcommname,nBufSize,nMsgBufCount,procsm::ModeWrite);
  11. mpif = pif;
  12. }
  13. void modulecomm_fastrtps_shm::RegisterRecv(const char *strcommname, SMCallBack pCall)
  14. {
  15. modulecomm_impl_shm * pif = new modulecomm_impl_shm(strcommname,modulecomm_impl_shm::type_recv);
  16. // procsm_if * pif = new procsm_if(strcommname,0,0,procsm::ModeRead);
  17. pif->listenmsg(pCall);
  18. mpif = pif;
  19. }
  20. void modulecomm_fastrtps_shm::RegisterRecvPlus(const char *strcommname, ModuleFun xFun)
  21. {
  22. modulecomm_impl_shm * pif = new modulecomm_impl_shm(strcommname,modulecomm_impl_shm::type_recv);
  23. // procsm_if * pif = new procsm_if(strcommname,0,0,procsm::ModeRead);
  24. pif->listenmsg(xFun);
  25. mpif = pif;
  26. }
  27. void modulecomm_fastrtps_shm::ModuleSendMsg(const char *strdata, const unsigned int nDataLen)
  28. {
  29. modulecomm_impl_shm * pif= (modulecomm_impl_shm *)mpif;
  30. // procsm_if * pif = (procsm_if *)pHandle;
  31. pif->writemsg(strdata,nDataLen);
  32. }
  33. void modulecomm_fastrtps_shm::PauseComm()
  34. {
  35. }
  36. void modulecomm_fastrtps_shm::ContintuComm()
  37. {
  38. }
  39. void modulecomm_fastrtps_shm::Unregister()
  40. {
  41. modulecomm_impl_shm * pif= (modulecomm_impl_shm *)mpif;
  42. // procsm_if * pif = (procsm_if *)pHandle;
  43. delete pif;
  44. }
  45. }