public method IO2GOffersTable.getNextRowByColumnValues

Brief

Gets the next row from IO2GOffersTable based on any of the column values.

Declaration
C++
virtual bool  getNextRowByColumnValues (const char *columnName, const int valueCount, const void *columnValues[], IO2GTableIterator &iterator, IO2GOfferTableRow *&row) = 0

Parameters
columnName

The name of a column in the Offers table. For example, OfferID.

valueCount

Number of values of the column.

columnValues

The values of the column specified by the columnName parameter. For example, if you want to search the Offers table for instruments with the size of one pip 0.1, 0.01, or 0.001, the columnName parameter value is PointSize, the columnValues parameter value is an array of 0.1, 0.01, and 0.001, the valueCount parameter value is 3.

iterator

The table iterator.

row

[out] The row fetched.

Details

This method allows finding all rows that contain any of the specified column values.
If the row is not found, the method returns false.

Example

Get instruments from the Offers table with specified PointSize [hide]

    O2G2Ptr<IO2GOffersTable> offersTable = (IO2GOffersTable *)tableManager->getTable(Offers);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GOfferTableRow *offer = NULL;
    const double dec = 0.1;
    const double hun = 0.01;
    const double tho = 0.001;
    const void *columnValues[] = {(void *)&dec, (void *)&hun, (void *)&tho};
    while (offersTable->getNextRowByColumnValues("PointSize", 3, 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 column 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