2015-03-02 05:05:53 +00:00
|
|
|
void TdApi::OnFrontConnected()
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONFRONTCONNECTED;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnFrontDisconnected(int nReason)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONFRONTDISCONNECTED;
|
|
|
|
task.task_id = nReason;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnHeartBeatWarning(int nTimeLapse)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONHEARTBEATWARNING;
|
|
|
|
task.task_id = nTimeLapse{};
|
|
|
|
;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRSPERROR;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRSPUSERLOGIN;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pRspUserLogin)
|
|
|
|
{
|
|
|
|
task.task_data = *pRspUserLogin;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspUserLoginField empty_data = CSecurityFtdcRspUserLoginField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRSPUSERLOGOUT;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pUserLogout)
|
|
|
|
{
|
|
|
|
task.task_data = *pUserLogout;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcUserLogoutField empty_data = CSecurityFtdcUserLogoutField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
void TdApi::OnRspFetchAuthRandCode(CSecurityFtdcAuthRandCodeField *pAuthRandCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
2015-03-02 05:05:53 +00:00
|
|
|
{
|
|
|
|
Task task = Task();
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_name = ONRSPFETCHAUTHRANDCODE;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
if (pAuthRandCode)
|
2015-03-26 07:47:39 +00:00
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_data = *pAuthRandCode;
|
2015-03-26 07:47:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
CSecurityFtdcAuthRandCodeField empty_data = CSecurityFtdcAuthRandCodeField();
|
2015-03-26 07:47:39 +00:00
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
void TdApi::OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
2015-03-02 05:05:53 +00:00
|
|
|
{
|
|
|
|
Task task = Task();
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_name = ONRSPORDERINSERT;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
if (pInputOrder)
|
2015-03-26 07:47:39 +00:00
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_data = *pInputOrder;
|
2015-03-26 07:47:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
CSecurityFtdcInputOrderField empty_data = CSecurityFtdcInputOrderField();
|
2015-03-26 07:47:39 +00:00
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
void TdApi::OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
2015-03-02 05:05:53 +00:00
|
|
|
{
|
|
|
|
Task task = Task();
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_name = ONRSPORDERACTION;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
if (pInputOrderAction)
|
2015-03-26 07:47:39 +00:00
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_data = *pInputOrderAction;
|
2015-03-26 07:47:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
CSecurityFtdcInputOrderActionField empty_data = CSecurityFtdcInputOrderActionField();
|
2015-03-26 07:47:39 +00:00
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
void TdApi::OnRspUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
2015-03-02 05:05:53 +00:00
|
|
|
{
|
|
|
|
Task task = Task();
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_name = ONRSPUSERPASSWORDUPDATE;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
if (pUserPasswordUpdate)
|
2015-03-26 07:47:39 +00:00
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_data = *pUserPasswordUpdate;
|
2015-03-26 07:47:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
CSecurityFtdcUserPasswordUpdateField empty_data = CSecurityFtdcUserPasswordUpdateField();
|
2015-03-26 07:47:39 +00:00
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
void TdApi::OnRspTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
2015-03-02 05:05:53 +00:00
|
|
|
{
|
|
|
|
Task task = Task();
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_name = ONRSPTRADINGACCOUNTPASSWORDUPDATE;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
2015-09-28 03:42:35 +00:00
|
|
|
if (pTradingAccountPasswordUpdate)
|
2015-03-26 07:47:39 +00:00
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
task.task_data = *pTradingAccountPasswordUpdate;
|
2015-03-26 07:47:39 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-09-28 03:42:35 +00:00
|
|
|
CSecurityFtdcTradingAccountPasswordUpdateField empty_data = CSecurityFtdcTradingAccountPasswordUpdateField();
|
2015-03-26 07:47:39 +00:00
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRtnOrder(CSecurityFtdcOrderField *pOrder)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRTNORDER;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pOrder)
|
|
|
|
{
|
|
|
|
task.task_data = *pOrder;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcOrderField empty_data = CSecurityFtdcOrderField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
2015-03-02 05:05:53 +00:00
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRtnTrade(CSecurityFtdcTradeField *pTrade)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRTNTRADE;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pTrade)
|
|
|
|
{
|
|
|
|
task.task_data = *pTrade;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcTradeField empty_data = CSecurityFtdcTradeField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
2015-03-02 05:05:53 +00:00
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONERRRTNORDERINSERT;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pInputOrder)
|
|
|
|
{
|
|
|
|
task.task_data = *pInputOrder;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcInputOrderField empty_data = CSecurityFtdcInputOrderField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction, CSecurityFtdcRspInfoField *pRspInfo)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONERRRTNORDERACTION;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pOrderAction)
|
|
|
|
{
|
|
|
|
task.task_data = *pOrderAction;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcOrderActionField empty_data = CSecurityFtdcOrderActionField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRspFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRSPFUNDOUTBYLIBER;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pInputFundTransfer)
|
|
|
|
{
|
|
|
|
task.task_data = *pInputFundTransfer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcInputFundTransferField empty_data = CSecurityFtdcInputFundTransferField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRtnFundOutByLiber(CSecurityFtdcFundTransferField *pFundTransfer)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRTNFUNDOUTBYLIBER;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pFundTransfer)
|
|
|
|
{
|
|
|
|
task.task_data = *pFundTransfer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcFundTransferField empty_data = CSecurityFtdcFundTransferField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
2015-03-02 05:05:53 +00:00
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnErrRtnFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONERRRTNFUNDOUTBYLIBER;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pInputFundTransfer)
|
|
|
|
{
|
|
|
|
task.task_data = *pInputFundTransfer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcInputFundTransferField empty_data = CSecurityFtdcInputFundTransferField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRtnFundInByBank(CSecurityFtdcFundTransferField *pFundTransfer)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRTNFUNDINBYBANK;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pFundTransfer)
|
|
|
|
{
|
|
|
|
task.task_data = *pFundTransfer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcFundTransferField empty_data = CSecurityFtdcFundTransferField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
2015-03-02 05:05:53 +00:00
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRspFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRSPFUNDINTERTRANSFER;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pFundInterTransfer)
|
|
|
|
{
|
|
|
|
task.task_data = *pFundInterTransfer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcFundInterTransferField empty_data = CSecurityFtdcFundInterTransferField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
task.task_id = nRequestID;
|
|
|
|
task.task_last = bIsLast;
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnRtnFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONRTNFUNDINTERTRANSFERSERIAL;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pFundInterTransferSerial)
|
|
|
|
{
|
|
|
|
task.task_data = *pFundInterTransferSerial;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcFundInterTransferSerialField empty_data = CSecurityFtdcFundInterTransferSerialField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
2015-03-02 05:05:53 +00:00
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|
|
|
|
void TdApi::OnErrRtnFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo)
|
|
|
|
{
|
|
|
|
Task task = Task();
|
|
|
|
task.task_name = ONERRRTNFUNDINTERTRANSFER;
|
2015-03-26 07:47:39 +00:00
|
|
|
|
|
|
|
if (pFundInterTransfer)
|
|
|
|
{
|
|
|
|
task.task_data = *pFundInterTransfer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcFundInterTransferField empty_data = CSecurityFtdcFundInterTransferField();
|
|
|
|
memset(&empty_data, 0, sizeof(empty_data));
|
|
|
|
task.task_data = empty_data;
|
|
|
|
}
|
|
|
|
|
2015-03-02 05:05:53 +00:00
|
|
|
if (pRspInfo)
|
|
|
|
{
|
|
|
|
task.task_error = *pRspInfo;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();
|
|
|
|
memset(&empty_error, 0, sizeof(empty_error));
|
|
|
|
task.task_error = empty_error;
|
|
|
|
}
|
|
|
|
this->task_queue.push(task);
|
|
|
|
};
|
|
|
|
|