public method IO2GSession.useTableManager
Brief
Defines usage of the table manager.
| Declaration | ||||
|
||||
| Parameters | |
mode |
The table manager mode. |
tableManagerListener |
The listener to the table manager status (tables readiness). If you application does not implement table manager listener, use |
Details
This method must be called before logging in to ForexConnect. By default the table manager mode is No.
useTableManager - without table manager listener [hide]
session->useTableManager(::Yes, NULL);
session->login(user.c_str(), password.c_str(), url.c_str(), connection.c_str());
//...
IO2GTableManager *tableManager = session->getTableManager();
while (tableManager->getStatus() != TablesLoaded && tableManager->getStatus() != TablesLoadFailed)
uni::Sleep(50);
if (tableManager->getStatus() == TablesLoaded)
{
//...
}
tableManager->release();
useTableManager - use table manager listener [hide]
TablesManagerStatusListener *tablesStatusListener = new TablesManagerStatusListener();
session->useTableManager(::Yes, tablesStatusListener);
session->login(user.c_str(), password.c_str(), url.c_str(), connection.c_str());
// ...
// wait for IO2GTableManagerListener.onStatusChanged
if (tablesStatusListener->isTablesLoaded()) // function checking whether table manager status is TablesLoaded
{
IO2GTableManager *tableManager = session->getTableManager();
//...
tableManager->release();
}
session->logout();
//...
tablesStatusListener->release();
// implement IO2GTableManagerListener
class TablesManagerStatusListener : public IO2GTableManagerListener {...}
Declared in IO2GSession