| 1234567891011121314151617181920212223242526272829 |
- #pragma once
- #include <afx.h>
- #include <functional>
- #include "..\Public\pdu\PduLinkInc.h"
- class CPduEntity;
- class CNetInterface
- {
- public:
- virtual ~CNetInterface() = 0 {};
- public:
- typedef std::function<void(const PduLinkContent&)>LinkStateChangedFuncCB; // 连接状态变化接收回调函数
- typedef std::function<void(CPduEntity* a_pPduEntity)>RecvComdFuncCB; // 命令到达接收回调函数
- virtual void setLinkStateChanged(LinkStateChangedFuncCB funcCB) = 0; // PDU连接状态变化事件处理
- virtual void setRecvCommand(RecvComdFuncCB funcCB) = 0; // PDU命令到达事件处理
- virtual bool Send(CPduEntity* a_pCmd, PDU_DEV_TYPE a_nDestType, int a_nDestId) = 0;
- virtual bool CreatePduClient(CString a_strFarIp,
- int a_nFarPort,
- PDU_DEV_TYPE a_nLocalType,
- int a_nLocalId,
- bool IsAutoReconnect) = 0; // 创建PDU通讯客户端
- virtual bool ClosePduClient(PDU_DEV_TYPE a_nFarType,
- int a_nFarId) = 0; // 关闭PDU通讯客户端
- static CNetInterface* getNetInstance();
- };
|