modulecomm_shm.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef MODULECOMM_SHM_H
  2. #define MODULECOMM_SHM_H
  3. #include <QtCore/qglobal.h>
  4. #include <QDateTime>
  5. #include <functional>
  6. #if defined(MODULECOMM_SHM_LIBRARY)
  7. # define MODULECOMMSHARED_SHM_EXPORT Q_DECL_EXPORT
  8. #else
  9. # define MODULECOMMSHARED_SHM_EXPORT Q_DECL_IMPORT
  10. #endif
  11. //#include <iostream>
  12. //#include <thread>
  13. #ifndef IV_MODULE_FUN
  14. typedef std::function<void(const char * ,const unsigned int , const unsigned int , QDateTime * ,const char *)> ModuleFun;
  15. typedef void (* SMCallBack)(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
  16. #define IV_MODULE_FUN
  17. #endif
  18. namespace iv {
  19. namespace modulecomm_shm {
  20. void * MODULECOMMSHARED_SHM_EXPORT RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount);
  21. void * MODULECOMMSHARED_SHM_EXPORT RegisterRecv(const char * strcommname,SMCallBack pCall);
  22. void * MODULECOMMSHARED_SHM_EXPORT RegisterRecvPlus(const char * strcommname,ModuleFun xFun);
  23. void MODULECOMMSHARED_SHM_EXPORT ModuleSendMsg(void * pHandle,const char * strdata,const unsigned int nDataLen);
  24. void MODULECOMMSHARED_SHM_EXPORT Unregister(void * pHandle);
  25. void MODULECOMMSHARED_SHM_EXPORT PauseComm(void * pHandle);
  26. void MODULECOMMSHARED_SHM_EXPORT ContintuComm(void * pHandle);
  27. }
  28. }
  29. #endif