class IO2GTablesUpdatesReader
Parents | |
IAddRef |
Brief
The class reads a stream of table updates coming from the trading server.
Details
If your application uses the IO2GTableManager class, the table updates must be captured in the methods of the class implementing the
IO2GTableListener interface. In this case, the usage of the IO2GTablesUpdatesReader
class is not required.
If your application does not use the IO2GTableManager class and you request initial trading tables information, the following sequence of events occurs:
The trading server sends a response to the initial request. For example, if you request initial accounts information, the response is of the GetAccounts type; if you request initial orders information, the response is of the GetOrders type, etc. Notifications about the successful completion of these requests must be processed by using the IO2GResponseListener.onRequestCompleted method.
The server sends responses about updates of the initially requested tables automatically. These responses are of the TablesUpdates type and must be processed by using the IO2GResponseListener.onTablesUpdates method.
To process the contents of a response object of the TablesUpdates
type, you must use an instance of the IO2GTablesUpdatesReader
class.
To get an instance of the class, use the IO2GResponseReaderFactory
.createTablesUpdatesReader
method
by passing the response
parameter of the IO2GResponseListener.onTablesUpdates method as an argument. For example,
O2GTablesUpdatesReader updatesReader = factory.createTablesUpdatesReader(response);
Example
IO2GTablesUpdatesReader [hide]
void ResponseListener::onTablesUpdates(IO2GResponse *data) { O2G2Ptr<IO2GResponseReaderFactory> factory = mSession->getResponseReaderFactory(); if (factory) { O2G2Ptr<IO2GTablesUpdatesReader> reader = factory->createTablesUpdatesReader(data); for (int i = 0; i < reader->size(); ++i) { if (reader->getUpdateType(i) == Insert) { if (mOrderID.length() != 0) { O2G2Ptr<IO2GOrderRow> orderRow = reader->getOrderRow(i); //... } } } } }
Public Methods | |
Gets an instance of the class that provides access to the account information. |
|
Gets an instance of the class that provides access to the closed position information. |
|
Gets an instance of the class that provides access to the message information. |
|
Gets an instance of the class that provides access to the offer information. |
|
Gets an instance of the class that provides access to the order information. |
|
Gets a calendar instance representing the date/time of a table update. |
|
Gets an instance of the class that provides access to the open position information. |
|
Gets the table that is updated. |
|
Gets the type of a table update. |
|
Gets the number of rows in the reader. |