162 lines
4.7 KiB
C
162 lines
4.7 KiB
C
|
/////////////////////////////////////////////////////////////////////////
|
|||
|
///@author <20><>̩֤ȯ<D6A4>ɷ<EFBFBD><C9B7><EFBFBD><EFBFBD><EFBFBD>˾
|
|||
|
///@file xtp_quote_api_compatible.h
|
|||
|
///@brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>鶩<EFBFBD>Ŀͻ<C4BF><CDBB>˼<EFBFBD><CBBC>ݽӿ<DDBD>
|
|||
|
/////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
#ifndef _XTP_QUOTE_API_COMPATIBLE_H_
|
|||
|
#define _XTP_QUOTE_API_COMPATIBLE_H_
|
|||
|
|
|||
|
#if _MSC_VER > 1000
|
|||
|
#pragma once
|
|||
|
#endif // _MSC_VER > 1000
|
|||
|
|
|||
|
#include "xtp_api_struct.h"
|
|||
|
#include "xtp_api_struct_compatible.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 XTP::API::QuoteCompatibleSpi
|
|||
|
*
|
|||
|
* \brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
* \author <EFBFBD><EFBFBD>̩֤ȯ<EFBFBD>ɷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
|
|||
|
* \date ʮ<EFBFBD><EFBFBD> 2015
|
|||
|
*/
|
|||
|
namespace XTP {
|
|||
|
namespace API {
|
|||
|
class QuoteCompatibleSpi
|
|||
|
{
|
|||
|
public:
|
|||
|
///<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 nReason <20><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>
|
|||
|
/// 0x1001 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
|
|||
|
/// 0x1002 <20><><EFBFBD><EFBFBD>дʧ<D0B4><CAA7>
|
|||
|
/// 0x2001 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ
|
|||
|
/// 0x2002 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
|
|||
|
/// 0x2003 <20>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
virtual void OnFrontDisconnected(int nReason) {};
|
|||
|
|
|||
|
|
|||
|
///<2F><><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>
|
|||
|
///@param pRspInfo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
///@param nRequestID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
///@param bIsLast <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|||
|
virtual void OnRspError(CXTPRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
|
|||
|
|
|||
|
///<2F>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ
|
|||
|
///@param pUserLogout <20>û<EFBFBD><C3BB>dz<EFBFBD><C7B3>IJ<EFBFBD><C4B2><EFBFBD>
|
|||
|
///@param pRspInfo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
///@param nRequestID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
///@param bIsLast <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|||
|
virtual void OnRspUserLogout(CXTPUserLogoutField *pUserLogout, CXTPRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
|
|||
|
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>
|
|||
|
///@param pSpecificInstrument <20><>ϸ<EFBFBD>ĺ<EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///@param pRspInfo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
///@param nRequestID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
///@param bIsLast <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|||
|
virtual void OnRspSubMarketData(CXTPSpecificInstrumentField *pSpecificInstrument, CXTPRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
|
|||
|
|
|||
|
///ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>
|
|||
|
///@param pSpecificInstrument <20><>ϸ<EFBFBD>ĺ<EFBFBD>Լȡ<D4BC><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///@param pRspInfo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
///@param nRequestID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|||
|
///@param bIsLast <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
|
|||
|
virtual void OnRspUnSubMarketData(CXTPSpecificInstrumentField *pSpecificInstrument, CXTPRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
|
|||
|
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪ͨ
|
|||
|
///@param pDepthMarketData <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
virtual void OnRtnDepthMarketData(CXTPDepthMarketDataField *pDepthMarketData) {};
|
|||
|
};
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/*!
|
|||
|
* \class XTP::API::QuoteCompatibleApi
|
|||
|
*
|
|||
|
* \brief <EFBFBD><EFBFBD><EFBFBD>鶩<EFBFBD>ļ<EFBFBD><EFBFBD>ݽӿ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
* \author <EFBFBD><EFBFBD>̩֤ȯ<EFBFBD>ɷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾
|
|||
|
* \date ʮ<EFBFBD><EFBFBD> 2015
|
|||
|
*/
|
|||
|
namespace XTP {
|
|||
|
namespace API {
|
|||
|
class MD_API_EXPORT QuoteCompatibleApi
|
|||
|
{
|
|||
|
public:
|
|||
|
///<2F><><EFBFBD><EFBFBD>QuoteApi
|
|||
|
///@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
|
|||
|
///modify for udp marketdata
|
|||
|
static QuoteCompatibleApi *CreateQuoteApi(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><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>
|
|||
|
///@return <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 ǰ<>û<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;
|
|||
|
|
|||
|
///ע<><D7A2><EFBFBD>ص<EFBFBD><D8B5>ӿ<EFBFBD>
|
|||
|
///@param pSpi <20><><EFBFBD><EFBFBD><EFBFBD>Իص<D4BB><D8B5>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
|||
|
virtual void RegisterSpi(QuoteCompatibleSpi *pSpi) = 0;
|
|||
|
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顣
|
|||
|
///@param ppInstrumentID <20><>ԼID
|
|||
|
///@param nCount Ҫ<><D2AA><EFBFBD><EFBFBD>/<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>
|
|||
|
///@param pExchageID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///@remark <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>ͬһ֤ȯ<D6A4><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>Լ
|
|||
|
virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount, XTP_EXCHANGE_TYPE pExchageID) = 0;
|
|||
|
|
|||
|
///<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD>顣
|
|||
|
///@param ppInstrumentID <20><>ԼID
|
|||
|
///@param nCount Ҫ<><D2AA><EFBFBD><EFBFBD>/<2F>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>
|
|||
|
///@param pExchageID <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///@remark <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬһ֤ȯ<D6A4><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>Լ
|
|||
|
virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount, XTP_EXCHANGE_TYPE pExchageID) = 0;
|
|||
|
|
|||
|
///<2F>û<EFBFBD><C3BB><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
|||
|
///@return <20><>¼<EFBFBD>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>¼<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>ǡ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
|||
|
///@remark <20>˺<EFBFBD><CBBA><EFBFBD>Ϊͬ<CEAA><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>첽<EFBFBD>ȴ<EFBFBD><C8B4><EFBFBD>¼<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC>ɽ<EFBFBD><C9BD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
virtual int ReqUserLogin(CXTPReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
|
|||
|
|
|||
|
|
|||
|
///<2F>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
///@return <20>dz<EFBFBD><C7B3>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ʾ<EFBFBD>dz<EFBFBD><C7B3>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>ǡ<EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ʾ<EFBFBD>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
virtual int ReqUserLogout(CXTPUserLogoutField *pUserLogout, int nRequestID) = 0;
|
|||
|
|
|||
|
protected:
|
|||
|
~QuoteCompatibleApi() {};
|
|||
|
};
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#endif
|