bool CCESUT::TradeOrder(PTradeOrderTxnInput pTxnInput, INT32 iTradeType, bool bExecutorIsAccountOwner) { ei_x_buff x; ei_x_new_with_version(&x); ei_x_encode_tuple_header(&x, 2); { ei_x_encode_atom(&x, "ok"); ei_x_encode_tuple_header(&x, 2); { ei_x_encode_atom(&x, APP ".BH.TO"); ei_x_encode_tuple_header(&x, 3); { m_Encoder.encode(&x, "trade_type", iTradeType); m_Encoder.encode(&x, "executor_is_account_owner", bExecutorIsAccountOwner); m_Encoder.encode(&x, *pTxnInput); } } } int result = driver_output(m_ErlDrvPort, x.buff, x.index); #ifdef _TRACE cout << "[TO] ! " << *pTxnInput << ", result=" << result << '\r' << endl; #endif ei_x_free(&x); return result; }
bool CDMSUT::TradeCleanup(PTradeCleanupTxnInput pTxnInput) { ei_x_buff x; ei_x_new_with_version(&x); ei_x_encode_tuple_header(&x, 2); { ei_x_encode_atom(&x, "ok"); ei_x_encode_tuple_header(&x, 2); { ei_x_encode_atom(&x, APP ".BH.TC"); m_Encoder.encode(&x, *pTxnInput); } } int result = driver_output(m_ErlDrvPort, x.buff, x.index); #ifdef _TRACE cout << "[TC] ! " << *pTxnInput << ", result=" << result << '\r' << endl; #endif ei_x_free(&x); return result; }
bool CCESUT::MarketWatch(PMarketWatchTxnInput pTxnInput) { ei_x_buff x; ei_x_new_with_version(&x); ei_x_encode_tuple_header(&x, 2); { ei_x_encode_atom(&x, "ok"); ei_x_encode_tuple_header(&x, 2); { ei_x_encode_atom(&x, APP ".BH.MW"); m_Encoder.encode(&x, *pTxnInput); } } int result = driver_output(m_ErlDrvPort, x.buff, x.index); #ifdef _TRACE cout << "[MW] ! " << *pTxnInput << ", result=" << result << '\r' << endl; #endif ei_x_free(&x); return result; }