-
Notifications
You must be signed in to change notification settings - Fork 2
/
gen_md_api.cpp
87 lines (80 loc) · 2.92 KB
/
gen_md_api.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// This file was automatically generated by ctpgen
#include "gen_md_api.h"
#include "include/ThostFtdcMdApi.h"
#include "gen_md_spi.h"
mdSpi md_new_spi(uint64_t value){
CThostFtdcMdSpiImpl *p = new CThostFtdcMdSpiImpl(value);
return mdSpi(p);
}
void md_spi_free(mdSpi p){
CThostFtdcMdSpiImpl *ptr = (CThostFtdcMdSpiImpl *)p;
delete ptr;
}
mdApi md_create_ftdc_md_api(char * pszFlowPath,int8_t bIsUsingUdp,int8_t bIsMulticast){
CThostFtdcMdApi* p = CThostFtdcMdApi::CreateFtdcMdApi(pszFlowPath,bIsUsingUdp,bIsMulticast);
return (mdApi)p;
}
const char * md_get_api_version(){
return CThostFtdcMdApi::GetApiVersion();
}
void md_release(mdApi a){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
p->Release();
}
void md_init(mdApi a){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
p->Init();
}
int md_join(mdApi a){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->Join();
}
const char * md_get_trading_day(mdApi a){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->GetTradingDay();
}
void md_register_front(mdApi a, char * pszFrontAddress){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
p->RegisterFront(pszFrontAddress);
}
void md_register_name_server(mdApi a, char * pszNsAddress){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
p->RegisterNameServer(pszNsAddress);
}
void md_register_fens_user_info(mdApi a, CThostFtdcFensUserInfoField * pFensUserInfo){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
p->RegisterFensUserInfo(pFensUserInfo);
}
void md_register_spi(mdApi a, mdSpi s){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
CThostFtdcMdSpi* spi = (CThostFtdcMdSpi*)s;
p->RegisterSpi(spi);
}
int md_subscribe_market_data(mdApi a, char* ppInstrumentID[], int nCount){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->SubscribeMarketData(ppInstrumentID,nCount);
}
int md_un_subscribe_market_data(mdApi a, char* ppInstrumentID[], int nCount){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->UnSubscribeMarketData(ppInstrumentID,nCount);
}
int md_subscribe_for_quote_rsp(mdApi a, char* ppInstrumentID[], int nCount){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->SubscribeForQuoteRsp(ppInstrumentID,nCount);
}
int md_un_subscribe_for_quote_rsp(mdApi a, char* ppInstrumentID[], int nCount){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->UnSubscribeForQuoteRsp(ppInstrumentID,nCount);
}
int md_req_user_login(mdApi a, CThostFtdcReqUserLoginField * pReqUserLoginField, int nRequestID){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->ReqUserLogin(pReqUserLoginField,nRequestID);
}
int md_req_user_logout(mdApi a, CThostFtdcUserLogoutField * pUserLogout, int nRequestID){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->ReqUserLogout(pUserLogout,nRequestID);
}
int md_req_qry_multicast_instrument(mdApi a, CThostFtdcQryMulticastInstrumentField * pQryMulticastInstrument, int nRequestID){
CThostFtdcMdApi* p = (CThostFtdcMdApi*)a;
return p->ReqQryMulticastInstrument(pQryMulticastInstrument,nRequestID);
}