modulecomm.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef MODULECOMM_H
  2. #define MODULECOMM_H
  3. #include <QtCore/qglobal.h>
  4. #include <QDateTime>
  5. #include <functional>
  6. #if defined(MODULECOMM_LIBRARY)
  7. # define MODULECOMMSHARED_EXPORT Q_DECL_EXPORT
  8. #else
  9. # define MODULECOMMSHARED_EXPORT Q_DECL_IMPORT
  10. #endif
  11. //#include <iostream>
  12. //#include <thread>
  13. //using namespace std::placeholders;
  14. #ifndef IV_MODULE_FUN
  15. typedef std::function<void(const char * ,const unsigned int , const unsigned int , QDateTime * ,const char *)> ModuleFun;
  16. typedef void (* SMCallBack)(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
  17. #define IV_MODULE_FUN
  18. #endif
  19. namespace iv {
  20. namespace modulecomm {
  21. enum ModuleComm_TYPE
  22. {
  23. ModuleComm_SHAREMEM = 0,
  24. ModuleComm_INTERIOR = 1,
  25. ModuleComm_FASTRTPS = 2,
  26. ModuleComm_FASTRTPS_TCP = 3,
  27. ModuleComm_UNDEFINE = 4
  28. };
  29. void * RegisterSend(const char * strcommname);
  30. void * RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount
  31. ,ModuleComm_TYPE xmctype,const unsigned short nport);
  32. void * RegisterRecv(const char * strcommname,SMCallBack pCall,
  33. ModuleComm_TYPE xmctype ,const char * strip,const unsigned short );
  34. void * RegisterRecvPlus(const char * strcommname,ModuleFun xFun,
  35. ModuleComm_TYPE xmctype,const char * strip,const unsigned short );
  36. //void * MODULECOMMSHARED_EXPORT RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount
  37. // ,ModuleComm_TYPE xmctype = ModuleComm_UNDEFINE,const unsigned short nport = 5100);
  38. //void * MODULECOMMSHARED_EXPORT RegisterRecv(const char * strcommname,SMCallBack pCall,
  39. // ModuleComm_TYPE xmctype = ModuleComm_UNDEFINE,const char * strip = 0,const unsigned short = 5100);
  40. //void * MODULECOMMSHARED_EXPORT RegisterRecvPlus(const char * strcommname,ModuleFun xFun,
  41. // ModuleComm_TYPE xmctype = ModuleComm_UNDEFINE,const char * strip = 0,const unsigned short = 5100);
  42. void MODULECOMMSHARED_EXPORT ModuleSendMsg(void * pHandle,const char * strdata,const unsigned int nDataLen);
  43. void MODULECOMMSHARED_EXPORT Unregister(void * pHandle);
  44. void MODULECOMMSHARED_EXPORT PauseComm(void * pHandle);
  45. void MODULECOMMSHARED_EXPORT ContintuComm(void * pHandle);
  46. void * RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount);
  47. void * RegisterRecv(const char * strcommname,SMCallBack pCall);
  48. void * RegisterRecvPlus(const char * strcommname,ModuleFun xFun);
  49. }
  50. }
  51. #endif // MODULECOMM_H