本文整理汇总了C++中MakeRequestBuf函数的典型用法代码示例。如果您正苦于以下问题:C++ MakeRequestBuf函数的具体用法?C++ MakeRequestBuf怎么用?C++ MakeRequestBuf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MakeRequestBuf函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: MakeRequestBuf
void CTraderApi::ReqOrderAction(CThostFtdcOrderField *pOrder)
{
if (NULL == m_pApi)
return;
SRequest* pRequest = MakeRequestBuf(E_InputOrderActionField);
if (NULL == pRequest)
return;
CThostFtdcInputOrderActionField& body = pRequest->InputOrderActionField;
///经纪公司代码
strncpy(body.BrokerID, pOrder->BrokerID,sizeof(TThostFtdcBrokerIDType));
///投资者代码
strncpy(body.InvestorID, pOrder->InvestorID,sizeof(TThostFtdcInvestorIDType));
///报单引用
strncpy(body.OrderRef, pOrder->OrderRef,sizeof(TThostFtdcOrderRefType));
///前置编号
body.FrontID = pOrder->FrontID;
///会话编号
body.SessionID = pOrder->SessionID;
///交易所代码
strncpy(body.ExchangeID,pOrder->ExchangeID,sizeof(TThostFtdcExchangeIDType));
///报单编号
strncpy(body.OrderSysID,pOrder->OrderSysID,sizeof(TThostFtdcOrderSysIDType));
///操作标志
body.ActionFlag = THOST_FTDC_AF_Delete;
///合约代码
strncpy(body.InstrumentID, pOrder->InstrumentID,sizeof(TThostFtdcInstrumentIDType));
long lRequest = InterlockedIncrement(&m_lRequestID);
m_pApi->ReqOrderAction(&pRequest->InputOrderActionField,lRequest);
delete pRequest;
}
开发者ID:HeiLine,项目名称:CTP,代码行数:34,代码来源:TraderApi.cpp
示例2: WriteLog
void CTraderApi::ReqQuoteCancelOrder(
const string& szInstrumentId,
DFITCLocalOrderIDType localOrderID,
DFITCSPDOrderIDType spdOrderID)
{
WriteLog("ReqQuoteCancelOrder localOrderID=%d spdOrderID =%d szInstrumentId=%s ",localOrderID , spdOrderID, szInstrumentId.c_str());
if (NULL == m_pApi)
return;
SRequest* pRequest = MakeRequestBuf(E_QuoteCancelOrderField);
if (NULL == pRequest)
return;
DFITCCancelOrderField* body = (DFITCCancelOrderField*)pRequest->pBuf;
strncpy(body->accountID, m_szAccountID.c_str(),sizeof(DFITCAccountIDType));
// 合约
strncpy(body->instrumentID,szInstrumentId.c_str(),sizeof(DFITCInstrumentIDType));
body->localOrderID = localOrderID;
body->spdOrderID = spdOrderID;
m_pApi->ReqQuoteCancelOrder(body);
delete pRequest->pBuf;
delete pRequest;//用完后直接删除
}
开发者ID:fouvy,项目名称:XSpeed,代码行数:29,代码来源:TraderApi.cpp
示例3: MakeRequestBuf
int CTraderApi::ReqOrderAction(CSecurityFtdcOrderField *pOrder)
{
if (nullptr == m_pApi)
return 0;
SRequest* pRequest = MakeRequestBuf(E_InputOrderActionField);
if (nullptr == pRequest)
return 0;
CSecurityFtdcInputOrderActionField& body = pRequest->InputOrderActionField;
///经纪公司代码
strncpy(body.BrokerID, pOrder->BrokerID,sizeof(TSecurityFtdcBrokerIDType));
///投资者代码
strncpy(body.InvestorID, pOrder->InvestorID,sizeof(TSecurityFtdcInvestorIDType));
///报单引用
strncpy(body.OrderRef, pOrder->OrderRef,sizeof(TSecurityFtdcOrderRefType));
///前置编号
body.FrontID = pOrder->FrontID;
///会话编号
body.SessionID = pOrder->SessionID;
///交易所代码
strncpy(body.ExchangeID,pOrder->ExchangeID,sizeof(TSecurityFtdcExchangeIDType));
///报单编号
//strncpy(body.OrderSysID,pOrder->OrderSysID,sizeof(TSecurityFtdcOrderSysIDType));
///操作标志
body.ActionFlag = SECURITY_FTDC_AF_Delete;
///合约代码
strncpy(body.InstrumentID, pOrder->InstrumentID,sizeof(TSecurityFtdcInstrumentIDType));
int nRet = m_pApi->ReqOrderAction(&pRequest->InputOrderActionField, ++m_lRequestID);
delete pRequest;
return nRet;
}
开发者ID:junyiliu,项目名称:QuantBox_XAPI,代码行数:34,代码来源:TraderApi.cpp
示例4: MakeRequestBuf
int CTraderApi::ReqQuoteAction(CThostFtdcQuoteField *pQuote)
{
if (NULL == m_pApi)
return 0;
SRequest* pRequest = MakeRequestBuf(E_InputQuoteActionField);
if (NULL == pRequest)
return 0;
CThostFtdcInputQuoteActionField& body = pRequest->InputQuoteActionField;
///经纪公司代码
strncpy(body.BrokerID, pQuote->BrokerID, sizeof(TThostFtdcBrokerIDType));
///投资者代码
strncpy(body.InvestorID, pQuote->InvestorID, sizeof(TThostFtdcInvestorIDType));
///报单引用
strncpy(body.QuoteRef, pQuote->QuoteRef, sizeof(TThostFtdcOrderRefType));
///前置编号
body.FrontID = pQuote->FrontID;
///会话编号
body.SessionID = pQuote->SessionID;
///交易所代码
strncpy(body.ExchangeID, pQuote->ExchangeID, sizeof(TThostFtdcExchangeIDType));
///报单编号
strncpy(body.QuoteSysID, pQuote->QuoteSysID, sizeof(TThostFtdcOrderSysIDType));
///操作标志
body.ActionFlag = THOST_FTDC_AF_Delete;
///合约代码
strncpy(body.InstrumentID, pQuote->InstrumentID, sizeof(TThostFtdcInstrumentIDType));
int nRet = m_pApi->ReqQuoteAction(&pRequest->InputQuoteActionField, ++m_lRequestID);
delete pRequest;
return nRet;
}
开发者ID:LegendZX,项目名称:CTP,代码行数:34,代码来源:TraderApi.cpp
示例5: MakeRequestBuf
void CTraderApi::ReqQryCustomerCapital()
{
if (NULL == m_pApi)
return;
SRequest* pRequest = MakeRequestBuf(E_CapitalField);
if (NULL == pRequest)
return;
DFITCCapitalField* body = (DFITCCapitalField*)pRequest->pBuf;
strncpy(body->accountID, m_szAccountID.c_str(),sizeof(DFITCAccountIDType));
AddToSendQueue(pRequest);
}
开发者ID:fouvy,项目名称:XSpeed,代码行数:15,代码来源:TraderApi.cpp
示例6: MakeRequestBuf
void CTraderApi::ReqQryInstrument(const string& szInstrumentId, const string& szExchange)
{
if (nullptr == m_pApi)
return;
SRequest* pRequest = MakeRequestBuf(E_QryInstrumentField);
if (nullptr == pRequest)
return;
CThostFtdcQryInstrumentField& body = pRequest->QryInstrumentField;
strncpy(body.ContractID, szInstrumentId.c_str(), sizeof(TThostFtdcInstrumentIDType));
//strncpy(body.ProductID, szExchange.c_str(), sizeof(TThostFtdcProductIDType));
AddToSendQueue(pRequest);
}
开发者ID:Yoonee,项目名称:QuantBox_XAPI,代码行数:16,代码来源:TraderApi.cpp
示例7: MakeRequestBuf
void CTraderApi::ReqQryTrade()
{
if (nullptr == m_pApi)
return;
SRequest* pRequest = MakeRequestBuf(E_QryTradeField);
if (nullptr == pRequest)
return;
CUstpFtdcQryTradeField& body = pRequest->QryTradeField;
strcpy(body.BrokerID, m_RspUserInvestor.BrokerID);
strcpy(body.UserID, m_RspUserInvestor.UserID);
strcpy(body.InvestorID, m_RspUserInvestor.InvestorID);
AddToSendQueue(pRequest);
}
开发者ID:IndigoDai,项目名称:QuantBox_XAPI,代码行数:17,代码来源:TraderApi.cpp
注:本文中的MakeRequestBuf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论