public method IO2GOffersTable.getNextRowByMultiColumnValues

Brief

Gets the next row from IO2GOffersTable based on the multiple columns values.

Declaration
C++
virtual bool  getNextRowByMultiColumnValues (const int columnCount, const char *columnNames[], const void *columnValues[], IO2GTableIterator &iterator, IO2GOfferTableRow *&row) = 0

Parameters
columnCount

Number of columns in which the search is to be performed.

columnNames

The array of column names in the Offers table.

columnValues

The array of values of the column specified by the columnNames parameter. For example, if you want to search the Offers table for tradable Forex instruments only, the columnNames parameter value is an array of InstrumentType and TradingStatus, the columnValues parameter is an array of 1 and O, columnCount parameter value is 2.

iterator

The table iterator.

row

[out] The row fetched.

Details

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

Example

Get tradable Forex instruments from the Offers table [hide]

    O2G2Ptr<IO2GOffersTable> offersTable = (IO2GOffersTable *)tableManager->getTable(Offers);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GOfferTableRow *offer = NULL;
    const char *columnNames[] = {"InstrumentType", "TradingStatus"};
    const int forexInstrument = 1;
    const void *columnValues[] = {(void *)&forexInstrument, (void *)"O"};
    while (offersTable->getNextRowByMultiColumnValues(2, columnNames, columnValues, iterator, offer))
    {
        found = true;
        std::cout << "Instrument: " << offer->getInstrument() <<
                     " Bid = " << offer->getBid() <<
                     " Ask = " << offer->getAsk() << std::endl;
        offer->release();
    }
    if (!found)
        std::cout << "No instruments found." << std:endl;

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

Declared in IO2GOffersTable

back