modulecomm_inter.cpp 1.3 KB

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