本文整理汇总了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;
}
示例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;//用完后直接删除
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}