public method IO2GMessagesTable.getNextRowByColumnValues

Brief

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

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

Parameters
columnName

The name of a column in the Messages table. For example, From.

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 Messages table for pop-up messages only, the columnName parameter value is Type, the columnValues parameter value is an array of 1 and 2, the valueCount parameter value is 2.

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 pop-up messages [hide]

    O2G2Ptr<IO2GMessagesTable> messagesTable = (IO2GMessagesTable *)tableManager->getTable(Messages);
    bool found = false;
    IO2GTableIterator iterator;
    IO2GMessageTableRow *message = NULL;
    const void *columnValues[] = {(void *)"1", (void *)"2"};
    while (messagesTable->getNextRowByColumnValues("Type", 2, columnValues, iterator, message))
    {
        found = true;
        std::cout << "MessageID: " << message->getMsgID() <<
                     " From = " << message->getFrom() <<
                     " Text = " << message->getText() << std::endl;
        message->release();
    }
    if (!found)
        std::cout << "No pop-up messages 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 IO2GMessagesTable

back