modulecomm_fastrtps_shm.cpp 1.6 KB

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