|
@@ -0,0 +1,80 @@
|
|
|
|
+#ifndef MODULECOMM_H
|
|
|
|
+#define MODULECOMM_H
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#include <QtCore/qglobal.h>
|
|
|
|
+#include <QDateTime>
|
|
|
|
+
|
|
|
|
+#include <functional>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+#if defined(MODULECOMM_LIBRARY)
|
|
|
|
+# define MODULECOMMSHARED_EXPORT Q_DECL_EXPORT
|
|
|
|
+#else
|
|
|
|
+# define MODULECOMMSHARED_EXPORT Q_DECL_IMPORT
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//#include <iostream>
|
|
|
|
+//#include <thread>
|
|
|
|
+
|
|
|
|
+//using namespace std::placeholders;
|
|
|
|
+
|
|
|
|
+#ifndef IV_MODULE_FUN
|
|
|
|
+
|
|
|
|
+typedef std::function<void(const char * ,const unsigned int , const unsigned int , QDateTime * ,const char *)> ModuleFun;
|
|
|
|
+typedef void (* SMCallBack)(const char * strdata,const unsigned int nSize,const unsigned int index,const QDateTime * dt,const char * strmemname);
|
|
|
|
+#define IV_MODULE_FUN
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+namespace iv {
|
|
|
|
+namespace modulecomm {
|
|
|
|
+
|
|
|
|
+enum ModuleComm_TYPE
|
|
|
|
+{
|
|
|
|
+ ModuleComm_SHAREMEM = 0,
|
|
|
|
+ ModuleComm_INTERIOR = 1,
|
|
|
|
+ ModuleComm_FASTRTPS = 2,
|
|
|
|
+ ModuleComm_FASTRTPS_TCP = 3,
|
|
|
|
+ ModuleComm_UNDEFINE = 4
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+void * MODULECOMMSHARED_EXPORT RegisterSend(const char * strcommname);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+void * MODULECOMMSHARED_EXPORT RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount
|
|
|
|
+ ,ModuleComm_TYPE xmctype,const unsigned short nport);
|
|
|
|
+void * MODULECOMMSHARED_EXPORT RegisterRecv(const char * strcommname,SMCallBack pCall,
|
|
|
|
+ ModuleComm_TYPE xmctype ,const char * strip,const unsigned short );
|
|
|
|
+void * MODULECOMMSHARED_EXPORT RegisterRecvPlus(const char * strcommname,ModuleFun xFun,
|
|
|
|
+ ModuleComm_TYPE xmctype,const char * strip,const unsigned short );
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//void * MODULECOMMSHARED_EXPORT RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount
|
|
|
|
+// ,ModuleComm_TYPE xmctype = ModuleComm_UNDEFINE,const unsigned short nport = 5100);
|
|
|
|
+//void * MODULECOMMSHARED_EXPORT RegisterRecv(const char * strcommname,SMCallBack pCall,
|
|
|
|
+// ModuleComm_TYPE xmctype = ModuleComm_UNDEFINE,const char * strip = 0,const unsigned short = 5100);
|
|
|
|
+//void * MODULECOMMSHARED_EXPORT RegisterRecvPlus(const char * strcommname,ModuleFun xFun,
|
|
|
|
+// ModuleComm_TYPE xmctype = ModuleComm_UNDEFINE,const char * strip = 0,const unsigned short = 5100);
|
|
|
|
+
|
|
|
|
+void MODULECOMMSHARED_EXPORT ModuleSendMsg(void * pHandle,const char * strdata,const unsigned int nDataLen);
|
|
|
|
+void MODULECOMMSHARED_EXPORT Unregister(void * pHandle);
|
|
|
|
+void MODULECOMMSHARED_EXPORT PauseComm(void * pHandle);
|
|
|
|
+void MODULECOMMSHARED_EXPORT ContintuComm(void * pHandle);
|
|
|
|
+
|
|
|
|
+void * MODULECOMMSHARED_EXPORT RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount);
|
|
|
|
+void * MODULECOMMSHARED_EXPORT RegisterRecv(const char * strcommname,SMCallBack pCall);
|
|
|
|
+void * MODULECOMMSHARED_EXPORT RegisterRecvPlus(const char * strcommname,ModuleFun xFun);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+#endif // MODULECOMM_H
|