vnpy/archive/vn.sgit_4.1/sgitapi/SgitFtdcMdApi.h

119 lines
3.5 KiB
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
#if !defined(Sgit_FTDCMDAPI_H)
#define Sgit_FTDCMDAPI_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "SgitFtdcUserApiStruct.h"
#if defined(ISLIB) && defined(WIN32)
#ifdef LIB_MD_API_EXPORT
#define MD_API_EXPORT __declspec(dllexport)
#else
#define MD_API_EXPORT __declspec(dllimport)
#endif
#else
#define MD_API_EXPORT
#endif
class CSgitFtdcMdSpi
{
public:
///<2F><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>׺<EFBFBD>̨<EFBFBD><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>δ<EFBFBD><CEB4>¼ǰ<C2BC><C7B0><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>
virtual void OnFrontConnected(){};
///<2F><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>׺<EFBFBD>̨ͨ<CCA8><CDA8><EFBFBD><EFBFBD><EFBFBD>ӶϿ<D3B6>ʱ<EFBFBD><CAB1><EFBFBD>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD><C3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>API<50><49><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3>ͻ<EFBFBD><CDBB>˿ɲ<CBBF><C9B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
///@param pErrMsg <20><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>
virtual void OnFrontDisconnected(char *pErrMsg){};
///<2F><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
virtual void OnRspUserLogin(CSgitFtdcRspUserLoginField *pRspUserLogin, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///<2F>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
virtual void OnRspUserLogout(CSgitFtdcUserLogoutField *pUserLogout, CSgitFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ
virtual void OnRtnDepthMarketData(CSgitFtdcDepthMarketDataField *pDepthMarketData) {};
};
class MD_API_EXPORT CSgitFtdcMdApi
{
public:
///<2F><><EFBFBD><EFBFBD>MdApi
///@param pszFlowPath <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>Ŀ¼<C4BF><C2BC>Ĭ<EFBFBD><C4AC>Ϊ<EFBFBD><CEAA>ǰĿ¼
///@return <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>UserApi
static CSgitFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "");
///ɾ<><C9BE><EFBFBD>ӿڶ<D3BF><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
///@remark <20><><EFBFBD><EFBFBD>ʹ<EFBFBD>ñ<EFBFBD><C3B1>ӿڶ<D3BF><DAB6><EFBFBD>ʱ,<2C><><EFBFBD>øú<C3B8><C3BA><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>ӿڶ<D3BF><DAB6><EFBFBD>
virtual void Release() = 0;
///<2F><>ʼ<EFBFBD><CABC>
///@remark <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><D0BB><EFBFBD><>е<EFBFBD><D0B5>ú<EFBFBD>,<2C>ӿڲſ<DAB2>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
///isLogged <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱʹ<CAB1><CAB9>true<75><65><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
virtual void Init(bool isLogged) = 0;
///<2F>ȴ<EFBFBD><C8B4>ӿ<EFBFBD><D3BF>߳̽<DFB3><CCBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
///@return <20>߳<EFBFBD><DFB3>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>
virtual int Join() = 0;
///<2F><>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
///@retrun <20><>ȡ<EFBFBD><C8A1><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD>
///@remark ֻ<>е<EFBFBD>¼<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>,<2C><><EFBFBD>ܵõ<DCB5><C3B5><EFBFBD>ȷ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD>
virtual const char *GetTradingDay() = 0;
///ע<><D7A2>ǰ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
///@param pszFrontAddress<73><73>ǰ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>
///@remark <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD>ĸ<EFBFBD>ʽΪ<CABD><CEAA><EFBFBD><EFBFBD>protocol://ipaddress:port<72><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E7A3BA>tcp://127.0.0.1:17001<30><31><EFBFBD><EFBFBD>
///@remark <20><>tcp<63><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD><EFBFBD><E9A3AC>127.0.0.1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>17001<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿ںš<EFBFBD>
virtual void RegisterFront(char *pszFrontAddress) = 0;
/**<2A>öಥʱTCP<43><50><EFBFBD><EFBFBD>Ҳ<EFBFBD><D2B2>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
*<EFBFBD><EFBFBD><EFBFBD>øú<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD>ϲ<EFBFBD><EFBFBD><EFBFBD>tcpģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*<EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MlCast://hostIP$multiaddress:port<72><74>
*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MlCast://ANY$multiaddress:port
* @param szMlCastAddr <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ip<EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD>
*/
virtual void SetMultiCastAddr(char *szMlCastAddr) = 0;
///ע<><D7A2><EFBFBD>ص<EFBFBD><D8B5>ӿ<EFBFBD>
///@param pSpi <20><><EFBFBD><EFBFBD><EFBFBD>Իص<D4BB><D8B5>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
virtual void RegisterSpi(CSgitFtdcMdSpi *pSpi) = 0;
///<2F><><EFBFBD><EFBFBD><EFBFBD>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD>
///@param nResumeType <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>ʽ
/// Sgit_TERT_RESTART:<3A>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>տ<EFBFBD>ʼ<EFBFBD>ش<EFBFBD>
/// Sgit_TERT_RESUME:<3A><><EFBFBD>ϴ<EFBFBD><CFB4>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// Sgit_TERT_QUICK:ֻ<><D6BB><EFBFBD>͵<EFBFBD>¼<EFBFBD>󹫹<EFBFBD><F3B9ABB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
///@remark <20>÷<EFBFBD><C3B7><EFBFBD>Ҫ<EFBFBD><D2AA>Init<69><74><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>á<EFBFBD><C3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>򲻻<EFBFBD><F2B2BBBB>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>
virtual void SubscribeMarketTopic(Sgit_TE_RESUME_TYPE nResumeType) = 0;
///
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E9B6A9>
/// @param iRequestID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// @param pMBLQuotReq <20><><EFBFBD><EFBFBD><E9B6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// @return 0<><30>ʾ<EFBFBD>ɹ<EFBFBD>
/// @return <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾʧ<CABE><CAA7>
///
virtual int SubQuot(CSgitSubQuotField *pSgitSubQuotField)=0;
///<2F><><EFBFBD>;<EFBFBD><CDBE><EFBFBD>ָ<EFBFBD>ǰ<EEB5BD><C7B0>,֪ͨǰ<D6AA>ÿ<EFBFBD><C3BF>Ը<EFBFBD><D4B8>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB9AB><EFBFBD><EFBFBD>
/// @return 0<><30>ʾ<EFBFBD>ɹ<EFBFBD>
/// @return <20><><EFBFBD><EFBFBD><EFBFBD>μ<EFBFBD><CEBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
///
virtual int Ready() = 0;
///<2F>û<EFBFBD><C3BB><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
virtual int ReqUserLogin(CSgitFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
///<2F>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD>
virtual int ReqUserLogout(CSgitFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
protected:
~CSgitFtdcMdApi(){};
};
#endif