class IO2GMessagesTableResponseReader

Parents
IO2GGenericTableResponseReader

Brief

The class reads a stream of message rows coming from the trading server.

Details

All data from the trading server come in the form of responses. The type of the response depends on the type of the request. An IO2GResponse object of the GetMessages type comes from the trading server as a response to the request for initial message information. The response consists of the Messages table rows. Every row is represented by an IO2GMessageRow object. In order to read this response, you must use the O2GMessagesTableResponseReader.

Getting the response

If your application uses the IO2GTableManager, the Messages table is always loaded during the login process. This information is kept in the IO2GMessagesTable object.

If your application does not use the IO2GTableManager, the initial message information needs to be requested.
The Messages table is always loaded by the server automatically during the login process. To obtain the GetMessages response, call the IO2GLoginRules.getTableRefreshResponse method. For example,

O2GResponse messagesResponse = loginRules.getTableRefreshResponse(O2GTable::Messages);

Instantiating the class

After receiving the GetMessages response, an instance of the O2GMessagesTableResponseReader class can be obtained by calling the IO2GResponseReaderFactory.createMessagesTableReader method. For example:

O2G2Ptr<IO2GResponseReaderFactory> responseFactory = session->getResponseReaderFactory();
if (responseFactory)
{
O2G2Ptr<IO2GMessagesTableResponseReader> messagesReader = responseFactory->createMessagesTableReader(messagesResponse);
...
}

Public Methods

columns

Gets an instance of the class that provides access to the list of table columns.

getCell

Gets the value of a cell.

getGenericRow

Gets a generic row by its index.

getRow

Gets a row from the Messages table.

getType

Gets the type of a trading table.

isCellValid

Checks whether the cell value can be used or not.

size

Gets the number of rows in the reader.

back