当前位置: 首页>>代码示例>>C++>>正文


C++ O2G2Ptr::getBalance方法代码示例

本文整理汇总了C++中O2G2Ptr::getBalance方法的典型用法代码示例。如果您正苦于以下问题:C++ O2G2Ptr::getBalance方法的具体用法?C++ O2G2Ptr::getBalance怎么用?C++ O2G2Ptr::getBalance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在O2G2Ptr的用法示例。


在下文中一共展示了O2G2Ptr::getBalance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onTablesUpdates


//.........这里部分代码省略.........
                        case Delete:
                            if (mOrderMonitorNetting)
                            {
                                std::cout << "The order has been deleted. OrderID='" << order->getOrderID() << "'"
                                          << std::endl;
                                mOrderMonitorNetting->onOrderDeleted(order);
                                if (mOrderMonitorNetting->isOrderCompleted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                            break;
                        }
                    }
                    break;
                    case Trades:
                    {
                        O2G2Ptr<IO2GTradeRow> trade = reader->getTradeRow(i);
                        switch (reader->getUpdateType(i))
                        {
                        case Insert:
                        {
                            if (mOrderMonitorNetting)
                            {
                                mOrderMonitorNetting->onTradeAdded(trade);
                                if (mOrderMonitorNetting->isOrderCompleted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                        break;
                        case Update:
                        {
                            if (mOrderMonitorNetting)
                            {
                                mOrderMonitorNetting->onTradeUpdated(trade);
                                if (mOrderMonitorNetting->isOrderCompleted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                        break;
                        }
                    }
                    break;
                    case ClosedTrades:
                    {
                        if (reader->getUpdateType(i) == Insert)
                        {
                            O2G2Ptr<IO2GClosedTradeRow> closedTrade = reader->getClosedTradeRow(i);
                            if (mOrderMonitorNetting)
                            {
                                mOrderMonitorNetting->onClosedTradeAdded(closedTrade);
                                if (mOrderMonitorNetting->isOrderCompleted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                    }
                    break;
                    case Messages:
                    {
                        if (reader->getUpdateType(i) == Insert)
                        {
                            O2G2Ptr<IO2GMessageRow> message = reader->getMessageRow(i);
                            if (mOrderMonitorNetting)
                            {
                                mOrderMonitorNetting->onMessageAdded(message);
                                if (mOrderMonitorNetting->isOrderCompleted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                    }
                    break;
                    case Accounts:
                    {
                        if (reader->getUpdateType(i) == Update && reader->getUpdateTable(i) == Accounts)
                        {
                            O2G2Ptr<IO2GAccountRow> account = reader->getAccountRow(i);
                            std::cout << "The balance has been changed. AccountID=" << account->getAccountID() << ", "
                                      << "Balance=" << std::fixed << account->getBalance() << std::endl;
                        }
                    }
                    break;
                    }
                }
            }
        }
    }
}
开发者ID:ClaudioF82,项目名称:FXCM,代码行数:101,代码来源:ResponseListener.cpp

示例2: onTablesUpdates


//.........这里部分代码省略.........
                {
                    switch (reader->getUpdateTable(i))
                    {
                    case Orders:
                    {
                        O2G2Ptr<IO2GOrderRow> order = reader->getOrderRow(i);
                        if (reader->getUpdateType(i) == Insert)
                        {
                            if (mBatchOrderMonitor)
                            {
                                std::cout << "The order has been added. OrderID='" << order->getOrderID() << "', "
                                        << "Rate='" << order->getRate() << "', "
                                        << "TimeInForce='" << order->getTimeInForce() << "'"
                                        << std::endl;
                                mBatchOrderMonitor->onOrderAdded(order);
                            }
                        }
                        else if (reader->getUpdateType(i) == Delete)
                        {
                            if (mBatchOrderMonitor)
                            {
                                std::cout << "The order has been deleted. OrderID='" << order->getOrderID() << "'"
                                        << std::endl;
                                mBatchOrderMonitor->onOrderDeleted(order);
                                if (mBatchOrderMonitor->isBatchExecuted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                    }
                    break;
                    case Trades:
                    {
                        if (reader->getUpdateType(i) == Insert)
                        {
                            O2G2Ptr<IO2GTradeRow> trade = reader->getTradeRow(i);
                            if (mBatchOrderMonitor)
                            {
                                mBatchOrderMonitor->onTradeAdded(trade);
                                if (mBatchOrderMonitor->isBatchExecuted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                    }
                    break;
                    case ClosedTrades:
                    {
                        if (reader->getUpdateType(i) == Insert)
                        {
                            O2G2Ptr<IO2GClosedTradeRow> closedTrade = reader->getClosedTradeRow(i);
                            if (mBatchOrderMonitor)
                            {
                                mBatchOrderMonitor->onClosedTradeAdded(closedTrade);
                                if (mBatchOrderMonitor->isBatchExecuted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                    }
                    break;
                    case Messages:
                    {
                        if (reader->getUpdateType(i) == Insert)
                        {
                            O2G2Ptr<IO2GMessageRow> message = reader->getMessageRow(i);
                            if (mBatchOrderMonitor)
                            {
                                mBatchOrderMonitor->onMessageAdded(message);
                                if (mBatchOrderMonitor->isBatchExecuted())
                                {
                                    printResult();
                                    SetEvent(mResponseEvent);
                                }
                            }
                        }
                    }
                    break;
                    case Accounts:
                    {
                        if (reader->getUpdateType(i) == Update && reader->getUpdateTable(i) == Accounts)
                        {
                            O2G2Ptr<IO2GAccountRow> account = reader->getAccountRow(i);
                            std::cout << "The balance has been changed. AccountID=" << account->getAccountID() << ", "
                                    << "Balance=" << std::fixed << account->getBalance() << std::endl;
                        }
                    }
                    break;
                    }
                }
            }
        }
    }
}
开发者ID:BryanFletcher,项目名称:FXCM,代码行数:101,代码来源:ResponseListener.cpp


注:本文中的O2G2Ptr::getBalance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。