public method IO2GTradesTable.findRow

Brief

Finds a row in the IO2GTradesTable by TradeID.

Declaration
C++
virtual bool  findRow (const char * id, IO2GTradeTableRow *& row) = 0

Parameters
id

The unique identification number of an open position. The number is unique within the same database that stores the account the position is opened on. For example, MINIDEMO or U100D1. The uniqueness of the open position itself is ensured by the combination of the database ID and the value of this parameter.

row

[out] The row fetched.

Details

If the row is not found, the method returns false.

Example

Find open position by TradeID [hide]

    O2G2Ptr<IO2GTradesTable> tradesTable = (IO2GTradesTable *)tableManager->getTable(Trades);
    IO2GTradeTableRow *trade = NULL;
    if (tradesTable->findRow(mTradeID, trade))
    {
        std::cout << "TradeID: " << trade->getTradeID() <<
                     " OfferID = " << trade->getOfferID() <<
                     " Amount = " << trade->getAmount() << std::endl;
        trade->release();
    }

Note: The returned row contains the current values of fields. The values are not automatically updated. To monitor changes, use IO2GTableListener.onChanged. The row interface is thread-safe. One can use the returned row in different threads without synchronization.

Declared in IO2GTradesTable

back