public method IO2GTable.forEachRow

Brief

Iterates through the rows of the table.

Declaration
C++
virtual void  forEachRow () = 0

Details

This method is synchronous. The application will wait until each row is processed in IO2GEachRowListener.onEachRow.

Print table using forEachRow [hide]

class EachRowListener : public IO2GEachRowListener
{
 public:
 .....
 /** IO2GEachRowListener interface */
void onEachRow(const char *rowID, IO2GRow *rowData)
{
     IO2GTradeTableRow *row = dynamic_cast<IO2GTradeTableRow *>(rowData);
     if (row)
         std::cout << "ID: " << row->getTradeID() << \
                  " Direction: " << row->getBuySell() << \
                  " Amount: " << row->getAmount() << std::endl;
}
};
 
/** Print table using IO2GEachRowListener */
void PrintTable2(IO2GTradesTable *tradesTable)
{
   if (tradesTable)
   {
       EachRowListener *eachRowListener = new EachRowListener();
       std::cout << "TradesTable: " << std::endl;
       tradesTable->forEachRow(eachRowListener);
       eachRowListener->release();
   }
}

Declared in IO2GTable

back